Bug 1192068 - Use long hg revision for sourcestamp in mozharness; r=gps,jlund
authorMike Shal <mshal@mozilla.com>
Thu, 06 Aug 2015 15:39:38 -0400
changeset 257091 38f81480762d6c29047fa7d56cc9a3182152c48c
parent 257090 a119d84a94852b67da5ccdb6385a6999504a95c2
child 257092 9e01460eca0cb4b6ffb53a1ba692c27322020d8a
push id63524
push usermshal@mozilla.com
push dateMon, 10 Aug 2015 16:48:57 +0000
treeherdermozilla-inbound@38f81480762d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, jlund
bugs1192068
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1192068 - Use long hg revision for sourcestamp in mozharness; r=gps,jlund
build/Makefile.in
testing/mozharness/mozharness/base/vcs/mercurial.py
testing/mozharness/mozharness/mozilla/building/buildb2gbase.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/scripts/desktop_l10n.py
testing/mozharness/scripts/mobile_l10n.py
testing/mozharness/test/test_base_vcs_mercurial.py
toolkit/content/Makefile.in
toolkit/mozapps/installer/package-name.mk
toolkit/xre/Makefile.in
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -15,17 +15,17 @@ endif
 
 APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
 APP_INI_DEPS += $(DEPTH)/config/buildid
 
 DEFINES += -DAPP_BUILDID=$(APP_BUILDID)
 
 APP_INI_DEPS += $(DEPTH)/config/autoconf.mk
 
-MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template='{node|short}\n' 2>/dev/null))
+MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template='{node}\n' 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP='$(MOZ_SOURCE_STAMP)'
 endif
 
 ifdef MOZ_INCLUDE_SOURCE_INFO
 source_repo ?= $(call getSourceRepo,$(topsrcdir)/$(MOZ_BUILD_APP)/..)
 ifneq (,$(source_repo))
   DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)'
