rollback: write dirstate branch with correct encoding stable
authorSune Foldager <cryo@cyanite.org>
Wed, 15 Aug 2012 12:04:50 +0200
branchstable
changeset 17360 935831597e16
parent 17353 bde1185f406c
child 17361 5e276d1d504a
child 17362 bd867a9ca510
child 17373 4cbb1137941d
rollback: write dirstate branch with correct encoding
mercurial/localrepo.py
tests/test-encoding.t
--- a/mercurial/localrepo.py	Thu Aug 02 19:10:45 2012 +0400
+++ b/mercurial/localrepo.py	Wed Aug 15 12:04:50 2012 +0200
@@ -1009,7 +1009,7 @@
             util.rename(self.join('undo.dirstate'), self.join('dirstate'))
             try:
                 branch = self.opener.read('undo.branch')
-                self.dirstate.setbranch(branch)
+                self.dirstate.setbranch(encoding.tolocal(branch))
             except IOError:
                 ui.warn(_('named branch could not be reset: '
                           'current branch is still \'%s\'\n')
--- a/tests/test-encoding.t	Thu Aug 02 19:10:45 2012 +0400
+++ b/tests/test-encoding.t	Wed Aug 15 12:04:50 2012 +0200
@@ -44,6 +44,10 @@
   marked working directory as branch \xe9 (esc)
   (branches are permanent and global, did you want a bookmark?)
   $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
+  $ hg -q rollback
+  $ HGENCODING=latin-1 hg branch
+  \xe9 (esc)
+  $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
   $ rm .hg/branch
 
 hg log (ascii)