Changeset View
Changeset View
Standalone View
Standalone View
tests/test-branches.t
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | invalid characters | ||||
abort: '\n' cannot be used in a name | abort: '\n' cannot be used in a name | ||||
[255] | [255] | ||||
trailing or leading spaces should be stripped before testing duplicates | trailing or leading spaces should be stripped before testing duplicates | ||||
$ hg branch 'b ' | $ hg branch 'b ' | ||||
abort: a branch of the same name already exists | abort: a branch of the same name already exists | ||||
(use 'hg update' to switch to it) | (use 'hg update' to switch to it) | ||||
[255] | [10] | ||||
$ hg branch ' b' | $ hg branch ' b' | ||||
abort: a branch of the same name already exists | abort: a branch of the same name already exists | ||||
(use 'hg update' to switch to it) | (use 'hg update' to switch to it) | ||||
[255] | [10] | ||||
verify update will accept invalid legacy branch names | verify update will accept invalid legacy branch names | ||||
$ hg init test-invalid-branch-name | $ hg init test-invalid-branch-name | ||||
$ cd test-invalid-branch-name | $ cd test-invalid-branch-name | ||||
$ hg unbundle -u "$TESTDIR"/bundles/test-invalid-branch-name.hg | $ hg unbundle -u "$TESTDIR"/bundles/test-invalid-branch-name.hg | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Line(s) | ---- going to test branch closing | ||||
$ hg branches -a | $ hg branches -a | ||||
b 8:eebb944467c9 | b 8:eebb944467c9 | ||||
a branch name much longer than the default justification used by branches 7:10ff5895aa57 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | ||||
$ hg up -C b | $ hg up -C b | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg commit -d '9 0' --close-branch -m 'close this part branch too' | $ hg commit -d '9 0' --close-branch -m 'close this part branch too' | ||||
$ hg commit -d '9 0' --close-branch -m 're-closing this branch' | $ hg commit -d '9 0' --close-branch -m 're-closing this branch' | ||||
abort: current revision is already a branch closing head | abort: current revision is already a branch closing head | ||||
[255] | [10] | ||||
$ hg log -r tip --debug | $ hg log -r tip --debug | ||||
changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f | changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f | ||||
branch: b | branch: b | ||||
tag: tip | tag: tip | ||||
phase: draft | phase: draft | ||||
parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1 | parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1 | ||||
parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000 | ||||
▲ Show 20 Lines • Show All 661 Lines • ▼ Show 20 Line(s) | -------------------------------------------------------------------- | ||||
$ hg up -r "desc('added b')" | $ hg up -r "desc('added b')" | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
trying to close branch from a cset which is not a branch head | trying to close branch from a cset which is not a branch head | ||||
it should abort: | it should abort: | ||||
$ hg ci -m "closing branch" --close-branch | $ hg ci -m "closing branch" --close-branch | ||||
abort: can only close branch heads | abort: can only close branch heads | ||||
(use --force-close-branch to close branch from a non-head changeset) | (use --force-close-branch to close branch from a non-head changeset) | ||||
[255] | [10] | ||||
$ hg up 0 | $ hg up 0 | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n" | $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n" | ||||
o 2: 155349b645be added c | o 2: 155349b645be added c | ||||
| default | | default | ||||
| | | | ||||
o 1: 5f6d8a4bf34a added b | o 1: 5f6d8a4bf34a added b | ||||
| default | | default | ||||
| | | | ||||
@ 0: 9092f1db7931 added a | @ 0: 9092f1db7931 added a | ||||
default | default | ||||
Test --force-close-branch to close a branch from a non-head changeset: | Test --force-close-branch to close a branch from a non-head changeset: | ||||
--------------------------------------------------------------------- | --------------------------------------------------------------------- | ||||
$ hg show stack --config extensions.show= | $ hg show stack --config extensions.show= | ||||
o 1553 added c | o 1553 added c | ||||
o 5f6d added b | o 5f6d added b | ||||
@ 9092 added a | @ 9092 added a | ||||
$ hg ci -m "branch closed" --close-branch | $ hg ci -m "branch closed" --close-branch | ||||
abort: can only close branch heads | abort: can only close branch heads | ||||
(use --force-close-branch to close branch from a non-head changeset) | (use --force-close-branch to close branch from a non-head changeset) | ||||
[255] | [10] | ||||
$ hg ci -m "branch closed" --force-close-branch | $ hg ci -m "branch closed" --force-close-branch | ||||
created new head | created new head |