--- a/testing/mozharness/mozharness/base/vcs/mercurial.py
+++ b/testing/mozharness/mozharness/base/vcs/mercurial.py
@@ -94,17 +94,17 @@ class MercurialVCS(ScriptMixin, LogMixin
         if repo.startswith("/"):
             return repo.lstrip("/")
         else:
             return urlsplit(repo).path.lstrip("/")
 
     def get_revision_from_path(self, path):
         """Returns which revision directory `path` currently has checked out."""
         return self.get_output_from_command(
-            self.hg + ['parent', '--template', '{node|short}'], cwd=path
+            self.hg + ['parent', '--template', '{node}'], cwd=path
         )
 
     def get_branch_from_path(self, path):
         branch = self.get_output_from_command(self.hg + ['branch'], cwd=path)
         return str(branch).strip()
 
     def get_branches_from_path(self, path):
         branches = []
--- a/testing/mozharness/mozharness/mozilla/building/buildb2gbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildb2gbase.py
@@ -179,17 +179,17 @@ class B2GBuildBaseScript(BuildbotMixin, 
         else:
             dirs = self.query_abs_dirs()
             repo = dirs['gecko_src']
             repo_type = detect_local(repo)
             # Look at what we have checked out
             if repo_type == 'hg':
                 hg = self.query_exe('hg', return_type='list')
                 revision = self.get_output_from_command(
-                    hg + ['parent', '--template', '{node|short}'], cwd=repo
+                    hg + ['parent', '--template', '{node}'], cwd=repo
                 )
             elif repo_type == 'git':
                 git = self.query_exe('git', return_type='list')
                 revision = self.get_output_from_command(
                     git + ['rev-parse', 'HEAD'], cwd=repo
                 )
             else:
                 return None
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1131,17 +1131,17 @@ or run without that action (ie: --no-{ac
             if not source_path:
                 dirs = self.query_abs_dirs()
                 source_path = dirs['abs_src_dir']  # let's take the default
 
             # Look at what we have checked out
             if os.path.exists(source_path):
                 hg = self.query_exe('hg', return_type='list')
                 revision = self.get_output_from_command(
-                    hg + ['parent', '--template', '{node|short}'], cwd=source_path
+                    hg + ['parent', '--template', '{node}'], cwd=source_path
                 )
         return revision.encode('ascii', 'replace') if revision else None
 
     def _checkout_source(self):
         """use vcs_checkout to grab source needed for build."""
         # TODO make this method its own action
         c = self.config
         dirs = self.query_abs_dirs()
--- a/testing/mozharness/scripts/desktop_l10n.py
+++ b/testing/mozharness/scripts/desktop_l10n.py
@@ -408,17 +408,17 @@ class DesktopSingleLocale(LocalesMixin, 
         return self.buildid
 
     def _query_revision(self):
         """Get revision from the objdir.
         Only valid after setup is run.
        """
         if self.revision:
             return self.revision
-        r = re.compile(r"^(gecko|fx)_revision ([0-9a-f]{12}\+?)$")
+        r = re.compile(r"^(gecko|fx)_revision ([0-9a-f]+\+?)$")
         output = self._query_make_ident_output()
         for line in output.splitlines():
             match = r.match(line)
             if match:
                 self.revision = match.groups()[1]
         return self.revision
 
     def _query_make_variable(self, variable, make_args=None,
--- a/testing/mozharness/scripts/mobile_l10n.py
+++ b/testing/mozharness/scripts/mobile_l10n.py
@@ -200,17 +200,17 @@ class MobileSingleLocale(MockMixin, Loca
         return self.buildid
 
     def query_revision(self):
         """Get revision from the objdir.
         Only valid after setup is run.
         """
         if self.revision:
             return self.revision
-        r = re.compile(r"gecko_revision ([0-9a-f]{12}\+?)")
+        r = re.compile(r"gecko_revision ([0-9a-f]+\+?)")
         output = self._query_make_ident_output()
         for line in output.splitlines():
             m = r.match(line)
             if m:
                 self.revision = m.groups()[0]
         return self.revision
 
     def _query_make_variable(self, variable, make_args=None):
--- a/testing/mozharness/test/test_base_vcs_mercurial.py
+++ b/testing/mozharness/test/test_base_vcs_mercurial.py
@@ -9,17 +9,17 @@ import mozharness.base.vcs.mercurial as 
 
 test_string = '''foo
 bar
 baz'''
 
 HG = ['hg'] + mercurial.HG_OPTIONS
 
 # Known default .hgrc
-os.environ['HGRCPATH'] = os.path.join(os.path.dirname(__file__), 'helper_files', '.hgrc')
+os.environ['HGRCPATH'] = os.path.abspath(os.path.join(os.path.dirname(__file__), 'helper_files', '.hgrc'))
 
 
 def cleanup():
     if os.path.exists('test_logs'):
         shutil.rmtree('test_logs')
     if os.path.exists('test_dir'):
         if os.path.isdir('test_dir'):
             shutil.rmtree('test_dir')
@@ -34,17 +34,17 @@ def get_mercurial_vcs_obj():
     m = mercurial.MercurialVCS()
     m.config = {}
     return m
 
 
 def get_revisions(dest):
     m = get_mercurial_vcs_obj()
     retval = []
-    for rev in m.get_output_from_command(HG + ['log', '-R', dest, '--template', '{node|short}\n']).split('\n'):
+    for rev in m.get_output_from_command(HG + ['log', '-R', dest, '--template', '{node}\n']).split('\n'):
         rev = rev.strip()
         if not rev:
             continue
         retval.append(rev)
     return retval
 
 
 class TestMakeAbsolute(unittest.TestCase):
--- a/toolkit/content/Makefile.in
+++ b/toolkit/content/Makefile.in
@@ -6,17 +6,17 @@
 USE_RCS_MK := 1
 include $(topsrcdir)/config/makefiles/makeutils.mk
 
 DEFINES += \
   -DCXXFLAGS='$(CXXFLAGS)' \
   -DCPPFLAGS='$(CPPFLAGS)' \
   $(NULL)
 
-MOZ_SOURCE_STAMP ?= $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null)
+MOZ_SOURCE_STAMP ?= $(shell hg -R $(topsrcdir) parent --template='{node}\n' 2>/dev/null)
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DSOURCE_CHANGESET='$(MOZ_SOURCE_STAMP)'
 endif
 
 ifdef MOZ_INCLUDE_SOURCE_INFO
 source_repo ?= $(call getSourceRepo)
 ifneq (,$(filter http%,$(source_repo)))
   DEFINES += -DSOURCE_REPO='$(source_repo)'
--- a/toolkit/mozapps/installer/package-name.mk
+++ b/toolkit/mozapps/installer/package-name.mk
@@ -142,17 +142,17 @@ else
 BUILDID = $(shell $(PYTHON) $(MOZILLA_DIR)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
 endif
 
 ifndef INCLUDED_RCS_MK
   USE_RCS_MK := 1
   include $(MOZILLA_DIR)/config/makefiles/makeutils.mk
 endif
 
-MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(MOZILLA_DIR) parent --template="{node|short}\n" 2>/dev/null))
+MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(MOZILLA_DIR) parent --template="{node}\n" 2>/dev/null))
 
 ###########################################################################
 # bug: 746277 - preserve existing functionality.
 # MOZILLA_DIR="": cd $(SPACE); hg # succeeds if ~/.hg exists
 ###########################################################################
 ifdef MOZ_INCLUDE_SOURCE_INFO
 MOZ_SOURCE_REPO = $(call getSourceRepo,$(MOZILLA_DIR)$(NULL) $(NULL))
 endif
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -14,17 +14,17 @@ include $(topsrcdir)/config/rules.mk
 
 # Should version be optional or required ?
 TOOLKIT_EM_VERSION=$(shell $(PYTHON) $(topsrcdir)/python/mozbuild/mozbuild/milestone.py --topsrcdir=$(topsrcdir))
 $(call warnIfEmpty,TOOLKIT_EM_VERSION)
 
 # Valid if null: {warn,error}IfEmpty
 DEFINES += -DTOOLKIT_EM_VERSION='"$(TOOLKIT_EM_VERSION)"'
 
-MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null))
+MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node}\n' 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 
   INIARGS = --sourcestamp=$(MOZ_SOURCE_STAMP)
 
   ifdef MOZ_INCLUDE_SOURCE_INFO
     source_repo := $(call getSourceRepo)
 
     # extra sanity check for old versions of hg, no showconfig support