mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 14:34:34 +03:00
convert: do not try to re-encode in python3
Summary: The encoding is utf-8 already. Reviewed By: sfilipco Differential Revision: D20966808 fbshipit-source-id: ade012588bf14df07772db0819be8670ecdb3b09
This commit is contained in:
parent
aa836d38ea
commit
cdb0fbdb71
@ -14,6 +14,7 @@ from __future__ import absolute_import
|
||||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from edenscm.hgext.convert.repo import repo_source
|
||||
from edenscm.mercurial import encoding, error, hg, progress, pycompat, scmutil, util
|
||||
@ -39,10 +40,13 @@ orig_encoding = "ascii"
|
||||
|
||||
|
||||
def recode(s):
|
||||
if isinstance(s, pycompat.unicode):
|
||||
return s.encode(orig_encoding, "replace")
|
||||
if sys.version_info[0] < 3:
|
||||
if isinstance(s, pycompat.unicode):
|
||||
return s.encode(orig_encoding, "replace")
|
||||
else:
|
||||
return s.decode("utf-8").encode(orig_encoding, "replace")
|
||||
else:
|
||||
return s.decode("utf-8").encode(orig_encoding, "replace")
|
||||
return s
|
||||
|
||||
|
||||
def mapbranch(branch, branchmap):
|
||||
|
@ -9,9 +9,6 @@ from __future__ import absolute_import
|
||||
from testutil.dott import feature, sh, testtmp # noqa: F401
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
|
||||
|
||||
sh % ". helpers-usechg.sh"
|
||||
|
||||
sh % "cat" << r"""
|
||||
|
@ -9,9 +9,6 @@ from __future__ import absolute_import
|
||||
from testutil.dott import feature, sh, testtmp # noqa: F401
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
|
||||
|
||||
sh % ". helpers-usechg.sh"
|
||||
|
||||
sh % "setconfig 'ui.allowemptycommit=1'"
|
||||
|
@ -1,4 +1,3 @@
|
||||
#require py2
|
||||
#chg-compatible
|
||||
#require execbit
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
#require py2
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
|
@ -1,4 +1,3 @@
|
||||
#require py2
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
|
@ -8,9 +8,6 @@ from __future__ import absolute_import
|
||||
from testutil.dott import feature, sh, testtmp # noqa: F401
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
|
||||
|
||||
sh % "setconfig 'extensions.treemanifest=!'"
|
||||
# Set up extension and repos
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user