Changeset View
Changeset View
Standalone View
Standalone View
tests/test-commit-amend.t
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | the amend, there should be no rollback. | ||||
parent: 1:43f1ba15f28a tip | parent: 1:43f1ba15f28a tip | ||||
amend base1 | amend base1 | ||||
branch: default | branch: default | ||||
commit: 1 modified, 1 added, 1 unknown | commit: 1 modified, 1 added, 1 unknown | ||||
update: (current) | update: (current) | ||||
phases: 2 draft | phases: 2 draft | ||||
$ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend | ||||
abort: empty commit message | abort: empty commit message | ||||
[255] | [10] | ||||
$ hg summary | $ hg summary | ||||
parent: 1:43f1ba15f28a tip | parent: 1:43f1ba15f28a tip | ||||
amend base1 | amend base1 | ||||
branch: default | branch: default | ||||
commit: 1 modified, 1 added, 1 unknown | commit: 1 modified, 1 added, 1 unknown | ||||
update: (current) | update: (current) | ||||
phases: 2 draft | phases: 2 draft | ||||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Line(s) | abort does not loose bookmarks | ||||
$ cat > editor.sh << '__EOF__' | $ cat > editor.sh << '__EOF__' | ||||
> #!/bin/sh | > #!/bin/sh | ||||
> echo "" > "$1" | > echo "" > "$1" | ||||
> __EOF__ | > __EOF__ | ||||
$ echo a >> a | $ echo a >> a | ||||
$ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend | ||||
abort: empty commit message | abort: empty commit message | ||||
[255] | [10] | ||||
$ hg book | $ hg book | ||||
book1 1:a3b65065808c | book1 1:a3b65065808c | ||||
* book2 1:a3b65065808c | * book2 1:a3b65065808c | ||||
$ hg revert -Caq | $ hg revert -Caq | ||||
$ rm editor.sh | $ rm editor.sh | ||||
$ echo '[defaults]' >> $HGRCPATH | $ echo '[defaults]' >> $HGRCPATH | ||||
$ echo "commit=-d '0 0'" >> $HGRCPATH | $ echo "commit=-d '0 0'" >> $HGRCPATH | ||||
▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Line(s) | This shouldn't be possible: | ||||
$ hg up -q default | $ hg up -q default | ||||
$ hg branch closewithamend | $ hg branch closewithamend | ||||
marked working directory as branch closewithamend | marked working directory as branch closewithamend | ||||
$ echo foo > foo | $ echo foo > foo | ||||
$ hg add foo | $ hg add foo | ||||
$ hg ci -m.. | $ hg ci -m.. | ||||
$ hg ci --amend --close-branch -m 'closing' | $ hg ci --amend --close-branch -m 'closing' | ||||
abort: can only close branch heads | abort: can only close branch heads | ||||
[255] | [10] | ||||
This silliness fails: | This silliness fails: | ||||
$ hg branch silliness | $ hg branch silliness | ||||
marked working directory as branch silliness | marked working directory as branch silliness | ||||
$ echo b >> b | $ echo b >> b | ||||
$ hg ci --close-branch -m'open and close' | $ hg ci --close-branch -m'open and close' | ||||
abort: branch "silliness" has no heads to close | abort: branch "silliness" has no heads to close | ||||
[255] | [10] | ||||
Test that amend with --secret creates new secret changeset forcibly | Test that amend with --secret creates new secret changeset forcibly | ||||
--------------------------------------------------------------------- | --------------------------------------------------------------------- | ||||
$ hg phase '.^::.' | $ hg phase '.^::.' | ||||
29: draft | 29: draft | ||||
30: draft | 30: draft | ||||
$ hg commit --amend --secret -m 'amend as secret' -q | $ hg commit --amend --secret -m 'amend as secret' -q | ||||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |