tests/test-amend.t
changeset 5079 1f92a6aa40d6
parent 4988 588b3484c131
child 5123 900668a93629
equal deleted inserted replaced
5078:66f01dd79f5d 5079:1f92a6aa40d6
   119   branch: foo
   119   branch: foo
   120   commit: 1 unknown (clean)
   120   commit: 1 unknown (clean)
   121   update: (current)
   121   update: (current)
   122   phases: 3 draft
   122   phases: 3 draft
   123 
   123 
       
   124 setting the user after we have performed the test with no username
       
   125   $ HGUSER=test
       
   126 
   124 Check the help
   127 Check the help
   125   $ hg amend -h
   128   $ hg amend -h
   126   hg amend [OPTION]... [FILE]...
   129   hg amend [OPTION]... [FILE]...
   127   
   130   
   128   aliases: refresh
   131   aliases: refresh
   168 
   171 
   169 Check that we abort if --patch and --extract both are used at once
   172 Check that we abort if --patch and --extract both are used at once
   170   $ hg amend --patch --extract
   173   $ hg amend --patch --extract
   171   abort: cannot use both --patch and --extract
   174   abort: cannot use both --patch and --extract
   172   [255]
   175   [255]
       
   176 
       
   177   $ cd ..
       
   178 
       
   179 Check the pre-check logic for content-divergence
       
   180   $ hg init precheckrepo
       
   181   $ cd precheckrepo
       
   182   $ echo a > a
       
   183   $ hg ci -Am "added a"
       
   184   adding a
       
   185   $ echo newchanges > a
       
   186   $ hg amend
       
   187   $ hg up 0 --hidden -q
       
   188   updated to hidden changeset 9092f1db7931
       
   189   (hidden revision '9092f1db7931' was rewritten as: aafaf407b00d)
       
   190   working directory parent is obsolete! (9092f1db7931)
       
   191 
       
   192 when rewritting an already rewritten changeset (i.e cset being rewritten will
       
   193 be the base of divergence)
       
   194   $ hg amend -m "i am gonna create divergence"
       
   195   abort: amend of 9092f1db7931 creates content-divergence with aafaf407b00d
       
   196   (add --verbose for details or see 'hg help evolution.instability')
       
   197   [255]
       
   198   $ hg amend -m "i am gonna create divergence" --verbose
       
   199   abort: amend of 9092f1db7931 creates content-divergence with aafaf407b00d
       
   200       changeset 9092f1db7931 already have a successors as changeset aafaf407b00d
       
   201       rewriting changeset 9092f1db7931 would create "content-divergence"
       
   202       set experimental.evolution.allowdivergence=True to overwrite this check
       
   203   (see 'hg help evolution.instability' for details on content-divergence)
       
   204   [255]
       
   205 
       
   206 when rewritting a cset which has a predecessor with non-obsolete successor
       
   207 
       
   208 to prepare the repo
       
   209 1) create content-divergence
       
   210 2) remove divergence by pruning one of the divergent cset
       
   211   $ echo edited_a > a
       
   212   $ hg ci -m "edited a"
       
   213   1 new orphan changesets
       
   214   $ hg debugobsolete $(hg id -ir 0 --debug) $(hg id -ir 2 --debug)
       
   215   1 new obsolescence markers
       
   216   2 new content-divergent changesets
       
   217 
       
   218 remove divergence by pruning one side of divergenence
       
   219   $ hg debugobsolete $(hg id -ir 2 --debug)
       
   220   1 new obsolescence markers
       
   221   obsoleted 1 changesets
       
   222 
       
   223   $ hg evolve -l
       
   224   $ hg amend -m "i am gonna create divergence"
       
   225   abort: amend of f8c05838af90 creates content-divergence with aafaf407b00d, from 9092f1db7931
       
   226   (add --verbose for details or see 'hg help evolution.instability')
       
   227   [255]
       
   228   $ hg amend -m "i am gonna create divergence" --verbose
       
   229   abort: amend of f8c05838af90 creates content-divergence with aafaf407b00d, from 9092f1db7931
       
   230       changeset f8c05838af90 is an evolution of changeset 9092f1db7931
       
   231       changeset 9092f1db7931 already have a successors as changeset aafaf407b00d
       
   232       rewriting changeset f8c05838af90 would create "content-divergence"
       
   233       set experimental.evolution.allowdivergence=True to overwrite this check
       
   234   (see 'hg help evolution.instability' for details on content-divergence)
       
   235   [255]