branch closing: add test for branch closing (and reopening)
authorJohn Mulligan <phlogistonjohn@asynchrono.us>
Wed, 14 Jan 2009 21:47:38 -0500
changeset 7657 405cacb06745
parent 7656 6a24fb994701
child 7658 44b3f7bbe2f3
branch closing: add test for branch closing (and reopening)
tests/test-branches
tests/test-branches.out
tests/test-record.out
--- a/tests/test-branches	Wed Jan 14 21:47:38 2009 -0500
+++ b/tests/test-branches	Wed Jan 14 21:47:38 2009 -0500
@@ -50,3 +50,30 @@
 
 echo "---- Branch b"
 hg log -b b
+
+echo "---- going to test branch closing"
+hg branches
+hg up -C b
+echo 'xxx1' >> b
+hg commit -d '7 0' -u test -m 'adding cset to branch b'
+hg up -C aee39cd168d0
+echo 'xxx2' >> b
+hg commit -d '8 0' -u test -m 'adding head to branch b'
+echo 'xxx3' >> b
+hg commit -d '9 0' -u test -m 'adding another cset to branch b'
+hg branches
+hg heads
+hg heads -a
+hg commit -d '9 0' -u test --close-branch -m 'prune bad branch'
+hg branches -a
+hg up -C b
+hg commit -d '9 0' -u test --close-branch -m 'close this part branch too'
+echo '--- b branch should be inactive'
+hg branches
+hg branches -a
+echo 'xxx4' >> b
+hg commit -d '9 0' -u test -m 'reopen branch with a change'
+echo '--- branch b is back in action'
+hg branches -a
+hg heads
+hg heads -a
--- a/tests/test-branches.out	Wed Jan 14 21:47:38 2009 -0500
+++ b/tests/test-branches.out	Wed Jan 14 21:47:38 2009 -0500
@@ -49,3 +49,102 @@
 date:        Thu Jan 01 00:00:02 1970 +0000
 summary:     Adding b branch
 
+---- going to test branch closing
+a branch name much longer than the default justification used by branches 7:10ff5895aa57
+b                              4:aee39cd168d0
+c                              6:589736a22561 (inactive)
+a                              5:d8cbc61dbaa6 (inactive)
+default                        0:19709c5a4e75 (inactive)
+2 files updated, 0 files merged, 4 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+created new head
+b                             10:bfbe841b666e
+a branch name much longer than the default justification used by branches 7:10ff5895aa57
+c                              6:589736a22561 (inactive)
+a                              5:d8cbc61dbaa6 (inactive)
+default                        0:19709c5a4e75 (inactive)
+changeset:   10:bfbe841b666e
+branch:      b
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:09 1970 +0000
+summary:     adding another cset to branch b
+
+changeset:   8:eebb944467c9
+branch:      b
+parent:      4:aee39cd168d0
+user:        test
+date:        Thu Jan 01 00:00:07 1970 +0000
+summary:     adding cset to branch b
+
+changeset:   7:10ff5895aa57
+branch:      a branch name much longer than the default justification used by branches
+user:        test
+date:        Thu Jan 01 00:00:06 1970 +0000
+summary:     Adding d branch
+
+changeset:   10:bfbe841b666e
+branch:      b
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:09 1970 +0000
+summary:     adding another cset to branch b
+
+changeset:   8:eebb944467c9
+branch:      b
+parent:      4:aee39cd168d0
+user:        test
+date:        Thu Jan 01 00:00:07 1970 +0000
+summary:     adding cset to branch b
+
+changeset:   7:10ff5895aa57
+branch:      a branch name much longer than the default justification used by branches
+user:        test
+date:        Thu Jan 01 00:00:06 1970 +0000
+summary:     Adding d branch
+
+b                              8:eebb944467c9
+a branch name much longer than the default justification used by branches 7:10ff5895aa57
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+--- b branch should be inactive
+a branch name much longer than the default justification used by branches 7:10ff5895aa57
+b                             12:2da6583810df (closed)
+c                              6:589736a22561 (inactive)
+a                              5:d8cbc61dbaa6 (inactive)
+default                        0:19709c5a4e75 (inactive)
+a branch name much longer than the default justification used by branches 7:10ff5895aa57
+--- branch b is back in action
+b                             13:6ac12926b8c3
+a branch name much longer than the default justification used by branches 7:10ff5895aa57
+changeset:   13:6ac12926b8c3
+branch:      b
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:09 1970 +0000
+summary:     reopen branch with a change
+
+changeset:   11:c84627f3c15d
+branch:      b
+user:        test
+date:        Thu Jan 01 00:00:09 1970 +0000
+summary:     prune bad branch
+
+changeset:   7:10ff5895aa57
+branch:      a branch name much longer than the default justification used by branches
+user:        test
+date:        Thu Jan 01 00:00:06 1970 +0000
+summary:     Adding d branch
+
+changeset:   13:6ac12926b8c3
+branch:      b
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:09 1970 +0000
+summary:     reopen branch with a change
+
+changeset:   7:10ff5895aa57
+branch:      a branch name much longer than the default justification used by branches
+user:        test
+date:        Thu Jan 01 00:00:06 1970 +0000
+summary:     Adding d branch
+
--- a/tests/test-record.out	Wed Jan 14 21:47:38 2009 -0500
+++ b/tests/test-record.out	Wed Jan 14 21:47:38 2009 -0500
@@ -27,13 +27,14 @@
 
 options:
 
- -A --addremove  mark new/missing files as added/removed before committing
- -I --include    include names matching the given patterns
- -X --exclude    exclude names matching the given patterns
- -m --message    use <text> as commit message
- -l --logfile    read commit message from <file>
- -d --date       record datecode as commit date
- -u --user       record user as committer
+ -A --addremove     mark new/missing files as added/removed before committing
+    --close-branch  mark a branch as closed, hiding it from the branch list
+ -I --include       include names matching the given patterns
+ -X --exclude       exclude names matching the given patterns
+ -m --message       use <text> as commit message
+ -l --logfile       read commit message from <file>
+ -d --date          record datecode as commit date
+ -u --user          record user as committer
 
 use "hg -v help record" to show global options
 % select no files