changeset 3071:547d1a4aa105

hg merge: fix lookup of branch add some tests for branch usage
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 08 Sep 2006 02:16:16 +0200
parents 9b480509658c
children bc3fe3b5b785
files mercurial/commands.py tests/test-branch tests/test-branch.out
diffstat 3 files changed, 90 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Sep 08 01:07:21 2006 +0200
+++ b/mercurial/commands.py	Fri Sep 08 02:16:16 2006 +0200
@@ -1940,7 +1940,7 @@
     revision to merge with must be provided.
     """
 
-    if node:
+    if node or branch:
         node = _lookup(repo, node, branch)
     else:
         heads = repo.heads()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-branch	Fri Sep 08 02:16:16 2006 +0200
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# test for branch handling
+#
+# XXX: need more tests
+
+hg init
+echo a > a
+echo b > b
+hg ci -A -m 0 -d "1000000 0"
+echo aa > a
+echo bb > b
+hg ci -m 1 -d "1000000 0"
+hg tag -l foo
+hg update 0
+hg parents -b 
+
+# test update
+hg update -b foo
+hg parents
+
+# test merge
+hg update 0
+echo c > c
+hg ci -A -m 0.0 -d "1000000 0"
+hg merge -b foo
+hg parents -b 
+
+# re-test with more branches
+hg update -C 0
+echo d > d
+hg ci -A -m 0.0 -d "1000000 0"
+hg merge -b foo
+hg parents -b 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-branch.out	Fri Sep 08 02:16:16 2006 +0200
@@ -0,0 +1,55 @@
+adding a
+adding b
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+changeset:   0:b544c4ac4389
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     0
+
+Using head f4ac749470f2 for branch foo
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+changeset:   1:f4ac749470f2
+tag:         foo
+tag:         tip
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     1
+
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+adding c
+Using head f4ac749470f2 for branch foo
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+changeset:   2:1505d56ee00e
+tag:         tip
+parent:      0:b544c4ac4389
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     0.0
+
+changeset:   1:f4ac749470f2
+tag:         foo
+branch:      foo
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     1
+
+2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+adding d
+Using head f4ac749470f2 for branch foo
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+changeset:   3:53b72df12ae5
+tag:         tip
+parent:      0:b544c4ac4389
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     0.0
+
+changeset:   1:f4ac749470f2
+tag:         foo
+branch:      foo
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     1
+