add get_repo_root function, use decode_text
@@ -33,7 +33,7 @@ class SCMBase(object):
with chdir(self.folder) if self.folder else no_op():
with environment_append({"LC_ALL": "en_US.UTF-8"}) if self._force_eng else no_op():
if not self._runner:
- return subprocess.check_output(command, shell=True).decode(errors='ignore').strip()
+ return decode_text(subprocess.check_output(command, shell=True).strip())
else:
return self._runner(command)
@@ -165,7 +165,7 @@ class SVN(SCMBase):
def __init__(self, folder=None, runner=None, *args, **kwargs):
def runner_no_strip(command):
- return subprocess.check_output(command, shell=True).decode(errors='ignore')
+ return decode_text(subprocess.check_output(command, shell=True))
runner = runner or runner_no_strip
super(SVN, self).__init__(folder=folder, runner=runner, *args, **kwargs)
@@ -221,3 +221,5 @@ class SVN(SCMBase):
def get_revision(self):
return self.run("info --show-item revision").strip()
+ def get_repo_root(self):
+ return self.run("info --show-item wc-root").strip()
