[PATCH 4 of 4] branch closing: add test for branch closing (and reopening)

John Mulligan phlogistonjohn at asynchrono.us
Mon Dec 22 18:25:36 CST 2008


# HG changeset patch
# User John Mulligan <phlogistonjohn at asynchrono.us>
# Date 1229874763 18000
# Node ID a085d9e1d3df8a58df6b7da8b9e76eb9029386ea
# Parent  9596c360d9c553a1ea6c7c72e938abaaa337776f
branch closing: add test for branch closing (and reopening)

diff --git a/tests/test-branches b/tests/test-branches
--- a/tests/test-branches
+++ b/tests/test-branches
@@ -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
diff --git a/tests/test-branches.out b/tests/test-branches.out
--- a/tests/test-branches.out
+++ b/tests/test-branches.out
@@ -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 (inactive)
+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
+
diff --git a/tests/test-record.out b/tests/test-record.out
--- a/tests/test-record.out
+++ b/tests/test-record.out
@@ -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


More information about the Mercurial-devel mailing list