Patchwork D6492: branch: add test covering the case when we have no branchheads to close

login
register
mail settings
Submitter phabricator
Date June 7, 2019, 1:56 p.m.
Message ID <differential-rev-PHID-DREV-zucck7r5rgka6zuvfgyk-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40344/
State Superseded
Headers show

Comments

phabricator - June 7, 2019, 1:56 p.m.
khanchi97 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6492

AFFECTED FILES
  tests/test-branches.t

CHANGE DETAILS




To: khanchi97, #hg-reviewers
Cc: mercurial-devel
phabricator - June 7, 2019, 2:11 p.m.
khanchi97 added a comment.


  Abandoned.. because I assumed this revision won't be pushed by `phabsend` as it's in secret phase. Is it right behavior?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6492

To: khanchi97, #hg-reviewers
Cc: mercurial-devel

Patch

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]