combine tests
authorAdrian Buehlmann <adrian@cadifra.com>
Tue, 14 Sep 2010 12:20:51 +0200
changeset 12279 28e2e3804f2e
parent 12278 c4c2ba553401
child 12280 6ee719f56f01
combine tests
mercurial/merge.py
tests/test-dirstate-race.t
tests/test-merge-revert
tests/test-merge-revert.out
tests/test-merge-revert.t
tests/test-merge-revert2
tests/test-merge-revert2.out
tests/test-merge-revert2.t
tests/test-merge-types
tests/test-merge-types.out
tests/test-merge-types.t
tests/test-nested-repo
tests/test-nested-repo.out
tests/test-nested-repo.t
tests/test-newbranch
tests/test-newbranch.out
tests/test-newbranch.t
tests/test-permissions
tests/test-permissions.out
tests/test-permissions.t
tests/test-pull
tests/test-pull-branch
tests/test-pull-branch.out
tests/test-pull-branch.t
tests/test-pull-permission
tests/test-pull-permission.out
tests/test-pull-permission.t
tests/test-pull-r
tests/test-pull-r.out
tests/test-pull-r.t
tests/test-pull-update
tests/test-pull-update.out
tests/test-pull-update.t
tests/test-pull.out
tests/test-pull.t
tests/test-push-hook-lock
tests/test-push-hook-lock.out
tests/test-push-hook-lock.t
tests/test-push-r
tests/test-push-r.out
tests/test-push-r.t
tests/test-push-validation
tests/test-push-validation.out
tests/test-push-validation.t
tests/test-push-warn
tests/test-push-warn.out
tests/test-push-warn.t
tests/test-race
tests/test-race.out
tests/test-rename-after-merge
tests/test-rename-after-merge.out
tests/test-rename-after-merge.t
tests/test-simple-update
tests/test-simple-update.out
tests/test-simple-update.t
tests/test-unrelated-pull
tests/test-unrelated-pull.out
tests/test-unrelated-pull.t
tests/test-up-issue1456
tests/test-up-issue1456.out
tests/test-update-branches
tests/test-update-branches.out
tests/test-update-branches.t
tests/test-update-issue1456.t
tests/test-update-reverse
tests/test-update-reverse.out
tests/test-update-reverse.t
--- a/mercurial/merge.py	Mon Sep 13 16:25:13 2010 +0200
+++ b/mercurial/merge.py	Tue Sep 14 12:20:51 2010 +0200
@@ -433,7 +433,7 @@
     the parent rev to the target rev (linear, on the same named
     branch, or on another named branch).
 
