mercurial/commit.py
changeset 46357 72f5280e33b6
parent 45942 89a2afe31e82
child 46371 0903d6b9b1df
--- a/mercurial/commit.py	Tue Jan 19 14:00:42 2021 -0800
+++ b/mercurial/commit.py	Tue Jan 19 00:18:39 2021 +0100
@@ -96,6 +96,7 @@
             ctx.date(),
             extra,
         )
+        rev = repo[n].rev()
         xp1, xp2 = p1.hex(), p2 and p2.hex() or b''
         repo.hook(
             b'pretxncommit',
@@ -108,7 +109,7 @@
         targetphase = subrepoutil.newcommitphase(repo.ui, ctx)
 
         # prevent unmarking changesets as public on recommit
-        waspublic = oldtip == repo.changelog.tiprev() and not repo[n].phase()
+        waspublic = oldtip == repo.changelog.tiprev() and not repo[rev].phase()
 
         if targetphase and not waspublic:
             # retract boundary do not alter parent changeset.
@@ -116,7 +117,7 @@
             # be compliant anyway
             #
             # if minimal phase was 0 we don't need to retract anything
-            phases.registernew(repo, tr, targetphase, [repo[n].rev()])
+            phases.registernew(repo, tr, targetphase, [rev])
         return n