tests/test-evolve-content-divergent-relocation.t
changeset 5342 265e029785ae
parent 5341 13376ca93fa3
child 5343 ebfd0d875600
equal deleted inserted replaced
5341:13376ca93fa3 5342:265e029785ae
   598        rewritten(branch, parent) as 30de78f605eb using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   598        rewritten(branch, parent) as 30de78f605eb using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
   599        amended(content) as ff9e3b1b6df8 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   599        amended(content) as ff9e3b1b6df8 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   600   
   600   
   601 
   601 
   602   $ cd ..
   602   $ cd ..
       
   603 
       
   604 Testing when relocation results in nothing to commit
       
   605 ----------------------------------------------------
       
   606 
       
   607 Set up a repo where relocation results in no changes to commit because the
       
   608 changes from the relocated node are already in the destination.
       
   609 
       
   610   $ hg init nothing-to-commit
       
   611   $ cd nothing-to-commit
       
   612   $ echo 0 > a
       
   613   $ hg ci -Aqm initial
       
   614   $ echo 1 > a
       
   615   $ hg ci -Aqm upstream
       
   616   $ hg prev -q
       
   617 
       
   618 Create the source of divergence.
       
   619   $ echo 0 > b
       
   620   $ hg ci -Aqm divergent
       
   621 
       
   622 The first side of the divergence get rebased on top of upstream.
       
   623   $ hg rebase -r . -d 'desc("upstream")'
       
   624   rebasing 2:898ddd4443b3 "divergent" (tip)
       
   625   $ hg --hidden co 2 -q
       
   626   updated to hidden changeset 898ddd4443b3
       
   627   (hidden revision '898ddd4443b3' was rewritten as: befae6138569)
       
   628   working directory parent is obsolete! (898ddd4443b3)
       
   629 
       
   630 The other side of the divergence gets amended so it matches upstream.
       
   631 Relocation (onto upstream) will therefore result in no changes to commit.
       
   632   $ hg revert -r 'desc("upstream")' --all
       
   633   removing b
       
   634   reverting a
       
   635   $ hg amend --config experimental.evolution.allowdivergence=True
       
   636   2 new content-divergent changesets
       
   637 
       
   638 Add a commit on top. This one should become an orphan. Evolving it later
       
   639 should put it on top of the other divergent side (the one that's on top of
       
   640 upstream)
       
   641   $ echo 0 > c
       
   642   $ hg ci -Aqm child
       
   643   $ hg co -q null
       
   644   $ hg glog
       
   645   o  5:88473f9137d1 child
       
   646   |   () [default] draft
       
   647   *  4:4cc21313ecee divergent
       
   648   |   () [default] draft
       
   649   | *  3:befae6138569 divergent
       
   650   | |   () [default] draft
       
   651   | o  1:33c576d20069 upstream
       
   652   |/    () [default] draft
       
   653   o  0:98a3f8f02ba7 initial
       
   654       () [default] draft
       
   655   $ hg evolve --content-divergent 2>&1 | grep TypeError
       
   656   TypeError: expected *, NoneType found (glob)
       
   657 
       
   658   $ cd ..