# HG changeset patch # User Alexis S. L. Carvalho # Date 1166244676 7200 # Node ID 1063a631cb8e97da9e116bf5fa511d417f380b43 # Parent f9136599700f6c66a0fff654fa93442b4dc9fb12# Parent a8c0365b2ace7ef6224b6c9fa833e0ac3140ac8e merge with crew-stable diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -203,7 +203,7 @@ def nl2br(text): return text.replace('\n', '
\n') def obfuscate(text): - text = unicode(text, 'utf-8', 'replace') + text = unicode(text, util._encoding, 'replace') return ''.join(['&#%d;' % ord(c) for c in text]) def domain(author): diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -500,6 +500,9 @@ def system(cmd, environ={}, cwd=None, on oldenv[k] = os.environ.get(k) if cwd is not None: oldcwd = os.getcwd() + origcmd = cmd + if os.name == 'nt': + cmd = '"%s"' % cmd try: for k, v in environ.iteritems(): os.environ[k] = py2shell(v) @@ -507,7 +510,7 @@ def system(cmd, environ={}, cwd=None, on os.chdir(cwd) rc = os.system(cmd) if rc and onerr: - errmsg = '%s %s' % (os.path.basename(cmd.split(None, 1)[0]), + errmsg = '%s %s' % (os.path.basename(origcmd.split(None, 1)[0]), explain_exit(rc)[0]) if errprefix: errmsg = '%s: %s' % (errprefix, errmsg)