# HG changeset patch # User Martin von Zweigbergk # Date 2019-01-19 01:08:02 # Node ID c7d425f7f5c9099125adbce729c93fbcb4cc186f # Parent 713fbf057c7da7843ae2ec7326c43add636c9e93 tests: add more tests of uncommit/unamend with copies The unamend tests show suboptimal behavior. Differential Revision: https://phab.mercurial-scm.org/D5658 diff --git a/tests/test-unamend.t b/tests/test-unamend.t --- a/tests/test-unamend.t +++ b/tests/test-unamend.t @@ -372,3 +372,40 @@ Retained copies in working directoy rename to wat $ hg revert -qa $ rm foobar wat + +Rename a->b, then amend b->c. After unamend, should look like b->c. + + $ hg co -q 0 + $ hg mv a b + $ hg ci -qm 'move to a b' + $ hg mv b c + $ hg amend + $ hg unamend + $ hg st --copies --change . + A b + a + R a +BROKEN: should indicate that b was renamed to c + $ hg st --copies + A c + R b + $ hg revert -qa + $ rm c + +Rename a->b, then amend b->c, and working copy change c->d. After unamend, should look like b->d + + $ hg co -q 0 + $ hg mv a b + $ hg ci -qm 'move to a b' + $ hg mv b c + $ hg amend + $ hg mv c d + $ hg unamend + $ hg st --copies --change . + A b + a + R a +BROKEN: should indicate that b was renamed to d + $ hg st --copies + A d + R b diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -398,3 +398,43 @@ Add and expect uncommit to fail on both |/ o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 + +Rename a->b, then remove b in working copy. Result should remove a. + + $ hg co -q 0 + $ hg mv a b + $ hg ci -qm 'move a to b' + $ hg rm b + $ hg uncommit --config experimental.uncommitondirtywdir=True + $ hg st --copies + R a + $ hg revert a + +Rename a->b, then rename b->c in working copy. Result should rename a->c. + + $ hg co -q 0 + $ hg mv a b + $ hg ci -qm 'move a to b' + $ hg mv b c + $ hg uncommit --config experimental.uncommitondirtywdir=True + $ hg st --copies + A c + a + R a + $ hg revert a + $ hg forget c + $ rm c + +Copy a->b1 and a->b2, then rename b1->c in working copy. Result should copy a->b2 and a->c. + + $ hg co -q 0 + $ hg cp a b1 + $ hg cp a b2 + $ hg ci -qm 'move a to b1 and b2' + $ hg mv b1 c + $ hg uncommit --config experimental.uncommitondirtywdir=True + $ hg st --copies + A b2 + a + A c + a