[Updated] D9830: commit: look-up new revision once

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Wed Jan 20 20:25:00 UTC 2021


Closed by commit rHG72f5280e33b6: commit: look-up new revision once (authored by joerg.sonnenberger).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9830?vs=25142&id=25183

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9830/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9830

AFFECTED FILES
  mercurial/commit.py

CHANGE DETAILS

diff --git a/mercurial/commit.py b/mercurial/commit.py
--- a/mercurial/commit.py
+++ b/mercurial/commit.py
@@ -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
 
 



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210120/422cdd41/attachment-0002.html>


More information about the Mercurial-patches mailing list