diff hgext/evolve.py @ 1239:8a06b32061ce

evolve: apply prune update before creating obsolescence markers Prune used to compute the destination commit to update to after creating the obsolescence markers. This is a commit to prevent a bug that would occur with the changes in inhibit for transactions (next commit). Indeed, with that change in inhibit, when creating the obsolescence markers in prune, they would get inhibited right away and we wouldn't update to the first non obsolete parent but stay on the same node as its obsolescence would have been inhibited (bug).
author Laurent Charignon <lcharignon@fb.com>
date Thu, 02 Apr 2015 18:33:44 -0700
parents ffa32ca659f1
children 4279ec5ff3a7
line wrap: on
line diff
--- a/hgext/evolve.py	Fri Apr 03 11:35:46 2015 -0700
+++ b/hgext/evolve.py	Thu Apr 02 18:33:44 2015 -0700
@@ -1832,12 +1832,6 @@
         if biject:
             relations = [(p, (s,)) for p, s in zip(precs, sucs)]
 
-        # create markers
-        obsolete.createmarkers(repo, relations, metadata=metadata)
-
-        # informs that changeset have been pruned
-        ui.status(_('%i changesets pruned\n') % len(precs))
-
         wdp = repo['.']
 
         if len(sucs) == 1 and len(precs) == 1 and wdp in precs:
@@ -1847,9 +1841,10 @@
             # update to an unkilled parent
             newnode = wdp
 
-            while newnode.obsolete():
+            while newnode in precs or newnode.obsolete():
                 newnode = newnode.parents()[0]
 
+
         if newnode.node() != wdp.node():
             if opts.get('keep', False):
                 # This is largely the same as the implementation in
@@ -1876,6 +1871,13 @@
         # update bookmarks
         if bookmark:
             _deletebookmark(ui, marks, bookmark)
+
+        # create markers
+        obsolete.createmarkers(repo, relations, metadata=metadata)
+        
+        # informs that changeset have been pruned
+        ui.status(_('%i changesets pruned\n') % len(precs))
+
         for ctx in repo.unfiltered().set('bookmark() and %ld', precs):
             # used to be:
             #