Bug 1299661 - Use hg --template flag instead of -T. r=gps

Versions of mercurial older than 3.0 don't support the -T shorthand for
the --template option. While most people should be using something
newer, it can still happen that some run an older version, and it's
still trivial to support them by using the long option.

--HG--
extra : rebase_source : 1507aea436779495045df48b044a58f4af1382be
This commit is contained in:
Mike Hommey 2016-09-01 07:43:38 +09:00
Родитель 31bcff5fe1
Коммит 411867285a
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -417,7 +417,7 @@ def current_firefox_checkout(check_output, hg=None):
if hg and os.path.exists(hg_dir):
# Verify the hg repo is a Firefox repo by looking at rev 0.
try:
node = check_output([hg, 'log', '-r', '0', '-T', '{node}'], cwd=path)
node = check_output([hg, 'log', '-r', '0', '--template', '{node}'], cwd=path)
if node in HG_ROOT_REVISIONS:
return 'hg'
# Else the root revision is different. There could be nested

Просмотреть файл

@ -49,7 +49,7 @@ class VCSFiles(object):
def by_rev(self, rev):
if self.is_hg:
return self._run(['hg', 'log', '-T', '{files % "\\n{file}"}', '-r', rev])
return self._run(['hg', 'log', '--template', '{files % "\\n{file}"}', '-r', rev])
elif self.is_git:
return self._run(['git', 'diff', '--name-only', rev])
return []