-    This logic is tested by test-update-branches.
+    This logic is tested by test-update-branches.t.
 
     -c  -C  dirty  rev  |  linear   same  cross
      n   n    n     n   |    ok     (1)     x
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dirstate-race.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,33 @@
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m test
+
+Do we ever miss a sub-second change?:
+
+  $ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+  >     hg co -qC 0
+  >     echo b > a
+  >     hg st
+  > done
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+
--- a/tests/test-merge-revert	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo "added file1" > file1
-echo "added file2" > file2
-hg add file1 file2
-hg commit -m "added file1 and file2"
-echo "changed file1" >> file1
-hg commit -m "changed file1"
-hg -q log
-hg id
-hg update -C 0
-hg id
-echo "changed file1" >> file1
-hg id
-hg revert --all
-hg diff
-hg status
-hg id
-hg update
-hg diff
-hg status
-hg id
-hg update -C 0
-echo "changed file1" >> file1
-hg update
-hg diff
-hg status
-hg id
-hg revert --all
-hg diff
-hg status
-hg id
-hg revert -r tip --all
-hg diff
-hg status
-hg id
-hg update -C
-hg diff
-hg status
-hg id
-
--- a/tests/test-merge-revert.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-1:08a16e8e4408
-0:d29c767a4b52
-08a16e8e4408 tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-d29c767a4b52
-d29c767a4b52+
-reverting file1
-? file1.orig
-d29c767a4b52
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-08a16e8e4408 tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-08a16e8e4408 tip
-? file1.orig
-08a16e8e4408 tip
-? file1.orig
-08a16e8e4408 tip
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-08a16e8e4408 tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,74 @@
+  $ hg init
+
+  $ echo "added file1" > file1
+  $ echo "added file2" > file2
+  $ hg add file1 file2
+  $ hg commit -m "added file1 and file2"
+
+  $ echo "changed file1" >> file1
+  $ hg commit -m "changed file1"
+
+  $ hg -q log
+  1:08a16e8e4408
+  0:d29c767a4b52
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id
+  d29c767a4b52
+  $ echo "changed file1" >> file1
+  $ hg id
+  d29c767a4b52+
+
+  $ hg revert --all
+  reverting file1
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  d29c767a4b52
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "changed file1" >> file1
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg revert --all
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg revert -r tip --all
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
--- a/tests/test-merge-revert2	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo "added file1" > file1
-echo "another line of text" >> file1
-echo "added file2" > file2
-hg add file1 file2
-hg commit -m "added file1 and file2"
-echo "changed file1" >> file1
-hg commit -m "changed file1"
-hg -q log
-hg id
-hg update -C 0
-hg id
-echo "changed file1" >> file1
-hg id
-hg revert --no-backup --all
-hg diff
-hg status
-hg id
-hg update
-hg diff
-hg status
-hg id
-hg update -C 0
-echo "changed file1 different" >> file1
-hg update
-hg diff --nodates
-hg status
-hg id
-hg revert --no-backup --all
-hg diff
-hg status
-hg id
-hg revert -r tip --no-backup --all
-hg diff
-hg status
-hg id
-hg update -C
-hg diff
-hg status
-hg id
-
--- a/tests/test-merge-revert2.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-1:dfab7f3c2efb
-0:c3fa057dd86f
-dfab7f3c2efb tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-c3fa057dd86f
-c3fa057dd86f+
-reverting file1
-c3fa057dd86f
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-dfab7f3c2efb tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging file1
-warning: conflicts during merge.
-merging file1 failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
-diff -r dfab7f3c2efb file1
---- a/file1
-+++ b/file1
-@@ -1,3 +1,7 @@
- added file1
- another line of text
-+<<<<<<< local
-+changed file1 different
-+=======
- changed file1
-+>>>>>>> other
-M file1
-? file1.orig
-dfab7f3c2efb+ tip
-reverting file1
-? file1.orig
-dfab7f3c2efb tip
-? file1.orig
-dfab7f3c2efb tip
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-dfab7f3c2efb tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert2.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,93 @@
+  $ hg init
+
+  $ echo "added file1" > file1
+  $ echo "another line of text" >> file1
+  $ echo "added file2" > file2
+  $ hg add file1 file2
+  $ hg commit -m "added file1 and file2"
+
+  $ echo "changed file1" >> file1
+  $ hg commit -m "changed file1"
+
+  $ hg -q log
+  1:dfab7f3c2efb
+  0:c3fa057dd86f
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id
+  c3fa057dd86f
+
+  $ echo "changed file1" >> file1
+  $ hg id
+  c3fa057dd86f+
+
+  $ hg revert --no-backup --all
+  reverting file1
+  $ hg diff
+  $ hg status
+  $ hg id
+  c3fa057dd86f
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "changed file1 different" >> file1
+
+  $ hg update
+  merging file1
+  warning: conflicts during merge.
+  merging file1 failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+
+  $ hg diff --nodates
+  diff -r dfab7f3c2efb file1
+  --- a/file1
+  +++ b/file1
+  @@ -1,3 +1,7 @@
+   added file1
+   another line of text
+  +<<<<<<< local
+  +changed file1 different
+  +=======
+   changed file1
+  +>>>>>>> other
+
+  $ hg status
+  M file1
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb+ tip
+
+  $ hg revert --no-backup --all
+  reverting file1
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg revert -r tip --no-backup --all
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb tip
+
--- a/tests/test-merge-types	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg ci -Amadd       # 0
-
-chmod +x a
-hg ci -mexecutable # 1
-
-hg up 0
-rm a
-ln -s symlink a
-hg ci -msymlink    # 2
-hg merge --debug
-
-echo % symlink is local parent, executable is other
-
-if [ -h a ]; then
-    echo a is a symlink
-    $TESTDIR/readlink.py a
-elif [ -x a ]; then
-    echo a is executable
-else
-    echo "a has no flags (default for conflicts)"
-fi
-
-hg update -C 1
-hg merge --debug
-
-echo % symlink is other parent, executable is local
-
-if [ -h a ]; then
-    echo a is a symlink
-    $TESTDIR/readlink.py a
-elif [ -x a ]; then
-    echo a is executable
-else
-    echo "a has no flags (default for conflicts)"
-fi
--- a/tests/test-merge-types.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-adding a
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
- conflicting flags for a
-(n)one, e(x)ec or sym(l)ink? n
- a: update permissions -> e
-updating: a 1/1 files (100.00%)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% symlink is local parent, executable is other
-a has no flags (default for conflicts)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
- conflicting flags for a
-(n)one, e(x)ec or sym(l)ink? n
- a: remote is newer -> g
-updating: a 1/1 files (100.00%)
-getting a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% symlink is other parent, executable is local
-a has no flags (default for conflicts)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-types.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,70 @@
+  $ hg init
+
+  $ echo a > a
+  $ hg ci -Amadd
+  adding a
+
+  $ chmod +x a
+  $ hg ci -mexecutable
+
+  $ hg up 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm a
+  $ ln -s symlink a
+  $ hg ci -msymlink
+  created new head
+
+  $ hg merge --debug
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
+   conflicting flags for a
+  (n)one, e(x)ec or sym(l)ink? n
+   a: update permissions -> e
+  updating: a 1/1 files (100.00%)
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+
+Symlink is local parent, executable is other:
+
+  $ if [ -h a ]; then
+  >     echo a is a symlink
+  >     $TESTDIR/readlink.py a
+  > elif [ -x a ]; then
+  >     echo a is executable
+  > else
+  >     echo "a has no flags (default for conflicts)"
+  > fi
+  a has no flags (default for conflicts)
+
+  $ hg update -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg merge --debug
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
+   conflicting flags for a
+  (n)one, e(x)ec or sym(l)ink? n
+   a: remote is newer -> g
+  updating: a 1/1 files (100.00%)
+  getting a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+
+Symlink is other parent, executable is local:
+
+  $ if [ -h a ]; then
+  >    echo a is a symlink
+  >    $TESTDIR/readlink.py a
+  > elif [ -x a ]; then
+  >     echo a is executable
+  > else
+  >     echo "a has no flags (default for conflicts)"
+  > fi
+  a has no flags (default for conflicts)
+
--- a/tests/test-nested-repo	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg init b
-echo x > b/x
-
-echo '# should print nothing'
-hg add b
-hg st
-
-echo '# should fail'
-hg st b/x
-hg add b/x
-
-echo '# should fail'
-hg add b b/x
-hg st
-
-echo '# should arguably print nothing'
-hg st b
-
-echo a > a
-hg ci -Ama a
-
-echo '# should fail'
-hg mv a b
-hg st
--- a/tests/test-nested-repo.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# should print nothing
-# should fail
-abort: path 'b/x' is inside repo 'b'
-abort: path 'b/x' is inside repo 'b'
-# should fail
-abort: path 'b/x' is inside repo 'b'
-# should arguably print nothing
-# should fail
-abort: path 'b/a' is inside repo 'b'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-nested-repo.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,36 @@
+  $ hg init a
+  $ cd a
+  $ hg init b
+  $ echo x > b/x
+
+Should print nothing:
+
+  $ hg add b
+  $ hg st
+
+Should fail:
+
+  $ hg st b/x
+  abort: path 'b/x' is inside repo 'b'
+  $ hg add b/x
+  abort: path 'b/x' is inside repo 'b'
+
+Should fail:
+
+  $ hg add b b/x
+  abort: path 'b/x' is inside repo 'b'
+  $ hg st
+
+Should arguably print nothing:
+
+  $ hg st b
+
+  $ echo a > a
+  $ hg ci -Ama a
+
+Should fail:
+
+  $ hg mv a b
+  abort: path 'b/a' is inside repo 'b'
+  $ hg st
+
--- a/tests/test-newbranch	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-#!/bin/sh
-
-branchcache=.hg/branchheads.cache
-
-hg init t
-cd t
-hg branches
-
-echo foo > a
-hg add a
-hg ci -m "initial"
-hg branch foo
-hg branch
-hg ci -m "add branch name"
-hg branch bar
-hg ci -m "change branch name"
-echo % branch shadowing
-hg branch default
-hg branch -f default
-hg ci -m "clear branch name"
-
-echo % there should be only one default branch head
-hg heads .
-
-hg co foo
-hg branch
-echo bleah > a
-hg ci -m "modify a branch"
-
-hg merge default
-hg branch
-hg ci -m "merge"
-hg log
-
-hg branches
-hg branches -q
-
-echo % test for invalid branch cache
-hg rollback
-cp $branchcache .hg/bc-invalid
-hg log -r foo
-cp .hg/bc-invalid $branchcache
-hg --debug log -r foo
-rm $branchcache
-echo corrupted > $branchcache
-hg log -qr foo
-cat $branchcache
-
-echo % push should update the branch cache
-hg init ../target
-echo % pushing just rev 0
-hg push -qr 0 ../target
-cat ../target/$branchcache
-echo % pushing everything
-hg push -qf ../target
-cat ../target/$branchcache
-
-echo % update with no arguments: tipmost revision of the current branch
-hg up -q -C 0
-hg up -q
-hg id
-hg up -q 1
-hg up -q
-hg id
-hg branch foobar
-hg up
-
-echo % fastforward merge
-hg branch ff
-echo ff > ff
-hg ci -Am'fast forward'
-hg up foo
-hg merge ff
-hg branch
-hg commit -m'Merge ff into foo'
-hg parents
-hg manifest
-
-echo % test merging, add 3 default heads and one test head
-cd ..
-hg init merges
-cd merges
-echo a > a
-hg ci -Ama
-
-echo b > b
-hg ci -Amb
-
-hg up 0
-echo c > c
-hg ci -Amc
-
-hg up 0
-echo d > d
-hg ci -Amd
-
-hg up 0
-hg branch test
-echo e >> e
-hg ci -Ame
-
-hg log
-
-echo % implicit merge with test branch as parent
-hg merge
-hg up -C default
-echo % implicit merge with default branch as parent
-hg merge
-echo % 3 branch heads, explicit merge required
-hg merge 2
-hg ci -m merge
-echo % 2 branch heads, implicit merge works
-hg merge
--- a/tests/test-newbranch.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-marked working directory as branch foo
-foo
-marked working directory as branch bar
-% branch shadowing
-abort: a branch of the same name already exists (use 'hg update' to switch to it)
-marked working directory as branch default
-created new head
-% there should be only one default branch head
-changeset:   3:9d567d0b51f9
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     clear branch name
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-foo
-changeset:   5:dc140083783b
-branch:      foo
-tag:         tip
-parent:      4:98d14f698afe
-parent:      3:9d567d0b51f9
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     merge
-
-changeset:   4:98d14f698afe
-branch:      foo
-parent:      1:0079f24813e2
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     modify a branch
-
-changeset:   3:9d567d0b51f9
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     clear branch name
-
-changeset:   2:ed2bbf4e0102
-branch:      bar
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change branch name
-
-changeset:   1:0079f24813e2
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add branch name
-
-changeset:   0:db01e8ea3388
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     initial
-
-foo                            5:dc140083783b
-default                        3:9d567d0b51f9 (inactive)
-bar                            2:ed2bbf4e0102 (inactive)
-foo
-default
-bar
-% test for invalid branch cache
-rolling back to revision 4 (undo commit)
-changeset:   4:98d14f698afe
-branch:      foo
-tag:         tip
-parent:      1:0079f24813e2
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     modify a branch
-
-invalidating branch cache (tip differs)
-changeset:   4:98d14f698afeaff8cb612dcf215ce95e639effc3
-branch:      foo
-tag:         tip
-parent:      1:0079f24813e2b73a891577c243684c5066347bc8
-parent:      -1:0000000000000000000000000000000000000000
-manifest:    4:d01b250baaa05909152f7ae07d7a649deea0df9a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       a
-extra:       branch=foo
-description:
-modify a branch
-
-
-4:98d14f698afe
-98d14f698afeaff8cb612dcf215ce95e639effc3 4
-9d567d0b51f9e2068b054e1948e1a927f99b5874 default
-98d14f698afeaff8cb612dcf215ce95e639effc3 foo
-ed2bbf4e01029020711be82ca905283e883f0e11 bar
-% push should update the branch cache
-% pushing just rev 0
-db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
-db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
-% pushing everything
-98d14f698afeaff8cb612dcf215ce95e639effc3 4
-9d567d0b51f9e2068b054e1948e1a927f99b5874 default
-98d14f698afeaff8cb612dcf215ce95e639effc3 foo
-ed2bbf4e01029020711be82ca905283e883f0e11 bar
-% update with no arguments: tipmost revision of the current branch
-9d567d0b51f9
-98d14f698afe (foo) tip
-marked working directory as branch foobar
-abort: branch foobar not found
-% fastforward merge
-marked working directory as branch ff
-adding ff
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-foo
-changeset:   6:917eb54e1b4b
-branch:      foo
-tag:         tip
-parent:      4:98d14f698afe
-parent:      5:6683a60370cb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Merge ff into foo
-
-a
-ff
-% test merging, add 3 default heads and one test head
-adding a
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding d
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch test
-adding e
-changeset:   4:3a1e01ed1df4
-branch:      test
-tag:         tip
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-changeset:   3:980f7dc84c29
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-changeset:   2:d36c0562f908
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   1:d2ae7f538514
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-changeset:   0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-% implicit merge with test branch as parent
-abort: branch 'test' has one head - please merge with an explicit rev
-(run 'hg heads' to see all heads)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% implicit merge with default branch as parent
-abort: branch 'default' has 3 heads - please merge with an explicit rev
-(run 'hg heads .' to see heads)
-% 3 branch heads, explicit merge required
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% 2 branch heads, implicit merge works
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-newbranch.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,316 @@
+  $ branchcache=.hg/branchheads.cache
+
+  $ hg init t
+  $ cd t
+
+  $ hg branches
+  $ echo foo > a
+  $ hg add a
+  $ hg ci -m "initial"
+  $ hg branch foo
+  marked working directory as branch foo
+  $ hg branch
+  foo
+  $ hg ci -m "add branch name"
+  $ hg branch bar
+  marked working directory as branch bar
+  $ hg ci -m "change branch name"
+
+Branch shadowing:
+
+  $ hg branch default
+  abort: a branch of the same name already exists (use 'hg update' to switch to it)
+
+  $ hg branch -f default
+  marked working directory as branch default
+
+  $ hg ci -m "clear branch name"
+  created new head
+
+There should be only one default branch head
+
+  $ hg heads .
+  changeset:   3:9d567d0b51f9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     clear branch name
+  
+
+  $ hg co foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch
+  foo
+  $ echo bleah > a
+  $ hg ci -m "modify a branch"
+
+  $ hg merge default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg branch
+  foo
+  $ hg ci -m "merge"
+
+  $ hg log
+  changeset:   5:dc140083783b
+  branch:      foo
+  tag:         tip
+  parent:      4:98d14f698afe
+  parent:      3:9d567d0b51f9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge
+  
+  changeset:   4:98d14f698afe
+  branch:      foo
+  parent:      1:0079f24813e2
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a branch
+  
+  changeset:   3:9d567d0b51f9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     clear branch name
+  
+  changeset:   2:ed2bbf4e0102
+  branch:      bar
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change branch name
+  
+  changeset:   1:0079f24813e2
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add branch name
+  
+  changeset:   0:db01e8ea3388
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     initial
+  
+  $ hg branches
+  foo                            5:dc140083783b
+  default                        3:9d567d0b51f9 (inactive)
+  bar                            2:ed2bbf4e0102 (inactive)
+
+  $ hg branches -q
+  foo
+  default
+  bar
+
+Test for invalid branch cache:
+
+  $ hg rollback
+  rolling back to revision 4 (undo commit)
+
+  $ cp $branchcache .hg/bc-invalid
+
+  $ hg log -r foo
+  changeset:   4:98d14f698afe
+  branch:      foo
+  tag:         tip
+  parent:      1:0079f24813e2
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a branch
+  
+  $ cp .hg/bc-invalid $branchcache
+
+  $ hg --debug log -r foo
+  invalidating branch cache (tip differs)
+  changeset:   4:98d14f698afeaff8cb612dcf215ce95e639effc3
+  branch:      foo
+  tag:         tip
+  parent:      1:0079f24813e2b73a891577c243684c5066347bc8
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    4:d01b250baaa05909152f7ae07d7a649deea0df9a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  extra:       branch=foo
+  description:
+  modify a branch
+  
+  
+  $ rm $branchcache
+  $ echo corrupted > $branchcache
+
+  $ hg log -qr foo
+  4:98d14f698afe
+
+  $ cat $branchcache
+  98d14f698afeaff8cb612dcf215ce95e639effc3 4
+  9d567d0b51f9e2068b054e1948e1a927f99b5874 default
+  98d14f698afeaff8cb612dcf215ce95e639effc3 foo
+  ed2bbf4e01029020711be82ca905283e883f0e11 bar
+
+Push should update the branch cache:
+
+  $ hg init ../target
+
+Pushing just rev 0:
+
+  $ hg push -qr 0 ../target
+
+  $ cat ../target/$branchcache
+  db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
+  db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
+
+Pushing everything:
+
+  $ hg push -qf ../target
+
+  $ cat ../target/$branchcache
+  98d14f698afeaff8cb612dcf215ce95e639effc3 4
+  9d567d0b51f9e2068b054e1948e1a927f99b5874 default
+  98d14f698afeaff8cb612dcf215ce95e639effc3 foo
+  ed2bbf4e01029020711be82ca905283e883f0e11 bar
+
+Update with no arguments: tipmost revision of the current branch:
+
+  $ hg up -q -C 0
+  $ hg up -q
+  $ hg id
+  9d567d0b51f9
+
+  $ hg up -q 1
+  $ hg up -q
+  $ hg id
+  98d14f698afe (foo) tip
+
+  $ hg branch foobar
+  marked working directory as branch foobar
+
+  $ hg up
+  abort: branch foobar not found
+
+Fastforward merge:
+
+  $ hg branch ff
+  marked working directory as branch ff
+
+  $ echo ff > ff
+  $ hg ci -Am'fast forward'
+  adding ff
+
+  $ hg up foo
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg merge ff
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg branch
+  foo
+  $ hg commit -m'Merge ff into foo'
+  $ hg parents
+  changeset:   6:917eb54e1b4b
+  branch:      foo
+  tag:         tip
+  parent:      4:98d14f698afe
+  parent:      5:6683a60370cb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Merge ff into foo
+  
+  $ hg manifest
+  a
+  ff
+
+
+Test merging, add 3 default heads and one test head:
+
+  $ cd ..
+  $ hg init merges
+  $ cd merges
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ echo b > b
+  $ hg ci -Amb
+  adding b
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > c
+  $ hg ci -Amc
+  adding c
+  created new head
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo d > d
+  $ hg ci -Amd
+  adding d
+  created new head
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch test
+  marked working directory as branch test
+  $ echo e >> e
+  $ hg ci -Ame
+  adding e
+
+  $ hg log
+  changeset:   4:3a1e01ed1df4
+  branch:      test
+  tag:         tip
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  changeset:   3:980f7dc84c29
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  changeset:   2:d36c0562f908
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   1:d2ae7f538514
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  changeset:   0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+Implicit merge with test branch as parent:
+
+  $ hg merge
+  abort: branch 'test' has one head - please merge with an explicit rev
+  (run 'hg heads' to see all heads)
+  $ hg up -C default
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+Implicit merge with default branch as parent:
+
+  $ hg merge
+  abort: branch 'default' has 3 heads - please merge with an explicit rev
+  (run 'hg heads .' to see heads)
+
+3 branch heads, explicit merge required:
+
+  $ hg merge 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+
+2 branch heads, implicit merge works:
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
--- a/tests/test-permissions	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-echo '% hg init t'
-hg init t
-cd t
-echo foo > a
-echo '% hg add a'
-hg add a
-echo '% hg commit'
-hg commit -m "1"
-echo '% hg verify'
-hg verify
-chmod -r .hg/store/data/a.i
-echo '% hg verify'
-hg verify 2>/dev/null || echo verify failed
-chmod +r .hg/store/data/a.i
-echo '% hg verify'
-hg verify 2>/dev/null || echo verify failed
-chmod -w .hg/store/data/a.i
-echo barber > a
-echo '% hg commit'
-hg commit -m "2" 2>/dev/null || echo commit failed
-chmod -w .
-echo '% hg diff'
-hg diff --nodates
-chmod +w .
-
-chmod +w .hg/store/data/a.i
-mkdir dir
-touch dir/a
-echo '% hg status'
-hg status
-chmod -rx dir
-echo '% hg status'
-hg status
-# reenable perm to allow deletion
-chmod +rx dir
--- a/tests/test-permissions.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-% hg init t
-% hg add a
-% hg commit
-% hg verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-% hg verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-verify failed
-% hg verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-% hg commit
-commit failed
-% hg diff
-diff -r 2a18120dc1c9 a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--foo
-+barber
-% hg status
-M a
-? dir/a
-% hg status
-dir: Permission denied
-M a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-permissions.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,69 @@
+  $ hg init t
+  $ cd t
+
+  $ echo foo > a
+  $ hg add a
+
+  $ hg commit -m "1"
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ chmod -r .hg/store/data/a.i
+
+  $ hg verify || echo %%% verify failed
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  abort: Permission denied: .*
+  %%% verify failed
+
+  $ chmod +r .hg/store/data/a.i
+
+  $ hg verify || echo %%% verify failed
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ chmod -w .hg/store/data/a.i
+
+  $ echo barber > a
+  $ hg commit -m "2" || echo %%% commit failed
+  trouble committing a!
+  abort: Permission denied: .*
+  %%% commit failed
+
+  $ chmod -w .
+
+  $ hg diff --nodates
+  diff -r 2a18120dc1c9 a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -foo
+  +barber
+
+  $ chmod +w .
+
+  $ chmod +w .hg/store/data/a.i
+  $ mkdir dir
+  $ touch dir/a
+  $ hg status
+  M a
+  ? dir/a
+  $ chmod -rx dir
+  $ hg status
+  dir: Permission denied
+  M a
+
+Reenable perm to allow deletion:
+
+  $ chmod +rx dir
+
--- a/tests/test-pull	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-mkdir test
-cd test
-echo foo>foo
-hg init
-hg addremove
-hg commit -m 1
-hg verify
-hg serve -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-cd ..
-
-hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-cd copy
-hg verify
-hg co
-cat foo
-hg manifest --debug
-hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo % issue 622
-cd ..
-hg init empty
-cd empty
-hg pull -u ../test
-
-echo % test file: uri handling
-hg pull -q file://../test-doesnt-exist 2>&1 \
-    | sed 's%abort: repository.*/test-doesnt-exist%abort: repository /test-doesnt-exist%'
-hg pull -q file:../test
-# It's tricky to make file:// URLs working on every platforms
-# with regular shell commands.
-URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
-hg pull -q "$URL"
--- a/tests/test-pull-branch	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-hg init t
-cd t
-echo 1 > foo
-hg ci -Am1 # 0
-hg branch branchA
-echo a1 > foo
-hg ci -ma1 # 1
-
-cd ..
-hg init tt
-cd tt
-hg pull ../t
-hg up branchA
-
-cd ../t
-echo a2 > foo
-hg ci -ma2 # 2
-echo % create branch B
-hg up 0
-hg branch branchB
-echo b1 > foo
-hg ci -mb1 # 3
-
-cd ../tt
-echo % a new branch is there
-hg pull -u ../t
-
-echo % develop both branch
-cd ../t
-hg up branchA
-echo a3 > foo
-hg ci -ma3 # 4
-hg up branchB
-echo b2 > foo
-hg ci -mb2 # 5
-
-cd ../tt
-echo % should succeed, no new heads
-hg pull -u ../t
-
-echo % add an head on other branch
-cd ../t
-hg up branchA
-echo a4 > foo
-hg ci -ma4 # 6
-hg up branchB
-echo b3.1 > foo
-hg ci -m b3.1 # 7
-hg up 5
-echo b3.2 > foo
-hg ci -m b3.2 # 8
-
-cd ../tt
-echo % should succeed only one head on our branch
-hg pull -u ../t
-
-cd ../t
-hg up -C branchA
-echo a5.1 > foo
-hg ci -ma5.1 # 9
-hg up 6
-echo a5.2 > foo
-hg ci -ma5.2 # 10
-hg up 7
-echo b4.1 > foo
-hg ci -m b4.1 # 11
-hg up -C 8
-echo b4.2 > foo
-hg ci -m b4.2 # 12
-
-cd ../tt
-echo % should fail new head in our branch
-hg pull -u ../t
--- a/tests/test-pull-branch.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-adding foo
-marked working directory as branch branchA
-pulling from ../t
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% create branch B
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch branchB
-% a new branch is there
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files (+1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% develop both branch
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should succeed, no new heads
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% add an head on other branch
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% should succeed only one head on our branch
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files (+1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail new head in our branch
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files (+1 heads)
-not updating, since new heads added
-(run 'hg heads' to see heads, 'hg merge' to merge)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-branch.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,136 @@
+  $ hg init t
+  $ cd t
+  $ echo 1 > foo
+  $ hg ci -Am1 # 0
+  adding foo
+  $ hg branch branchA
+  marked working directory as branch branchA
+  $ echo a1 > foo
+  $ hg ci -ma1 # 1
+
+  $ cd ..
+  $ hg init tt
+  $ cd tt
+  $ hg pull ../t
+  pulling from ../t
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg up branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd ../t
+  $ echo a2 > foo
+  $ hg ci -ma2 # 2
+
+Create branch B:
+
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch branchB
+  marked working directory as branch branchB
+  $ echo b1 > foo
+  $ hg ci -mb1 # 3
+
+  $ cd ../tt
+
+A new branch is there
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files (+1 heads)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Develop both branches:
+
+  $ cd ../t
+  $ hg up branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a3 > foo
+  $ hg ci -ma3 # 4
+  $ hg up branchB
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b2 > foo
+  $ hg ci -mb2 # 5
+
+  $ cd ../tt
+
+Should succeed, no new heads:
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Add a head on other branch:
+
+  $ cd ../t
+  $ hg up branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a4 > foo
+  $ hg ci -ma4 # 6
+  $ hg up branchB
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b3.1 > foo
+  $ hg ci -m b3.1 # 7
+  $ hg up 5
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b3.2 > foo
+  $ hg ci -m b3.2 # 8
+  created new head
+
+  $ cd ../tt
+
+Should succeed because there is only one head on our branch:
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files (+1 heads)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd ../t
+  $ hg up -C branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a5.1 > foo
+  $ hg ci -ma5.1 # 9
+  $ hg up 6
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a5.2 > foo
+  $ hg ci -ma5.2 # 10
+  created new head
+  $ hg up 7
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b4.1 > foo
+  $ hg ci -m b4.1 # 11
+  $ hg up -C 8
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b4.2 > foo
+  $ hg ci -m b4.2 # 12
+
+  $ cd ../tt
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files (+1 heads)
+  not updating, since new heads added
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
--- a/tests/test-pull-permission	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-mkdir a
-cd a
-hg init
-echo foo > b
-hg add b
-hg ci -m "b"
-
-chmod -w .hg/store
-
-cd ..
-
-hg clone a b
-
-chmod +w a/.hg/store # let test clean up
-
-cd b
-hg verify
--- a/tests/test-pull-permission.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-permission.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,30 @@
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo foo > b
+  $ hg add b
+  $ hg ci -m "b"
+
+  $ chmod -w .hg/store
+
+  $ cd ..
+
+  $ hg clone a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ chmod +w a/.hg/store # let test clean up
+
+  $ cd b
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
--- a/tests/test-pull-r	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-echo foo > foo
-hg ci -qAm 'add foo'
-echo >> foo
-hg ci -m 'change foo'
-hg up -qC 0
-echo bar > bar
-hg ci -qAm 'add bar'
-hg log
-cd ..
-hg init copy
-cd copy
-
-echo '% pull a missing revision'
-hg pull -qr missing ../repo
-
-echo '% pull multiple revisions with update'
-hg pull -qu -r 0 -r 1 ../repo
-hg -q parents
-hg rollback
-
-echo '% pull -r 0'
-hg pull -qr 0 ../repo
-hg log
-
-echo '% pull -r 1'
-hg pull -qr 1 ../repo
-hg log
-
-# this used to abort: received changelog group is empty
-echo '% pull -r 1 again'
-hg pull -qr 1 ../repo
--- a/tests/test-pull-r.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-changeset:   2:effea6de0384
-tag:         tip
-parent:      0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   1:ed1b79f46b9a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-changeset:   0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull a missing revision
-abort: unknown revision 'missing'!
-% pull multiple revisions with update
-0:bbd179dfa0a7
-rolling back to revision -1 (undo pull)
-% pull -r 0
-changeset:   0:bbd179dfa0a7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull -r 1
-changeset:   1:ed1b79f46b9a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-changeset:   0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull -r 1 again
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-r.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,71 @@
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ hg ci -qAm 'add foo'
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+  $ hg up -qC 0
+  $ echo bar > bar
+  $ hg ci -qAm 'add bar'
+
+  $ hg log
+  changeset:   2:effea6de0384
+  tag:         tip
+  parent:      0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   1:ed1b79f46b9a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  changeset:   0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ cd ..
+  $ hg init copy
+  $ cd copy
+
+Pull a missing revision:
+
+  $ hg pull -qr missing ../repo
+  abort: unknown revision 'missing'!
+
+Pull multiple revisions with update:
+
+  $ hg pull -qu -r 0 -r 1 ../repo
+  $ hg -q parents
+  0:bbd179dfa0a7
+  $ hg rollback
+  rolling back to revision -1 (undo pull)
+
+  $ hg pull -qr 0 ../repo
+  $ hg log
+  changeset:   0:bbd179dfa0a7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ hg pull -qr 1 ../repo
+  $ hg log
+  changeset:   1:ed1b79f46b9a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  changeset:   0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+
+This used to abort: received changelog group is empty:
+
+  $ hg pull -qr 1 ../repo
+
--- a/tests/test-pull-update	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-
-hg init t
-cd t
-echo 1 > foo
-hg ci -Am m
-
-cd ..
-hg clone t tt
-cd tt
-echo 1.1 > foo
-hg ci -Am m
-
-cd ../t
-echo 1.2 > foo
-hg ci -Am m
-echo % should fail
-hg pull -u ../tt
-
-cd ../tt
-echo % should fail
-hg pull -u ../t
-HGMERGE=true hg merge
-hg ci -mm
-
-cd ../t
-echo % should work
-hg pull -u ../tt
--- a/tests/test-pull-update.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail
-pulling from ../tt
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-not updating, since new heads added
-(run 'hg heads' to see heads, 'hg merge' to merge)
-% should fail
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-not updating, since new heads added
-(run 'hg heads' to see heads, 'hg merge' to merge)
-merging foo
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should work
-pulling from ../tt
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (-1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-update.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,63 @@
+  $ hg init t
+  $ cd t
+  $ echo 1 > foo
+  $ hg ci -Am m
+  adding foo
+
+  $ cd ..
+  $ hg clone t tt
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd tt
+  $ echo 1.1 > foo
+  $ hg ci -Am m
+
+  $ cd ../t
+  $ echo 1.2 > foo
+  $ hg ci -Am m
+
+Should not update:
+
+  $ hg pull -u ../tt
+  pulling from ../tt
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  not updating, since new heads added
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ cd ../tt
+
+Should not update:
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  not updating, since new heads added
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ HGMERGE=true hg merge
+  merging foo
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -mm
+
+  $ cd ../t
+
+Should work:
+
+  $ hg pull -u ../tt
+  pulling from ../tt
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (-1 heads)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
--- a/tests/test-pull.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
-pulling from http://foo:***@localhost:$HGPORT/
-searching for changes
-no changes found
-rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
-% issue 622
-pulling from ../test
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test file: uri handling
-abort: repository /test-doesnt-exist not found!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,80 @@
+  $ mkdir test
+  $ cd test
+
+  $ echo foo>foo
+  $ hg init
+  $ hg addremove
+  adding foo
+  $ hg commit -m 1
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ cd ..
+
+  $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd copy
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg co
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat foo
+  foo
+
+  $ hg manifest --debug
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
+
+  $ hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  pulling from http://foo:***@localhost:$HGPORT/
+  searching for changes
+  no changes found
+
+  $ hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+  rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
+
+Issue 622:
+
+  $ cd ..
+  $ hg init empty
+  $ cd empty
+  $ hg pull -u ../test
+  pulling from ../test
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Test 'file:' uri handling:
+
+  $ hg pull -q file://../test-doesnt-exist
+  abort: repository /test-doesnt-exist not found!
+
+  $ hg pull -q file:../test
+
+# It's tricky to make file:// URLs working on every platforms
+# with regular shell commands.
+
+  $ URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
+  $ hg pull -q "$URL"
+
--- a/tests/test-push-hook-lock	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-hg init 1
-echo '[ui]' >> 1/.hg/hgrc
-echo 'timeout = 10' >> 1/.hg/hgrc
-echo foo > 1/foo
-hg --cwd 1 ci -A -m foo
-hg clone 1 2
-hg clone 2 3
-echo '[hooks]' >> 2/.hg/hgrc
-echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
-echo bar >> 3/foo
-hg --cwd 3 ci -m bar
-hg --cwd 3 push ../2
--- a/tests/test-push-hook-lock.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pushing to ../2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-hook-lock.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,31 @@
+  $ hg init 1
+
+  $ echo '[ui]' >> 1/.hg/hgrc
+  $ echo 'timeout = 10' >> 1/.hg/hgrc
+
+  $ echo foo > 1/foo
+  $ hg --cwd 1 ci -A -m foo
+  adding foo
+
+  $ hg clone 1 2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg clone 2 3
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo '[hooks]' >> 2/.hg/hgrc
+  $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
+
+  $ echo bar >> 3/foo
+  $ hg --cwd 3 ci -m bar
+
+  $ hg --cwd 3 push ../2
+  pushing to ../2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
--- a/tests/test-push-r	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-cat >>afile <<EOF
-0
-EOF
-hg add afile
-hg commit -m "0.0"
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "0.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "0.2"
-cat >>afile <<EOF
-3
-EOF
-hg commit -m "0.3"
-hg update -C 0
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "1.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "1.2"
-cat >fred <<EOF
-a line
-EOF
-cat >>afile <<EOF
-3
-EOF
-hg add fred
-hg commit -m "1.3"
-hg mv afile adifferentfile
-hg commit -m "1.3m"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m"
-hg debugindex .hg/store/data/afile.i
-hg debugindex .hg/store/data/adifferentfile.i
-hg debugindex .hg/store/data/anotherfile.i
-hg debugindex .hg/store/data/fred.i
-hg debugindex .hg/store/00manifest.i
-hg verify
-cd ..
-for i in 0 1 2 3 4 5 6 7 8; do
-   mkdir test-"$i"
-   hg --cwd test-"$i" init
-   hg -R test push -r "$i" test-"$i"
-   cd test-"$i"
-   hg verify
-   cd ..
-done
-cd test-8
-hg pull ../test-7
-hg verify
--- a/tests/test-push-r.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 362fef284ce2 000000000000 000000000000
-     1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
-     2         8       7      2       2 4c982badb186 125144f7e028 000000000000
-     3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       7 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       8 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
-     1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
-     2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
-     3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
-     4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
-     5       250      68      3       7 09bb521d218d de68e904d169 000000000000
-     6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-pushing to test-0
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-pushing to test-1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-pushing to test-2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-pushing to test-3
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 4 changesets, 4 total revisions
-pushing to test-4
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-pushing to test-5
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-pushing to test-6
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 2 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 4 changesets, 5 total revisions
-pushing to test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 3 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 6 total revisions
-pushing to test-8
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 5 changes to 2 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-pulling from ../test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 2 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-r.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,230 @@
+  $ hg init test
+  $ cd test
+
+  $ cat >>afile <<EOF
+  > 0
+  > EOF
+  $ hg add afile
+  $ hg commit -m "0.0"
+
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "0.1"
+
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "0.2"
+
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg commit -m "0.3"
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "1.1"
+  created new head
+
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "1.2"
+
+  $ cat >fred <<EOF
+  > a line
+  > EOF
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg add fred
+  $ hg commit -m "1.3"
+
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+
+  $ hg debugindex .hg/store/data/afile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 362fef284ce2 000000000000 000000000000
+       1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
+       2         8       7      2       2 4c982badb186 125144f7e028 000000000000
+       3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
+
+  $ hg debugindex .hg/store/data/adifferentfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       7 2565f3199a74 000000000000 000000000000
+
+  $ hg debugindex .hg/store/data/anotherfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       8 2565f3199a74 000000000000 000000000000
+
+  $ hg debugindex .hg/store/data/fred.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
+
+  $ hg debugindex .hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
+       1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
+       2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
+       3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
+       4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
+       5       250      68      3       7 09bb521d218d de68e904d169 000000000000
+       6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+
+  $ cd ..
+
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >    echo
+  >    mkdir test-"$i"
+  >    hg --cwd test-"$i" init
+  >    hg -R test push -r "$i" test-"$i"
+  >    cd test-"$i"
+  >    hg verify
+  >    cd ..
+  > done
+  
+  pushing to test-0
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  
+  pushing to test-1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  
+  pushing to test-2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  
+  pushing to test-3
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 4 changesets, 4 total revisions
+  
+  pushing to test-4
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  
+  pushing to test-5
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  
+  pushing to test-6
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 2 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 4 changesets, 5 total revisions
+  
+  pushing to test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 3 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 6 total revisions
+  
+  pushing to test-8
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+
+  $ cd test-8
+
+  $ hg pull ../test-7
+  pulling from ../test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 2 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+
--- a/tests/test-push-validation	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-cat > .hg/hgrc <<EOF
-[server]
-validate=1
-EOF
-echo alpha > alpha
-echo beta > beta
-hg addr
-hg ci -m 1
-
-cd ..
-hg clone test test-clone
-
-cd test-clone
-cp .hg/store/data/beta.i tmp
-echo blah >> beta
-hg ci -m '2 (corrupt)'
-mv tmp .hg/store/data/beta.i
-hg push 2>&1 | "$TESTDIR/filtertmp.py"
--- a/tests/test-push-validation.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-adding alpha
-adding beta
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pushing to $HGTMP/test-push-validation/test
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-transaction abort!
-rollback completed
-abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-validation.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,52 @@
+  $ hg init test
+  $ cd test
+
+  $ cat > .hg/hgrc <<EOF
+  > [server]
+  > validate=1
+  > EOF
+
+  $ echo alpha > alpha
+  $ echo beta > beta
+  $ hg addr
+  adding alpha
+  adding beta
+  $ hg ci -m 1
+
+  $ cd ..
+  $ hg clone test test-clone
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd test-clone
+  $ cp .hg/store/data/beta.i tmp
+  $ echo blah >> beta
+  $ hg ci -m '2 (corrupt)'
+  $ mv tmp .hg/store/data/beta.i
+
+Expected to fail:
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+   beta@1: dddc47b3ba30 in manifests not found
+  2 files, 2 changesets, 2 total revisions
+  1 integrity errors encountered!
+  (first damaged changeset appears to be 1)
+
+Expected to fail:
+
+  $ hg push
+  pushing to .*
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  transaction abort!
+  rollback completed
+  abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
+
+  $ true
+
--- a/tests/test-push-warn	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "graphlog=" >> $HGRCPATH
-
-mkdir a
-cd a
-hg init
-echo foo > t1
-hg add t1
-hg commit -m "1"
-
-cd ..
-hg clone a b
-
-cd a
-echo foo > t2
-hg add t2
-hg commit -m "2"
-
-cd ../b
-echo foo > t3
-hg add t3
-hg commit -m "3"
-
-hg push ../a
-hg pull ../a
-hg push ../a
-hg merge
-hg commit -m "4"
-hg push ../a
-cd ..
-
-hg init c
-cd c
-for i in 0 1 2; do
-    echo $i >> foo
-    hg ci -Am $i
-done
-cd ..
-
-hg clone c d
-cd d
-for i in 0 1; do
-    hg co -C $i
-    echo d-$i >> foo
-    hg ci -m d-$i
-done
-
-HGMERGE=true hg merge 3
-hg ci -m c-d
-
-hg push ../c; echo $?
-hg push -r 2 ../c; echo $?
-hg push -r 3 ../c; echo $?
-hg push -r 3 -r 4 ../c; echo $?
-hg push -f -r 3 -r 4 ../c; echo $?
-hg push -r 5 ../c; echo $?
-hg in ../c
-
-echo % issue 450
-hg init ../e
-hg push -r 0 ../e ; echo $?
-hg push -r 1 ../e ; echo $?
-
-cd ..
-
-echo % issue 736
-hg init f
-cd f
-hg -q branch a
-echo 0 > foo
-hg -q ci -Am 0
-echo 1 > foo
-hg -q ci -m 1
-hg -q up 0
-echo 2 > foo
-hg -q ci -m 2
-hg -q up 0
-hg -q branch b
-echo 3 > foo
-hg -q ci -m 3
-cd ..
-
-hg -q clone f g
-cd g
-
-echo % push on existing branch and new branch
-hg -q up 1
-echo 4 > foo
-hg -q ci -m 4
-hg -q up 0
-echo 5 > foo
-hg -q branch c
-hg -q ci -m 5
-hg push ../f; echo $?
-hg push -r 4 -r 5 ../f; echo $?
-
-echo % multiple new branches
-hg -q branch d
-echo 6 > foo
-hg -q ci -m 6
-hg push ../f; echo $?
-hg push -r 4 -r 6 ../f; echo $?
-cd ../g
-
-echo % fail on multiple head push
-hg -q up 1
-echo 7 > foo
-hg -q ci -m 7
-hg push -r 4 -r 7 ../f; echo $?
-
-echo % push replacement head on existing branches
-hg -q up 3
-echo 8 > foo
-hg -q ci -m 8
-hg push -r 7 -r 8 ../f; echo $?
-
-echo % merge of branch a to other branch b followed by unrelated push on branch a
-hg -q up 7
-HGMERGE=true hg -q merge 8
-hg -q ci -m 9
-hg -q up 8
-echo 10 > foo
-hg -q ci -m 10
-hg push -r 9 ../f; echo $?
-hg push -r 10 ../f; echo $?
-
-echo % cheating the counting algorithm
-hg -q up 9
-HGMERGE=true hg -q merge 2
-hg -q ci -m 11
-hg -q up 1
-echo 12 > foo
-hg -q ci -m 12
-hg push -r 11 -r 12 ../f; echo $?
-
-echo % failed push of new named branch
-echo 12 > foo
-hg -q ci -m 12a
-hg -q up 11
-echo 13 > foo
-hg -q branch e
-hg -q ci -m 13d
-hg push -r 12 -r 13 ../f; echo $?
-
-echo % using --new-branch to push new named branch
-hg push --new-branch -r 12 -r 13 ../f; echo $?
-
-echo % checking prepush logic does not allow silently pushing multiple new heads
-cd ..
-hg init h
-echo init > h/init
-hg -R h ci -Am init
-echo a > h/a
-hg -R h ci -Am a
-hg clone h i
-hg -R h up 0
-echo b > h/b
-hg -R h ci -Am b
-hg -R i up 0
-echo c > i/c
-hg -R i ci -Am c
-hg -R i push h
-echo
-
-echo % check prepush logic with merged branches
-hg init j
-hg -R j branch a
-echo init > j/foo
-hg -R j ci -Am init
-hg clone j k
-echo a1 > j/foo
-hg -R j ci -m a1
-hg -R k branch b
-echo b > k/foo
-hg -R k ci -m b
-hg -R k up 0
-hg -R k merge b
-hg -R k ci -m merge
-hg -R k push -r a j
-echo
-
-echo % prepush -r should not allow you to sneak in new heads
-hg init l
-cd l
-echo a >> foo
-hg -q add foo
-hg -q branch a
-hg -q ci -ma
-hg -q up null
-echo a >> foo
-hg -q add foo
-hg -q branch b
-hg -q ci -mb
-cd ..
-hg -q clone l m -u a
-cd m
-hg -q merge b
-hg -q ci -mmb
-hg -q up 0
-echo a >> foo
-hg -q ci -ma2
-hg -q up 2
-echo a >> foo
-hg -q branch -f b
-hg -q ci -mb2
-hg -q merge 3
-hg -q ci -mma
-hg push ../l -b b
-cd ..
-
-echo % check prepush with new branch head on former topo non-head
-hg init n
-cd n
-hg branch A
-echo a >a
-hg ci -Ama
-hg branch B
-echo b >b
-hg ci -Amb
-# b is now branch head of B, and a topological head
-# a is now branch head of A, but not a topological head
-hg clone . inner
-cd inner
-hg up B
-echo b1 >b1
-hg ci -Amb1
-# in the clone b1 is now the head of B
-cd ..
-hg up 0
-echo a2 >a2
-hg ci -Ama2
-# a2 is now the new branch head of A, and a new topological head
-# it replaces a former inner branch head, so it should at most warn about A, not B
-echo %% glog of local
-hg glog --template "{rev}: {branches} {desc}\n"
-echo %% glog of remote
-hg glog -R inner --template "{rev}: {branches} {desc}\n"
-echo %% outgoing
-hg out inner --template "{rev}: {branches} {desc}\n"
-hg push inner
-cd ..
-
-echo % check prepush with new branch head on former topo head
-hg init o
-cd o
-hg branch A
-echo a >a
-hg ci -Ama
-hg branch B
-echo b >b
-hg ci -Amb
-# b is now branch head of B, and a topological head
-hg up 0
-echo a1 >a1
-hg ci -Ama1
-# a1 is now branch head of A, and a topological head
-hg clone . inner
-cd inner
-hg up B
-echo b1 >b1
-hg ci -Amb1
-# in the clone b1 is now the head of B
-cd ..
-echo a2 >a2
-hg ci -Ama2
-# a2 is now the new branch head of A, and a topological head
-# it replaces a former topological and branch head, so this should not warn
-echo %% glog of local
-hg glog --template "{rev}: {branches} {desc}\n"
-echo %% glog of remote
-hg glog -R inner --template "{rev}: {branches} {desc}\n"
-echo %% outgoing
-hg out inner --template "{rev}: {branches} {desc}\n"
-hg push inner
-cd ..
-
-echo % check prepush with new branch head and new child of former branch head
-echo % but child is on different branch
-hg init p
-cd p
-hg branch A
-echo a0 >a
-hg ci -Ama0
-echo a1 >a
-hg ci -ma1
-hg up null
-hg branch B
-echo b0 >b
-hg ci -Amb0
-echo b1 >b
-hg ci -mb1
-
-hg clone . inner
-
-hg up A
-hg branch -f B
-echo a3 >a
-hg ci -ma3
-hg up 3
-hg branch -f A
-echo b3 >b
-hg ci -mb3
-
-echo %% glog of local
-hg glog --template "{rev}: {branches} {desc}\n"
-echo %% glog of remote
-hg glog -R inner --template "{rev}: {branches} {desc}\n"
-echo %% outgoing
-hg out inner --template "{rev}: {branches} {desc}\n"
-hg push inner
-hg push inner -r4 -r5
-hg in inner
-cd ..
-
-exit 0
--- a/tests/test-push-warn.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pushing to ../a
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(you should pull and merge or use push -f to force)
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-pushing to ../a
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pushing to ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 1 changes to 1 files
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging foo
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pushing to ../c
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-255
-pushing to ../c
-searching for changes
-no changes found
-0
-pushing to ../c
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-255
-pushing to ../c
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-255
-pushing to ../c
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files (+2 heads)
-0
-pushing to ../c
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (-1 heads)
-0
-comparing with ../c
-searching for changes
-no changes found
-% issue 450
-pushing to ../e
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-0
-pushing to ../e
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-0
-% issue 736
-% push on existing branch and new branch
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c!
-(use 'hg push --new-branch' to create new remote branches)
-255
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c!
-(use 'hg push --new-branch' to create new remote branches)
-255
-% multiple new branches
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c, d!
-(use 'hg push --new-branch' to create new remote branches)
-255
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c, d!
-(use 'hg push --new-branch' to create new remote branches)
-255
-% fail on multiple head push
-pushing to ../f
-searching for changes
-abort: push creates new remote heads on branch 'a'!
-(did you forget to merge? use push -f to force)
-255
-% push replacement head on existing branches
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-0
-% merge of branch a to other branch b followed by unrelated push on branch a
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (-1 heads)
-0
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-0
-% cheating the counting algorithm
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-0
-% failed push of new named branch
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: e!
-(use 'hg push --new-branch' to create new remote branches)
-255
-% using --new-branch to push new named branch
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-0
-% checking prepush logic does not allow silently pushing multiple new heads
-adding init
-adding a
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-created new head
-pushing to h
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(you should pull and merge or use push -f to force)
-
-% check prepush logic with merged branches
-marked working directory as branch a
-adding foo
-updating to branch a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pushing to j
-searching for changes
-abort: push creates new remote branches: b!
-(use 'hg push --new-branch' to create new remote branches)
-
-% prepush -r should not allow you to sneak in new heads
-pushing to ../l
-searching for changes
-abort: push creates new remote heads on branch 'a'!
-(did you forget to merge? use push -f to force)
-% check prepush with new branch head on former topo non-head
-marked working directory as branch A
-adding a
-marked working directory as branch B
-adding b
-updating to branch B
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b1
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a2
-%% glog of local
-@  2: A a2
-|
-| o  1: B b
-|/
-o  0: A a
-
-%% glog of remote
-@  2: B b1
-|
-o  1: B b
-|
-o  0: A a
-
-%% outgoing
-comparing with inner
-searching for changes
-2: A a2
-pushing to inner
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-% check prepush with new branch head on former topo head
-marked working directory as branch A
-adding a
-marked working directory as branch B
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a1
-updating to branch A
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b1
-adding a2
-%% glog of local
-@  3: A a2
-|
-o  2: A a1
-|
-| o  1: B b
-|/
-o  0: A a
-
-%% glog of remote
-@  3: B b1
-|
-| o  2: A a1
-| |
-o |  1: B b
-|/
-o  0: A a
-
-%% outgoing
-comparing with inner
-searching for changes
-3: A a2
-pushing to inner
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% check prepush with new branch head and new child of former branch head
-% but child is on different branch
-marked working directory as branch A
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch B
-adding b
-updating to branch B
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch B
-created new head
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch A
-created new head
-%% glog of local
-@  5: A b3
-|
-| o  4: B a3
-| |
-o |  3: B b1
-| |
-o |  2: B b0
- /
-o  1: A a1
-|
-o  0: A a0
-
-%% glog of remote
-@  3: B b1
-|
-o  2: B b0
-
-o  1: A a1
-|
-o  0: A a0
-
-%% outgoing
-comparing with inner
-searching for changes
-4: B a3
-5: A b3
-pushing to inner
-searching for changes
-abort: push creates new remote heads on branch 'A'!
-(did you forget to merge? use push -f to force)
-pushing to inner
-searching for changes
-abort: push creates new remote heads on branch 'A'!
-(did you forget to merge? use push -f to force)
-comparing with inner
-searching for changes
-no changes found
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-warn.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,701 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo foo > t1
+  $ hg add t1
+  $ hg commit -m "1"
+
+  $ cd ..
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd a
+  $ echo foo > t2
+  $ hg add t2
+  $ hg commit -m "2"
+
+  $ cd ../b
+  $ echo foo > t3
+  $ hg add t3
+  $ hg commit -m "3"
+
+  $ hg push ../a
+  pushing to ../a
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (you should pull and merge or use push -f to force)
+
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg push ../a
+  pushing to ../a
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg commit -m "4"
+  $ hg push ../a
+  pushing to ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 1 changes to 1 files
+
+  $ cd ..
+
+  $ hg init c
+  $ cd c
+  $ for i in 0 1 2; do
+  >     echo $i >> foo
+  >     hg ci -Am $i
+  > done
+  adding foo
+  $ cd ..
+
+  $ hg clone c d
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd d
+  $ for i in 0 1; do
+  >    hg co -C $i
+  >    echo d-$i >> foo
+  >    hg ci -m d-$i
+  > done
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+
+  $ HGMERGE=true hg merge 3
+  merging foo
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg ci -m c-d
+
+  $ hg push ../c; echo $?
+  pushing to ../c
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  255
+
+  $ hg push -r 2 ../c; echo $?
+  pushing to ../c
+  searching for changes
+  no changes found
+  0
+
+  $ hg push -r 3 ../c; echo $?
+  pushing to ../c
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  255
+
+  $ hg push -r 3 -r 4 ../c; echo $?
+  pushing to ../c
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  255
+
+  $ hg push -f -r 3 -r 4 ../c; echo $?
+  pushing to ../c
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files (+2 heads)
+  0
+
+  $ hg push -r 5 ../c; echo $?
+  pushing to ../c
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (-1 heads)
+  0
+
+  $ hg in ../c
+  comparing with ../c
+  searching for changes
+  no changes found
+
+
+Issue 450:
+
+  $ hg init ../e
+  $ hg push -r 0 ../e ; echo $?
+  pushing to ../e
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  0
+
+  $ hg push -r 1 ../e ; echo $?
+  pushing to ../e
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  0
+
+  $ cd ..
+
+
+Issue 736:
+
+  $ hg init f
+  $ cd f
+  $ hg -q branch a
+  $ echo 0 > foo
+  $ hg -q ci -Am 0
+  $ echo 1 > foo
+  $ hg -q ci -m 1
+  $ hg -q up 0
+  $ echo 2 > foo
+  $ hg -q ci -m 2
+  $ hg -q up 0
+  $ hg -q branch b
+  $ echo 3 > foo
+  $ hg -q ci -m 3
+  $ cd ..
+
+  $ hg -q clone f g
+  $ cd g
+
+Push on existing branch and new branch:
+
+  $ hg -q up 1
+  $ echo 4 > foo
+  $ hg -q ci -m 4
+  $ hg -q up 0
+  $ echo 5 > foo
+  $ hg -q branch c
+  $ hg -q ci -m 5
+
+  $ hg push ../f; echo $?
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c!
+  (use 'hg push --new-branch' to create new remote branches)
+  255
+
+  $ hg push -r 4 -r 5 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c!
+  (use 'hg push --new-branch' to create new remote branches)
+  255
+
+
+Multiple new branches:
+
+  $ hg -q branch d
+  $ echo 6 > foo
+  $ hg -q ci -m 6
+
+  $ hg push ../f; echo $?
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c, d!
+  (use 'hg push --new-branch' to create new remote branches)
+  255
+
+  $ hg push -r 4 -r 6 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c, d!
+  (use 'hg push --new-branch' to create new remote branches)
+  255
+
+  $ cd ../g
+
+
+Fail on multiple head push:
+
+  $ hg -q up 1
+  $ echo 7 > foo
+  $ hg -q ci -m 7
+
+  $ hg push -r 4 -r 7 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote heads on branch 'a'!
+  (did you forget to merge? use push -f to force)
+  255
+
+Push replacement head on existing branches:
+
+  $ hg -q up 3
+  $ echo 8 > foo
+  $ hg -q ci -m 8
+
+  $ hg push -r 7 -r 8 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  0
+
+
+Merge of branch a to other branch b followed by unrelated push
+on branch a:
+
+  $ hg -q up 7
+  $ HGMERGE=true hg -q merge 8
+  $ hg -q ci -m 9
+  $ hg -q up 8
+  $ echo 10 > foo
+  $ hg -q ci -m 10
+
+  $ hg push -r 9 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (-1 heads)
+  0
+
+  $ hg push -r 10 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  0
+
+
+Cheating the counting algorithm:
+
+  $ hg -q up 9
+  $ HGMERGE=true hg -q merge 2
+  $ hg -q ci -m 11
+  $ hg -q up 1
+  $ echo 12 > foo
+  $ hg -q ci -m 12
+
+  $ hg push -r 11 -r 12 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  0
+
+
+Failed push of new named branch:
+
+  $ echo 12 > foo
+  $ hg -q ci -m 12a
+  $ hg -q up 11
+  $ echo 13 > foo
+  $ hg -q branch e
+  $ hg -q ci -m 13d
+
+  $ hg push -r 12 -r 13 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: e!
+  (use 'hg push --new-branch' to create new remote branches)
+  255
+
+
+Using --new-branch to push new named branch:
+
+  $ hg push --new-branch -r 12 -r 13 ../f; echo $?
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  0
+
+
+Checking prepush logic does not allow silently pushing 
+multiple new heads:
+
+  $ cd ..
+  $ hg init h
+  $ echo init > h/init
+  $ hg -R h ci -Am init
+  adding init
+  $ echo a > h/a
+  $ hg -R h ci -Am a
+  adding a
+  $ hg clone h i
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R h up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo b > h/b
+  $ hg -R h ci -Am b
+  adding b
+  created new head
+  $ hg -R i up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > i/c
+  $ hg -R i ci -Am c
+  adding c
+  created new head
+
+  $ hg -R i push h
+  pushing to h
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (you should pull and merge or use push -f to force)
+
+
+Check prepush logic with merged branches:
+
+  $ hg init j
+  $ hg -R j branch a
+  marked working directory as branch a
+  $ echo init > j/foo
+  $ hg -R j ci -Am init
+  adding foo
+  $ hg clone j k
+  updating to branch a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a1 > j/foo
+  $ hg -R j ci -m a1
+  $ hg -R k branch b
+  marked working directory as branch b
+  $ echo b > k/foo
+  $ hg -R k ci -m b
+  $ hg -R k up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R k merge b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg -R k ci -m merge
+
+  $ hg -R k push -r a j
+  pushing to j
+  searching for changes
+  abort: push creates new remote branches: b!
+  (use 'hg push --new-branch' to create new remote branches)
+
+
+Prepush -r should not allow you to sneak in new heads:
+
+  $ hg init l
+  $ cd l
+  $ echo a >> foo
+  $ hg -q add foo
+  $ hg -q branch a
+  $ hg -q ci -ma
+  $ hg -q up null
+  $ echo a >> foo
+  $ hg -q add foo
+  $ hg -q branch b
+  $ hg -q ci -mb
+  $ cd ..
+  $ hg -q clone l m -u a
+  $ cd m
+  $ hg -q merge b
+  $ hg -q ci -mmb
+  $ hg -q up 0
+  $ echo a >> foo
+  $ hg -q ci -ma2
+  $ hg -q up 2
+  $ echo a >> foo
+  $ hg -q branch -f b
+  $ hg -q ci -mb2
+  $ hg -q merge 3
+  $ hg -q ci -mma
+
+  $ hg push ../l -b b
+  pushing to ../l
+  searching for changes
+  abort: push creates new remote heads on branch 'a'!
+  (did you forget to merge? use push -f to force)
+
+  $ cd ..
+
+
+Check prepush with new branch head on former topo non-head:
+
+  $ hg init n
+  $ cd n
+  $ hg branch A
+  marked working directory as branch A
+  $ echo a >a
+  $ hg ci -Ama
+  adding a
+  $ hg branch B
+  marked working directory as branch B
+  $ echo b >b
+  $ hg ci -Amb
+  adding b
+
+# b is now branch head of B, and a topological head
+# a is now branch head of A, but not a topological head
+
+  $ hg clone . inner
+  updating to branch B
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd inner
+  $ hg up B
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b1 >b1
+  $ hg ci -Amb1
+  adding b1
+
+# in the clone b1 is now the head of B
+
+  $ cd ..
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo a2 >a2
+  $ hg ci -Ama2
+  adding a2
+
+# a2 is now the new branch head of A, and a new topological head
+# it replaces a former inner branch head, so it should at most warn about A, not B
+
+glog of local:
+
+  $ hg glog --template "{rev}: {branches} {desc}\n"
+  @  2: A a2
+  |
+  | o  1: B b
+  |/
+  o  0: A a
+  
+glog of remote:
+
+  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
+  @  2: B b1
+  |
+  o  1: B b
+  |
+  o  0: A a
+  
+outgoing:
+
+  $ hg out inner --template "{rev}: {branches} {desc}\n"
+  comparing with inner
+  searching for changes
+  2: A a2
+
+  $ hg push inner
+  pushing to inner
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+
+  $ cd ..
+
+
+Check prepush with new branch head on former topo head:
+
+  $ hg init o
+  $ cd o
+  $ hg branch A
+  marked working directory as branch A
+  $ echo a >a
+  $ hg ci -Ama
+  adding a
+  $ hg branch B
+  marked working directory as branch B
+  $ echo b >b
+  $ hg ci -Amb
+  adding b
+
+# b is now branch head of B, and a topological head
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo a1 >a1
+  $ hg ci -Ama1
+  adding a1
+
+# a1 is now branch head of A, and a topological head
+
+  $ hg clone . inner
+  updating to branch A
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd inner
+  $ hg up B
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo b1 >b1
+  $ hg ci -Amb1
+  adding b1
+
+# in the clone b1 is now the head of B
+
+  $ cd ..
+  $ echo a2 >a2
+  $ hg ci -Ama2
+  adding a2
+
+# a2 is now the new branch head of A, and a topological head
+# it replaces a former topological and branch head, so this should not warn
+
+glog of local:
+
+  $ hg glog --template "{rev}: {branches} {desc}\n"
+  @  3: A a2
+  |
+  o  2: A a1
+  |
+  | o  1: B b
+  |/
+  o  0: A a
+  
+glog of remote:
+
+  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
+  @  3: B b1
+  |
+  | o  2: A a1
+  | |
+  o |  1: B b
+  |/
+  o  0: A a
+  
+outgoing:
+
+  $ hg out inner --template "{rev}: {branches} {desc}\n"
+  comparing with inner
+  searching for changes
+  3: A a2
+
+  $ hg push inner
+  pushing to inner
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+  $ cd ..
+
+
+Check prepush with new branch head and new child of former branch head
+but child is on different branch:
+
+  $ hg init p
+  $ cd p
+  $ hg branch A
+  marked working directory as branch A
+  $ echo a0 >a
+  $ hg ci -Ama0
+  adding a
+  $ echo a1 >a
+  $ hg ci -ma1
+  $ hg up null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch B
+  marked working directory as branch B
+  $ echo b0 >b
+  $ hg ci -Amb0
+  adding b
+  $ echo b1 >b
+  $ hg ci -mb1
+
+  $ hg clone . inner
+  updating to branch B
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg up A
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch -f B
+  marked working directory as branch B
+  $ echo a3 >a
+  $ hg ci -ma3
+  created new head
+  $ hg up 3
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch -f A
+  marked working directory as branch A
+  $ echo b3 >b
+  $ hg ci -mb3
+  created new head
+
+glog of local:
+
+  $ hg glog --template "{rev}: {branches} {desc}\n"
+  @  5: A b3
+  |
+  | o  4: B a3
+  | |
+  o |  3: B b1
+  | |
+  o |  2: B b0
+   /
+  o  1: A a1
+  |
+  o  0: A a0
+  
+glog of remote:
+
+  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
+  @  3: B b1
+  |
+  o  2: B b0
+  
+  o  1: A a1
+  |
+  o  0: A a0
+  
+outgoing:
+
+  $ hg out inner --template "{rev}: {branches} {desc}\n"
+  comparing with inner
+  searching for changes
+  4: B a3
+  5: A b3
+
+  $ hg push inner
+  pushing to inner
+  searching for changes
+  abort: push creates new remote heads on branch 'A'!
+  (did you forget to merge? use push -f to force)
+
+  $ hg push inner -r4 -r5
+  pushing to inner
+  searching for changes
+  abort: push creates new remote heads on branch 'A'!
+  (did you forget to merge? use push -f to force)
+
+  $ hg in inner
+  comparing with inner
+  searching for changes
+  no changes found
+
+  $ cd ..
+
--- a/tests/test-race	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg add a
-hg commit -m test
-
-# do we ever miss a sub-second change?
-for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
-    hg co -qC 0
-    echo b > a
-    hg st
-done
--- a/tests/test-race.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
--- a/tests/test-rename-after-merge	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-# Test issue 746: renaming files brought by the
-# second parent of a merge was broken.
-
-echo % create source repository
-hg init t
-cd t
-echo a > a
-hg ci -Am a
-cd ..
-
-echo % fork source repository
-hg clone t t2
-cd t2
-echo b > b
-hg ci -Am b
-
-echo % update source repository
-cd ../t
-echo a >> a
-hg ci -m a2
-
-echo % merge repositories
-hg pull ../t2
-hg merge
-hg st
-
-echo % rename b as c
-hg mv b c
-hg st
-echo % rename back c as b
-hg mv c b
-hg st
-cd ..
-
-# Test issue 1476: renaming a first parent file into
-# another first parent file while none of them belong to
-# the second parent was broken
-echo % test issue 1476
-hg init repo1476
-cd repo1476
-echo a > a
-hg ci -Am adda
-echo b1 > b1
-echo b2 > b2
-hg ci -Am changea
-hg up -C 0
-echo c1 > c1
-echo c2 > c2
-hg ci -Am addcandd
-echo % merge heads
-hg merge
-hg mv -Af c1 c2
-echo % commit issue 1476
-hg ci -m merge
-hg log -r tip -C -v | grep copies
-hg rollback
-hg up -C .
-echo % merge heads again
-hg merge
-hg mv -Af b1 b2
-echo % commit issue 1476 with a rename on the other side
-hg ci -m merge
-hg log -r tip -C -v | grep copies
-
-
-
--- a/tests/test-rename-after-merge.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-% create source repository
-adding a
-% fork source repository
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-% update source repository
-% merge repositories
-pulling from ../t2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M b
-% rename b as c
-A c
-R b
-% rename back c as b
-M b
-% test issue 1476
-adding a
-adding b1
-adding b2
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-adding c1
-adding c2
-created new head
-% merge heads
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% commit issue 1476
-copies:      c2 (c1)
-rolling back to revision 2 (undo commit)
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-% merge heads again
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% commit issue 1476 with a rename on the other side
-copies:      b2 (b1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-after-merge.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,120 @@
+# Test issue 746: renaming files brought by the
+# second parent of a merge was broken.
+
+Create source repository:
+
+  $ hg init t
+  $ cd t
+  $ echo a > a
+  $ hg ci -Am a
+  adding a
+  $ cd ..
+
+Fork source repository:
+
+  $ hg clone t t2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd t2
+  $ echo b > b
+  $ hg ci -Am b
+  adding b
+
+Update source repository:
+
+  $ cd ../t
+  $ echo a >> a
+  $ hg ci -m a2
+
+Merge repositories:
+
+  $ hg pull ../t2
+  pulling from ../t2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg st
+  M b
+
+Rename b as c:
+
+  $ hg mv b c
+  $ hg st
+  A c
+  R b
+
+Rename back c as b:
+
+  $ hg mv c b
+  $ hg st
+  M b
+
+  $ cd ..
+
+# Test issue 1476: renaming a first parent file into
+# another first parent file while none of them belong to
+# the second parent was broken
+
+  $ hg init repo1476
+  $ cd repo1476
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo b1 > b1
+  $ echo b2 > b2
+  $ hg ci -Am changea
+  adding b1
+  adding b2
+  $ hg up -C 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo c1 > c1
+  $ echo c2 > c2
+  $ hg ci -Am addcandd
+  adding c1
+  adding c2
+  created new head
+
+Merge heads:
+
+  $ hg merge
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg mv -Af c1 c2
+
+Commit issue 1476:
+
+  $ hg ci -m merge
+
+  $ hg log -r tip -C -v | grep copies
+  copies:      c2 (c1)
+
+  $ hg rollback
+  rolling back to revision 2 (undo commit)
+
+  $ hg up -C .
+  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+Merge heads again:
+
+  $ hg merge
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg mv -Af b1 b2
+
+Commit issue 1476 with a rename on the other side:
+
+  $ hg ci -m merge
+
+  $ hg log -r tip -C -v | grep copies
+  copies:      b2 (b1)
+
--- a/tests/test-simple-update	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-set -e
-
-mkdir test
-cd test
-echo foo>foo
-hg init
-hg addremove
-hg commit -m "1"
-hg verify
-
-hg clone . ../branch
-cd ../branch
-hg co
-echo bar>>foo
-hg commit -m "2"
-
-cd ../test
-hg pull ../branch
-hg verify
-hg co
-cat foo
-hg manifest --debug
--- a/tests/test-simple-update.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../branch
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-bar
-6f4310b00b9a147241b071a60c28a650827fb03d 644   foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-simple-update.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,54 @@
+  $ set -e
+
+  $ mkdir test
+  $ cd test
+  $ echo foo>foo
+  $ hg init
+  $ hg addremove
+  adding foo
+  $ hg commit -m "1"
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg clone . ../branch
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../branch
+  $ hg co
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo bar>>foo
+  $ hg commit -m "2"
+
+  $ cd ../test
+
+  $ hg pull ../branch
+  pulling from ../branch
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+
+  $ hg co
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cat foo
+  foo
+  bar
+
+  $ hg manifest --debug
+  6f4310b00b9a147241b071a60c28a650827fb03d 644   foo
+
--- a/tests/test-unrelated-pull	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-mkdir a
-cd a
-hg init
-echo 123 > a
-hg add a
-hg commit -m "a" -u a
-
-cd ..
-mkdir b
-cd b
-hg init
-echo 321 > b
-hg add b
-hg commit -m "b" -u b
-
-hg pull ../a
-hg pull -f ../a
-hg heads
--- a/tests/test-unrelated-pull.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-pulling from ../a
-searching for changes
-abort: repository is unrelated
-pulling from ../a
-searching for changes
-warning: repository is unrelated
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-changeset:   1:9a79c33a9db3
-tag:         tip
-parent:      -1:000000000000
-user:        a
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-changeset:   0:01f8062b2de5
-user:        b
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-unrelated-pull.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,43 @@
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo 123 > a
+  $ hg add a
+  $ hg commit -m "a" -u a
+
+  $ cd ..
+  $ mkdir b
+  $ cd b
+  $ hg init
+  $ echo 321 > b
+  $ hg add b
+  $ hg commit -m "b" -u b
+
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: repository is unrelated
+
+  $ hg pull -f ../a
+  pulling from ../a
+  searching for changes
+  warning: repository is unrelated
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg heads
+  changeset:   1:9a79c33a9db3
+  tag:         tip
+  parent:      -1:000000000000
+  user:        a
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  changeset:   0:01f8062b2de5
+  user:        b
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
--- a/tests/test-up-issue1456	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-rm -rf a
-hg init a
-cd a
-
-echo foo > foo
-hg ci -qAm0
-chmod +x foo
-hg ci -m1
-hg co -q 0
-echo dirty > foo
-hg up -c
-hg up -q
-cat foo
-hg st -A
-
-echo '% validate update of standalone execute bit change'
-hg up -C 0
-chmod -x foo
-hg ci -m removeexec
-hg up -C 0
-hg up
-hg st
--- a/tests/test-up-issue1456.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-abort: uncommitted local changes
-dirty
-M foo
-% validate update of standalone execute bit change
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-nothing changed
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-update-branches	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-# Construct the following history tree:
-#
-# @  5:e1bb631146ca  b1
-# |
-# o  4:a4fdb3b883c4 0:b608b9236435  b1
-# |
-# | o  3:4b57d2520816 1:44592833ba9f
-# | |
-# | | o  2:063f31070f65
-# | |/
-# | o  1:44592833ba9f
-# |/
-# o  0:b608b9236435
-
-hg init
-echo foo > foo
-echo zero > a
-hg ci -qAm0
-echo one > a ; hg ci -m1
-echo two > a ; hg ci -m2
-hg up -q 1
-echo three > a ; hg ci -qm3
-hg up -q 0
-hg branch -q b1
-echo four > a ; hg ci -qm4
-echo five > a ; hg ci -qm5
-
-echo % initial repo state
-echo
-hg --config 'extensions.graphlog=' \
-    glog --template '{rev}:{node|short} {parents} {branches}\n'
-
-# Test helper functions.
-
-revtest () {
-    msg=$1
-    dirtyflag=$2   # 'clean' or 'dirty'
-    startrev=$3
-    targetrev=$4
-    opt=$5
-    echo % revtest $msg $startrev $targetrev
-    hg up -qC $startrev
-    test $dirtyflag = dirty && echo dirty > foo
-    hg up $opt $targetrev
-    hg parent --template 'parent={rev}\n'
-    hg stat
-}    
-
-norevtest () {
-    msg=$1
-    dirtyflag=$2   # 'clean' or 'dirty'
-    startrev=$3
-    opt=$4
-    echo % norevtest $msg $startrev
-    hg up -qC $startrev
-    test $dirtyflag = dirty && echo dirty > foo
-    hg up $opt
-    hg parent --template 'parent={rev}\n'
-    hg stat
-}    
-
-# Test cases are documented in a table in the update function of merge.py.
-# Cases are run as shown in that table, row by row.
-
-norevtest 'none clean linear' clean 4
-norevtest 'none clean same'   clean 2
-
-revtest 'none clean linear' clean 1 2
-revtest 'none clean same'   clean 2 3
-revtest 'none clean cross'  clean 3 4
-
-revtest 'none dirty linear' dirty 1 2
-revtest 'none dirty same'   dirty 2 3
-revtest 'none dirty cross'  dirty 3 4
-
-revtest '-C dirty linear'   dirty 1 2 -C
-revtest '-c dirty linear'   dirty 1 2 -c
-norevtest '-c clean same'   clean 2 -c
-revtest '-cC dirty linear'  dirty 1 2 -cC
--- a/tests/test-update-branches.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-% initial repo state
-
-@  5:e1bb631146ca  b1
-|
-o  4:a4fdb3b883c4 0:b608b9236435  b1
-|
-| o  3:4b57d2520816 1:44592833ba9f
-| |
-| | o  2:063f31070f65
-| |/
-| o  1:44592833ba9f
-|/
-o  0:b608b9236435
-
-% norevtest none clean linear 4
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=5
-% norevtest none clean same 2
-abort: crosses branches (use 'hg merge' or use 'hg update -c')
-parent=2
-% revtest none clean linear 1 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=2
-% revtest none clean same 2 3
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=3
-% revtest none clean cross 3 4
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=4
-% revtest none dirty linear 1 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=2
-M foo
-% revtest none dirty same 2 3
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-parent=2
-M foo
-% revtest none dirty cross 3 4
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-parent=3
-M foo
-% revtest -C dirty linear 1 2
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=2
-% revtest -c dirty linear 1 2
-abort: uncommitted local changes
-parent=1
-M foo
-% norevtest -c clean same 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=3
-% revtest -cC dirty linear 1 2
-abort: cannot specify both -c/--check and -C/--clean
-parent=1
-M foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-branches.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,130 @@
+# Construct the following history tree:
+#
+# @  5:e1bb631146ca  b1
+# |
+# o  4:a4fdb3b883c4 0:b608b9236435  b1
+# |
+# | o  3:4b57d2520816 1:44592833ba9f
+# | |
+# | | o  2:063f31070f65
+# | |/
+# | o  1:44592833ba9f
+# |/
+# o  0:b608b9236435
+
+  $ hg init
+  $ echo foo > foo
+  $ echo zero > a
+  $ hg ci -qAm0
+  $ echo one > a ; hg ci -m1
+  $ echo two > a ; hg ci -m2
+  $ hg up -q 1
+  $ echo three > a ; hg ci -qm3
+  $ hg up -q 0
+  $ hg branch -q b1
+  $ echo four > a ; hg ci -qm4
+  $ echo five > a ; hg ci -qm5
+
+Initial repo state:
+
+  $ hg --config 'extensions.graphlog=' \
+  >    glog --template '{rev}:{node|short} {parents} {branches}\n'
+  @  5:e1bb631146ca  b1
+  |
+  o  4:a4fdb3b883c4 0:b608b9236435  b1
+  |
+  | o  3:4b57d2520816 1:44592833ba9f
+  | |
+  | | o  2:063f31070f65
+  | |/
+  | o  1:44592833ba9f
+  |/
+  o  0:b608b9236435
+  
+
+Test helper functions:
+
+  $ revtest () {
+  >     msg=$1
+  >     dirtyflag=$2   # 'clean' or 'dirty'
+  >     startrev=$3
+  >     targetrev=$4
+  >     opt=$5
+  >     hg up -qC $startrev
+  >     test $dirtyflag = dirty && echo dirty > foo
+  >     hg up $opt $targetrev
+  >     hg parent --template 'parent={rev}\n'
+  >     hg stat
+  > }    
+
+  $ norevtest () {
+  >     msg=$1
+  >     dirtyflag=$2   # 'clean' or 'dirty'
+  >     startrev=$3
+  >     opt=$4
+  >     hg up -qC $startrev
+  >     test $dirtyflag = dirty && echo dirty > foo
+  >     hg up $opt
+  >     hg parent --template 'parent={rev}\n'
+  >     hg stat
+  > }    
+
+# Test cases are documented in a table in the update function of merge.py.
+# Cases are run as shown in that table, row by row.
+
+  $ norevtest 'none clean linear' clean 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=5
+
+  $ norevtest 'none clean same'   clean 2
+  abort: crosses branches (use 'hg merge' or use 'hg update -c')
+  parent=2
+
+
+  $ revtest 'none clean linear' clean 1 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=2
+
+  $ revtest 'none clean same'   clean 2 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=3
+
+  $ revtest 'none clean cross'  clean 3 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=4
+
+
+  $ revtest 'none dirty linear' dirty 1 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=2
+  M foo
+
+  $ revtest 'none dirty same'   dirty 2 3
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  parent=2
+  M foo
+
+  $ revtest 'none dirty cross'  dirty 3 4
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  parent=3
+  M foo
+
+
+  $ revtest '-C dirty linear'   dirty 1 2 -C
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=2
+
+  $ revtest '-c dirty linear'   dirty 1 2 -c
+  abort: uncommitted local changes
+  parent=1
+  M foo
+
+  $ norevtest '-c clean same'   clean 2 -c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=3
+
+  $ revtest '-cC dirty linear'  dirty 1 2 -cC
+  abort: cannot specify both -c/--check and -C/--clean
+  parent=1
+  M foo
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-issue1456.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,31 @@
+  $ rm -rf a
+  $ hg init a
+  $ cd a
+
+  $ echo foo > foo
+  $ hg ci -qAm0
+  $ chmod +x foo
+  $ hg ci -m1
+  $ hg co -q 0
+  $ echo dirty > foo
+  $ hg up -c
+  abort: uncommitted local changes
+  $ hg up -q
+  $ cat foo
+  dirty
+  $ hg st -A
+  M foo
+
+Validate update of standalone execute bit change:
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ chmod -x foo
+  $ hg ci -m removeexec
+  nothing changed
+  $ hg up -C 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg up
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg st
+
--- a/tests/test-update-reverse	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-hg init
-touch a
-hg add a
-hg commit -m "Added a"
-
-touch main
-hg add main
-hg commit -m "Added main"
-hg checkout 0
-
-echo Main should be gone
-ls
-
-touch side1
-hg add side1
-hg commit -m "Added side1"
-touch side2
-hg add side2
-hg commit -m "Added side2"
-
-hg log
-
-echo Should have two heads, side2 and main
-hg heads
-
-echo Should show "a side1 side2"
-ls
-
-hg update --debug -C 1
-echo Should only show "a main"
-ls
-
--- a/tests/test-update-reverse.out	Mon Sep 13 16:25:13 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Main should be gone
-a
-created new head
-changeset:   3:91ebc10ed028
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added side2
-
-changeset:   2:b932d7dbb1e1
-parent:      0:c2eda428b523
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added side1
-
-changeset:   1:71a760306caf
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added main
-
-changeset:   0:c2eda428b523
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added a
-
-Should have two heads, side2 and main
-changeset:   3:91ebc10ed028
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added side2
-
-changeset:   1:71a760306caf
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added main
-
-Should show a side1 side2
-a
-side1
-side2
-resolving manifests
- overwrite True partial False
- ancestor 91ebc10ed028+ local 91ebc10ed028+ remote 71a760306caf
- side2: other deleted -> r
- side1: other deleted -> r
- main: remote created -> g
-updating: side1 1/3 files (33.33%)
-removing side1
-updating: side2 2/3 files (66.67%)
-removing side2
-updating: main 3/3 files (100.00%)
-getting main
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-Should only show a main
-a
-main
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-reverse.t	Tue Sep 14 12:20:51 2010 +0200
@@ -0,0 +1,85 @@
+  $ hg init
+
+  $ touch a
+  $ hg add a
+  $ hg commit -m "Added a"
+
+  $ touch main
+  $ hg add main
+  $ hg commit -m "Added main"
+  $ hg checkout 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+'main' should be gone:
+
+  $ ls
+  a
+
+  $ touch side1
+  $ hg add side1
+  $ hg commit -m "Added side1"
+  created new head
+  $ touch side2
+  $ hg add side2
+  $ hg commit -m "Added side2"
+
+  $ hg log
+  changeset:   3:91ebc10ed028
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added side2
+  
+  changeset:   2:b932d7dbb1e1
+  parent:      0:c2eda428b523
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added side1
+  
+  changeset:   1:71a760306caf
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added main
+  
+  changeset:   0:c2eda428b523
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added a
+  
+
+  $ hg heads
+  changeset:   3:91ebc10ed028
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added side2
+  
+  changeset:   1:71a760306caf
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added main
+  
+  $ ls
+  a
+  side1
+  side2
+
+  $ hg update --debug -C 1
+  resolving manifests
+   overwrite True partial False
+   ancestor 91ebc10ed028+ local 91ebc10ed028+ remote 71a760306caf
+   side2: other deleted -> r
+   side1: other deleted -> r
+   main: remote created -> g
+  updating: side1 1/3 files (33.33%)
+  removing side1
+  updating: side2 2/3 files (66.67%)
+  removing side2
+  updating: main 3/3 files (100.00%)
+  getting main
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ ls
+  a
+  main
+