# HG changeset patch # User Matt Mackall # Date 1337636127 18000 # Node ID 07741a5d6608dcd606696473f8e23a26467a2380 # Parent 9a8ab5c47f844ef65bf78e9da9b7db93fe5b3399# Parent ac89a23ca814340e714101bd65c96c1e2877354b merge with stable diff -r 9a8ab5c47f84 -r 07741a5d6608 mercurial/context.py --- a/mercurial/context.py Sun May 20 01:28:31 2012 +0200 +++ b/mercurial/context.py Mon May 21 16:35:27 2012 -0500 @@ -27,6 +27,8 @@ self._rev = changeid self._node = repo.changelog.node(changeid) return + if isinstance(changeid, long): + changeid = str(changeid) if changeid == '.': self._node = repo.dirstate.p1() self._rev = repo.changelog.rev(self._node) diff -r 9a8ab5c47f84 -r 07741a5d6608 mercurial/win32.py --- a/mercurial/win32.py Sun May 20 01:28:31 2012 +0200 +++ b/mercurial/win32.py Mon May 21 16:35:27 2012 -0500 @@ -5,7 +5,6 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -import encoding import ctypes, errno, os, struct, subprocess, random _kernel32 = ctypes.windll.kernel32 @@ -290,8 +289,8 @@ if res != _ERROR_SUCCESS: continue if type.value == _REG_SZ: - # never let a Unicode string escape into the wild - return encoding.tolocal(buf.value.encode('UTF-8')) + # string is in ANSI code page, aka local encoding + return buf.value elif type.value == _REG_DWORD: fmt = '