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.
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -412,17 +412,17 @@ def current_firefox_checkout(check_outpu
path = os.getcwd()
while path:
hg_dir = os.path.join(path, '.hg')
git_dir = os.path.join(path, '.git')
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
# repos. So keep traversing the parents.
except subprocess.CalledProcessError:
pass
# TODO check git remotes or `git rev-parse -q --verify $sha1^{commit}`
--- a/python/mozlint/mozlint/vcs.py
+++ b/python/mozlint/mozlint/vcs.py
@@ -44,17 +44,17 @@ class VCSFiles(object):
return self.vcs == 'git'
def _run(self, cmd):
files = subprocess.check_output(cmd).split()
return [os.path.join(self.root, f) for f in files]
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 []
def by_workdir(self):
if self.is_hg:
return self._run(['hg', 'status', '-amn'])
elif self.is_git: