Patchwork D12086: tests: demonstrate how `hg unamend` fails on merge commits

login
register
mail settings
Submitter phabricator
Date Jan. 25, 2022, 5:17 a.m.
Message ID <differential-rev-PHID-DREV-h5ycqj7p43vru5h2yhsk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50412/
State New
Headers show

Comments

phabricator - Jan. 25, 2022, 5:17 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When `hg unamend` is run on a merge commit, it seems that it loses the
  changes from the second parent.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-unamend.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-unamend.t b/tests/test-unamend.t
--- a/tests/test-unamend.t
+++ b/tests/test-unamend.t
@@ -421,3 +421,30 @@ 
   A d
     b
   R b
+
+Try to unamend a merge
+
+  $ cd ..
+  $ hg init merge
+  $ cd merge
+  $ echo initial > initial
+  $ hg ci -Aqm initial
+  $ echo left > left
+  $ hg ci -Aqm left
+  $ hg co -q 0
+  $ echo right > right
+  $ hg ci -Aqm right
+  $ hg merge -q 1
+  $ hg ci -m merge
+  $ echo accidental > initial
+  $ hg st --rev 1 --rev .
+  A right
+  $ hg st --rev 2 --rev .
+  A left
+  $ hg amend
+  $ hg unamend
+  $ hg st --rev 1 --rev .
+  A right
+  R left (known-bad-output !)
+  $ hg st --rev 2 --rev .
+  A left (missing-correct-output !)