Patchwork D6281: branch: add tests which shows branch can be closed from a non-branchhead cset

login
register
mail settings
Submitter phabricator
Date April 25, 2019, 6:07 p.m.
Message ID <ede2ed4205d84c551727185f54658735@localhost.localdomain>
Download mbox | patch
Permalink /patch/39830/
State Not Applicable
Headers show

Comments

phabricator - April 25, 2019, 6:07 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG258821f2d465: branch: add tests which shows branch can be closed from a non-branchhead cset (authored by khanchi97, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6281?vs=14858&id=14923

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

AFFECTED FILES
  tests/test-branches.t

CHANGE DETAILS




To: khanchi97, #hg-reviewers, pulkit
Cc: pulkit, 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
@@ -940,3 +940,38 @@ 
   0010: 56 46 78 69 00 00 00 01                         |VFxi....|
 
   $ cd ..
+
+Test to make sure that `--close-branch` only works on a branch head:
+--------------------------------------------------------------------
+  $ hg init closebranch
+  $ cd closebranch
+  $ for ch in a b c; do
+  > echo $ch > $ch
+  > hg add $ch
+  > hg ci -m "added "$ch
+  > done;
+
+  $ hg up -r "desc('added b')"
+  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
+it should abort:
+XXX: it should have aborted here
+  $ hg ci -m "closing branch" --close-branch
+  created new head
+
+  $ hg up 0
+  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"
+  _  3: 006876ddd20e closing branch
+  |  	default
+  |
+  | o  2: 155349b645be added c
+  |/   	default
+  |
+  o  1: 5f6d8a4bf34a added b
+  |  	default
+  |
+  @  0: 9092f1db7931 added a
+     	default
+