mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
merge with stable
This commit is contained in:
commit
d53510c6a2
@ -27,6 +27,8 @@ class changectx(object):
|
||||
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)
|
||||
|
@ -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 @@ def lookupreg(key, valname=None, scope=None):
|
||||
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 = '<L'
|
||||
s = ctypes.string_at(byref(buf), struct.calcsize(fmt))
|
||||
|
Loading…
Reference in New Issue
Block a user