changeset 14559:e29821ca94cf

bookmarks: recognize the current bookmark when the local encoding isn't UTF-8 The current bookmark is stored in bookmark.current, supposingly in UTF-8. But the call to encoding.fromlocal() is missing, therefore Hg is not able to recognize the current bookmark in the case that bookmark uses characters of which the bit stream is different between local encoding and UTF-8. For example, the Chinese version of Windows cmd uses gbk(cp936), not UTF-8. Therefore I won't be able to make a Chinese bookmark current. By wrapping mark in a encoding.fromlocal() call, the problem is solved.
author LUO Zheng <xmuluo@gmail.com>
date Wed, 08 Jun 2011 21:25:18 +0800
parents 2ce7dfe17bc5
children 0980239cb20c
files mercurial/bookmarks.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Thu Jun 09 10:15:24 2011 +1000
+++ b/mercurial/bookmarks.py	Wed Jun 08 21:25:18 2011 +0800
@@ -114,7 +114,7 @@
     wlock = repo.wlock()
     try:
         file = repo.opener('bookmarks.current', 'w', atomictemp=True)
-        file.write(mark)
+        file.write(encoding.fromlocal(mark))
         file.rename()
     finally:
         wlock.release()