[Updated] [+ ] D9256: backout: don't assume that tip as what we just committed

danchr (Dan Villiom Podlaski Christiansen) phabricator at mercurial-scm.org
Thu Oct 29 07:04:32 UTC 2020


danchr updated this revision to Diff 23352.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9256?vs=23348&id=23352

BRANCH
  stable

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

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-backout.t

CHANGE DETAILS

diff --git a/tests/test-backout.t b/tests/test-backout.t
--- a/tests/test-backout.t
+++ b/tests/test-backout.t
@@ -806,3 +806,18 @@
   $ hg backout --merge --no-commit 2
   abort: cannot specify both --no-commit and --merge
   [255]
+
+Ensure that backout out the same changeset twice performs correctly:
+
+  $ hg backout 2
+  removing 3
+  changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f
+  $ echo 4 > 4
+  $ hg ci -A -m 4
+  adding 4
+  $ hg up 2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg backout 2
+  removing 3
+  created new head
+  changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -861,12 +861,12 @@
 
     ui.status(
         _(b'changeset %s backs out changeset %s\n')
-        % (nice(repo.changelog.tip()), nice(node))
+        % (nice(newnode), nice(node))
     )
     if opts.get(b'merge') and op1 != node:
         hg.clean(repo, op1, show_stats=False)
         ui.status(
-            _(b'merging with changeset %s\n') % nice(repo.changelog.tip())
+            _(b'merging with changeset %s\n') % nice(newnode)
         )
         overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')}
         with ui.configoverride(overrides, b'backout'):



To: danchr, #hg-reviewers
Cc: durin42, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20201029/65edcf33/attachment-0002.html>


More information about the Mercurial-patches mailing list