tests/test-rewind.t
changeset 4722 7839720c7c75
parent 4712 e2c548cc83b5
child 4777 ff452675566c
child 4820 d842a4c6fc4a
--- a/tests/test-rewind.t	Wed Jul 10 18:16:38 2019 +0800
+++ b/tests/test-rewind.t	Thu Jul 11 17:04:08 2019 +0800
@@ -9,6 +9,8 @@
   > interactive = true
   > [phases]
   > publish=False
+  > [alias]
+  > glf = log -GT "{rev}: {desc} ({files})"
   > [extensions]
   > evolve =
   > EOF
@@ -938,3 +940,45 @@
   $ hg rewind
   abort: uncommitted changes
   [255]
+
+Merge commits
+-------------
+
+  $ hg up --clean .^
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo foo > foo
+  $ hg ci -qAm foo
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+  $ hg st --change .
+  A B
+
+  $ echo bar > foo
+  $ hg amend -m 'merge, but foo is now bar'
+  $ hg st --change .
+  M foo
+  A B
+
+  $ hg rewind --from .
+  rewinded to 1 changesets
+  (1 changesets obsoleted)
+  working directory is now at 006fd8c2fed9
+  $ hg st --change .
+  A B
+
+  $ hg glf -r '. + allpredecessors(.) + parents(.)' --hidden
+  @    6: merge ()
+  |\
+  +---x  5: merge, but foo is now bar (foo)
+  | |/
+  +---x  4: merge ()
+  | |/
+  | o  3: foo (C foo)
+  | |
+  | ~
+  o  2: c_B0 (B)
+  |
+  ~