tests: unify test-branches
authorMartin Geisler <mg@lazybytes.net>
Sat, 14 Aug 2010 03:06:52 +0200
changeset 11868 062052b0d737
parent 11867 20bd477d0e89
child 11869 36a5e7cb6c8d
tests: unify test-branches
tests/test-branches
tests/test-branches.out
tests/test-branches.t
--- a/tests/test-branches	Fri Aug 13 00:34:44 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-echo 'root' >root
-hg add root
-hg commit -d '0 0' -m "Adding root node"
-
-echo 'a' >a
-hg add a
-hg branch a
-hg commit -d '1 0' -m "Adding a branch"
-
-hg branch q
-echo 'aa' >a
-hg branch -C
-hg commit -d '2 0' -m "Adding to a branch"
-
-hg update -C 0
-echo 'b' >b
-hg add b
-hg branch b
-hg commit -d '2 0' -m "Adding b branch"
-
-echo 'bh1' >bh1
-hg add bh1
-hg commit -d '3 0' -m "Adding b branch head 1"
-
-hg update -C 2
-echo 'bh2' >bh2
-hg add bh2
-hg commit -d '4 0' -m "Adding b branch head 2"
-
-echo 'c' >c
-hg add c
-hg branch c
-hg commit -d '5 0' -m "Adding c branch"
-
-hg branch tip
-hg branch null
-hg branch .
-
-echo 'd' >d
-hg add d
-hg branch 'a branch name much longer than the default justification used by branches'
-hg commit -d '6 0' -m "Adding d branch"
-
-hg branches
-echo '-------'
-hg branches -a
-
-echo "--- Branch a"
-hg log -b a
-
-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' -m 'adding cset to branch b'
-hg up -C aee39cd168d0
-echo 'xxx2' >> b
-hg commit -d '8 0' -m 'adding head to branch b'
-echo 'xxx3' >> b
-hg commit -d '9 0' -m 'adding another cset to branch b'
-hg branches
-hg heads --closed
-hg heads
-hg commit -d '9 0' --close-branch -m 'prune bad branch'
-hg branches -a
-hg up -C b
-hg commit -d '9 0' --close-branch -m 'close this part branch too'
-echo '--- b branch should be inactive'
-hg branches
-hg branches -c
-hg branches -a
-hg heads b
-hg heads --closed b
-echo 'xxx4' >> b
-hg commit -d '9 0' -m 'reopen branch with a change'
-echo '--- branch b is back in action'
-hg branches -a
-echo '---- test heads listings'
-hg heads
-echo '% branch default'
-hg heads default
-echo '% branch a'
-hg heads a
-hg heads --active a
-echo '% branch b'
-hg heads b
-hg heads --closed b
--- a/tests/test-branches.out	Fri Aug 13 00:34:44 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-marked working directory as branch a
-marked working directory as branch q
-reset working directory to branch a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch b
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-marked working directory as branch c
-abort: the name 'tip' is reserved
-abort: the name 'null' is reserved
-abort: the name '.' is reserved
-marked working directory as branch a branch name much longer than the default justification used by branches
-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)
--------
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-b                              4:aee39cd168d0
---- Branch a
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   2:881fe2b92ad0
-branch:      a
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     Adding to a branch
-
-changeset:   1:dd6b440dd85a
-branch:      a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     Adding a branch
-
----- Branch b
-changeset:   4:aee39cd168d0
-branch:      b
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     Adding b branch head 1
-
-changeset:   3:ac22033332d1
-branch:      b
-parent:      0:19709c5a4e75
-user:        test
-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:   6:589736a22561
-branch:      c
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     Adding c branch
-
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-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:   6:589736a22561
-branch:      c
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     Adding c branch
-
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-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
-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
-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
-no open branch heads found on branches b
-changeset:   12:2da6583810df
-branch:      b
-tag:         tip
-parent:      8:eebb944467c9
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     close this part branch too
-
-changeset:   11:c84627f3c15d
-branch:      b
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     prune bad branch
-
-reopening closed branch head 12
---- branch b is back in action
-b                             13:6ac12926b8c3
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
----- test heads listings
-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
-
-changeset:   6:589736a22561
-branch:      c
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     Adding c branch
-
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-% branch default
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-% branch a
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-no open branch heads found on branches a
-% branch b
-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:   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
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-branches.t	Sat Aug 14 03:06:52 2010 +0200
@@ -0,0 +1,343 @@
+  $ hg init a
+  $ cd a
+  $ echo 'root' >root
+  $ hg add root
+  $ hg commit -d '0 0' -m "Adding root node"
+
+  $ echo 'a' >a
+  $ hg add a
+  $ hg branch a
+  marked working directory as branch a
+  $ hg commit -d '1 0' -m "Adding a branch"
+
+  $ hg branch q
+  marked working directory as branch q
+  $ echo 'aa' >a
+  $ hg branch -C
+  reset working directory to branch a
+  $ hg commit -d '2 0' -m "Adding to a branch"
+
+  $ hg update -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'b' >b
+  $ hg add b
+  $ hg branch b
+  marked working directory as branch b
+  $ hg commit -d '2 0' -m "Adding b branch"
+
+  $ echo 'bh1' >bh1
+  $ hg add bh1
+  $ hg commit -d '3 0' -m "Adding b branch head 1"
+
+  $ hg update -C 2
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo 'bh2' >bh2
+  $ hg add bh2
+  $ hg commit -d '4 0' -m "Adding b branch head 2"
+
+  $ echo 'c' >c
+  $ hg add c
+  $ hg branch c
+  marked working directory as branch c
+  $ hg commit -d '5 0' -m "Adding c branch"
+
+  $ hg branch tip
+  abort: the name 'tip' is reserved
+  $ hg branch null
+  abort: the name 'null' is reserved
+  $ hg branch .
+  abort: the name '.' is reserved
+
+  $ echo 'd' >d
+  $ hg add d
+  $ hg branch 'a branch name much longer than the default justification used by branches'
+  marked working directory as branch a branch name much longer than the default justification used by branches
+  $ hg commit -d '6 0' -m "Adding d branch"
+
+  $ hg branches
+  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)
+
+-------
+
+  $ hg branches -a
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  b                              4:aee39cd168d0
+
+--- Branch a
+
+  $ hg log -b a
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   2:881fe2b92ad0
+  branch:      a
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     Adding to a branch
+  
+  changeset:   1:dd6b440dd85a
+  branch:      a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     Adding a branch
+  
+
+---- Branch b
+
+  $ hg log -b b
+  changeset:   4:aee39cd168d0
+  branch:      b
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     Adding b branch head 1
+  
+  changeset:   3:ac22033332d1
+  branch:      b
+  parent:      0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     Adding b branch
+  
+
+---- going to test branch closing
+
+  $ hg branches
+  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)
+  $ hg up -C b
+  2 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo 'xxx1' >> b
+  $ hg commit -d '7 0' -m 'adding cset to branch b'
+  $ hg up -C aee39cd168d0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 'xxx2' >> b
+  $ hg commit -d '8 0' -m 'adding head to branch b'
+  created new head
+  $ echo 'xxx3' >> b
+  $ hg commit -d '9 0' -m 'adding another cset to branch b'
+  $ hg branches
+  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)
+  $ hg heads --closed
+  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:   6:589736a22561
+  branch:      c
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     Adding c branch
+  
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+  $ hg heads
+  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:   6:589736a22561
+  branch:      c
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     Adding c branch
+  
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+  $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
+  $ hg branches -a
+  b                              8:eebb944467c9
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  $ hg up -C b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
+
+--- b branch should be inactive
+
+  $ hg branches
+  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)
+  $ hg branches -c
+  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)
+  $ hg branches -a
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  $ hg heads b
+  no open branch heads found on branches b
+  $ hg heads --closed b
+  changeset:   12:2da6583810df
+  branch:      b
+  tag:         tip
+  parent:      8:eebb944467c9
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     close this part branch too
+  
+  changeset:   11:c84627f3c15d
+  branch:      b
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     prune bad branch
+  
+  $ echo 'xxx4' >> b
+  $ hg commit -d '9 0' -m 'reopen branch with a change'
+  reopening closed branch head 12
+
+--- branch b is back in action
+
+  $ hg branches -a
+  b                             13:6ac12926b8c3
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+
+---- test heads listings
+
+  $ hg heads
+  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
+  
+  changeset:   6:589736a22561
+  branch:      c
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     Adding c branch
+  
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+
+branch default
+
+  $ hg heads default
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+
+branch a
+
+  $ hg heads a
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  $ hg heads --active a
+  no open branch heads found on branches a
+
+branch b
+
+  $ hg heads b
+  changeset:   13:6ac12926b8c3
+  branch:      b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     reopen branch with a change
+  
+  $ hg heads --closed b
+  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
+