rebase: fix bug where --keepbranches could leave wrong branch in dirstate
authorPatrick Mezard <pmezard@gmail.com>
Fri, 01 May 2009 12:26:37 +0200
changeset 8266 609ce91670d0
parent 8255 ea82a23cf887
child 8267 faa318261ee8
child 8270 3477ad0b1f2c
rebase: fix bug where --keepbranches could leave wrong branch in dirstate Report and original fix by Augie Fackler <durin42@gmail.com>
hgext/rebase.py
tests/test-rebase-keep-branch
tests/test-rebase-keep-branch.out
--- a/hgext/rebase.py	Wed Apr 29 09:30:28 2009 +0200
+++ b/hgext/rebase.py	Fri May 01 12:26:37 2009 +0200
@@ -172,6 +172,7 @@
                             user=repo[rev].user(),
                             date=repo[rev].date(),
                             extra=extra)
+        repo.dirstate.setbranch(repo[newrev].branch())
         return newrev
     except util.Abort:
         # Invalidate the previous setparents
--- a/tests/test-rebase-keep-branch	Wed Apr 29 09:30:28 2009 +0200
+++ b/tests/test-rebase-keep-branch	Fri May 01 12:26:37 2009 +0200
@@ -28,3 +28,5 @@
 hg update -C 3
 hg rebase -b 4 -d 3 --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
 hg glog --template '{rev}:{desc}:{branches}\n'
+echo '% dirstate branch should be "notdefault"'
+hg branch
--- a/tests/test-rebase-keep-branch.out	Wed Apr 29 09:30:28 2009 +0200
+++ b/tests/test-rebase-keep-branch.out	Fri May 01 12:26:37 2009 +0200
@@ -31,3 +31,5 @@
 |
 o  0:c1:
 
+% dirstate branch should be "notdefault"
+notdefault