diff --git a/tests/test-branches.t b/tests/test-branches.t --- a/tests/test-branches.t +++ b/tests/test-branches.t @@ -987,3 +987,30 @@ with --force $ hg ci -m "branch closed" --close-branch --force created new head + +Test which adds coverage for the case when we got no heads from branchheads(): +----------------------------------------------------------------------------- + + $ hg up -r "desc('added c')" + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg branch feature + marked working directory as branch feature + (branches are permanent and global, did you want a bookmark?) + + $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n" + _ 3: 0c72c83f0f75 branch closed + | default + | + | @ 2: 155349b645be added c + | | default + | | + | o 1: 5f6d8a4bf34a added b + |/ default + | + o 0: 9092f1db7931 added a + default + +XXX: we could have a more specific message here that current branch has no heads + $ hg ci -m "closing branch" --close-branch + abort: can only close branch heads + [255]