changeset 11299:05ac42e56452 stable

push/pull: fix bug in "--branch ." handling The branch wasn't expanded, so only the tip was operated on.
author Sune Foldager <cryo@cyanite.org>
date Mon, 07 Jun 2010 16:28:23 +0200
parents d3ebb1a0bc49
children 24eeca1f2791 deaeb2d84d8a
files mercurial/hg.py tests/test-branch-option.out
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Jun 01 18:29:52 2010 -0400
+++ b/mercurial/hg.py	Mon Jun 07 16:28:23 2010 +0200
@@ -30,13 +30,12 @@
         if branch == '.':
             if not lrepo or not lrepo.local():
                 raise util.Abort(_("dirstate branch not accessible"))
-            revs.append(lrepo.dirstate.branch())
+            branch = lrepo.dirstate.branch()
+        butf8 = encoding.fromlocal(branch)
+        if butf8 in branchmap:
+            revs.extend(node.hex(r) for r in reversed(branchmap[butf8]))
         else:
-            butf8 = encoding.fromlocal(branch)
-            if butf8 in branchmap:
-                revs.extend(node.hex(r) for r in reversed(branchmap[butf8]))
-            else:
-                revs.append(branch)
+            revs.append(branch)
     return revs, revs[0]
 
 def parseurl(url, branches=None):
--- a/tests/test-branch-option.out	Tue Jun 01 18:29:52 2010 -0400
+++ b/tests/test-branch-option.out	Mon Jun 07 16:28:23 2010 +0200
@@ -21,7 +21,9 @@
 1:dd6e60a716c6
 2:f25d57ab0566
 out branch .
+1:b84708d77ab7
 2:65511d0e2b55
+1:b84708d77ab7
 2:65511d0e2b55
 clone branch b
 requesting all changes