Pierre-Yves David  committed 8337bb3

Fix amend and relocate who picked phases data after extinct wher made secret

  • Participants
  • Parent commits bbd1adb

Comments (0)

Files changed (1)

File hgext/

         assert orig.p2().rev() == node.nullrev, 'no support yet'
         destbookmarks = repo.nodebookmarks(dest.node())
         cmdutil.duplicatecopies(repo, orig.node(), dest.node())
+        nodesrc = orig.node()
+        destphase = repo[nodesrc].phase()
         if rebase.rebasenode.func_code.co_argcount == 5:
             # rebasenode collapse argument was introduced by
             # d1afbf03e69a (2.3)
             rebase.rebasenode(repo, orig.node(), dest.node(),
                               {node.nullrev: node.nullrev})
         nodenew = rebase.concludenode(repo, orig.node(), dest.node(), node.nullid)
-        nodesrc = orig.node()
+        phases.retractboundary(repo, destphase, [nodenew])
         repo.addobsolete(nodenew, nodesrc)
-        phases.retractboundary(repo, repo[nodesrc].phase(), [nodenew])
         oldbookmarks = repo.nodebookmarks(nodesrc)
         for book in oldbookmarks:
             repo._bookmarks[book] = nodenew
             if not old.phase():
                 raise util.Abort(_("can not rewrite immutable changeset %s") % old)
+            oldphase = old.phase()
             # commit current changes as update
             # code copied from commands.commit to avoid noisy messages
             ciopts = dict(opts)
                             [old.p1().node(), old.p2().node()], opts)
             # reroute the working copy parent to the new changeset
-            phases.retractboundary(repo, old.phase(), [newid])
+            phases.retractboundary(repo, oldphase, [newid])
             repo.dirstate.setparents(newid, node.nullid)