diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -176,6 +176,7 @@ def concludenode(repo, rev, p1, p2, stat 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 diff --git a/tests/test-rebase-keep-branch b/tests/test-rebase-keep-branch --- a/tests/test-rebase-keep-branch +++ b/tests/test-rebase-keep-branch @@ -28,3 +28,5 @@ echo '% Rebase a branch while preserving 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 diff --git a/tests/test-rebase-keep-branch.out b/tests/test-rebase-keep-branch.out --- a/tests/test-rebase-keep-branch.out +++ b/tests/test-rebase-keep-branch.out @@ -31,3 +31,5 @@ o 1:c2: | o 0:c1: +% dirstate branch should be "notdefault" +notdefault