Changeset View
Changeset View
Standalone View
Standalone View
tests/test-amend.t
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | Amend with editor | ||||
$ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG | ||||
saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !) | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !) | ||||
$ hg log -r . -T '{node|short} {desc}\n' | $ hg log -r . -T '{node|short} {desc}\n' | ||||
974f07f28537 EDITED: MSG | 974f07f28537 EDITED: MSG | ||||
$ echo FOO > $TESTTMP/msg | $ echo FOO > $TESTTMP/msg | ||||
$ hg amend -l $TESTTMP/msg -m BAR | $ hg amend -l $TESTTMP/msg -m BAR | ||||
abort: cannot specify both --message and --logfile | abort: cannot specify both --message and --logfile | ||||
[255] | [10] | ||||
$ hg amend -l $TESTTMP/msg | $ hg amend -l $TESTTMP/msg | ||||
saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !) | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !) | ||||
$ hg log -r . -T '{node|short} {desc}\n' | $ hg log -r . -T '{node|short} {desc}\n' | ||||
507be9bdac71 FOO | 507be9bdac71 FOO | ||||
Interactive mode | Interactive mode | ||||
$ touch F G | $ touch F G | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | With allowunstable, amend could work in the middle of a stack | ||||
o 0 426bada5c675 A | o 0 426bada5c675 A | ||||
Checking the note stored in the obsmarker | Checking the note stored in the obsmarker | ||||
$ echo foo > bar | $ echo foo > bar | ||||
$ hg add bar | $ hg add bar | ||||
$ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' | $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' | ||||
abort: cannot store a note of more than 255 bytes | abort: cannot store a note of more than 255 bytes | ||||
[255] | [10] | ||||
$ hg amend --note "adding bar" | $ hg amend --note "adding bar" | ||||
$ hg debugobsolete -r . | $ hg debugobsolete -r . | ||||
112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} | 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} | ||||
be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} | be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} | ||||
#endif | #endif | ||||
Cannot amend public changeset | Cannot amend public changeset | ||||
▲ Show 20 Lines • Show All 228 Lines • ▼ Show 20 Line(s) | rewrite.update-timestamp can be negated by --no-currentdate | ||||
user: baz | user: baz | ||||
date: Thu Jan 01 00:00:05 1970 +0000 | date: Thu Jan 01 00:00:05 1970 +0000 | ||||
summary: commit 1 | summary: commit 1 | ||||
Bad combination of date options: | Bad combination of date options: | ||||
$ hg amend -D --date '0 0' | $ hg amend -D --date '0 0' | ||||
abort: cannot specify both --date and --currentdate | abort: cannot specify both --date and --currentdate | ||||
[255] | [10] | ||||
Close branch | Close branch | ||||
$ hg amend --secret --close-branch | $ hg amend --secret --close-branch | ||||
$ hg log --limit 1 -T 'close={get(extras, "close")}\nphase={phase}\n' | $ hg log --limit 1 -T 'close={get(extras, "close")}\nphase={phase}\n' | ||||
close=1 | close=1 | ||||
phase=secret | phase=secret | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |