Bug 1299661 - Use hg --template flag instead of -T. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 01 Sep 2016 07:43:38 +0900
changeset 408231 ecf69f944087147488d7dc6685d95acf8e34edff
parent 407957 3d9cabea1e561a62734fa8d4ce8005696ef33f6d
child 530080 954b6a3a7e640f2fcb63b34f90744120136be7b4
push id28185
push userbmo:mh+mozilla@glandium.org
push dateWed, 31 Aug 2016 22:52:21 +0000
reviewersgps
bugs1299661
milestone51.0a1
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.
python/mozboot/mozboot/bootstrap.py
python/mozlint/mozlint/vcs.py
--- 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: