Bug 515792 - use hg parent, as few times as possible, rather than lots of hg identify, r=ted.mielczarek
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Sun, 20 Dec 2009 15:25:48 +0100
changeset 36483 fec4a5e4b36e8adea7b962a69a26216a6441ce05
parent 36482 64be8519582c98998f0cc1e6ee4c7ffaac5cc251
child 36484 34386757d7492b05aa738774612047a87cd1ea55
push idunknown
push userunknown
push dateunknown
reviewersted
bugs515792
milestone1.9.3a1pre
Bug 515792 - use hg parent, as few times as possible, rather than lots of hg identify, r=ted.mielczarek
Makefile.in
browser/app/Makefile.in
toolkit/content/Makefile.in
toolkit/xre/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -197,16 +197,19 @@ ifdef MOZ_CRASHREPORTER
 endif
 
 ifneq (,$(wildcard $(DIST)/bin/application.ini))
 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
 else
 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
 endif
 
+MOZ_SOURCE_STAMP = $(shell hg -R $(srcdir) parent --template="{node|short}\n" 2>/dev/null)
+export MOZ_SOURCE_STAMP
+
 #XXX: this is a hack, since we don't want to clobber for MSVC
 # PGO support, but we can't do this test in client.mk
 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
 # No point in clobbering if PGO has been explicitly disabled.
 ifndef NO_PROFILE_GUIDED_OPTIMIZE
 maybe_clobber_profiledbuild: clean
 else
 maybe_clobber_profiledbuild:
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -64,19 +64,19 @@ DEFINES += -DAPP_UA_NAME="$(APP_UA_NAME)
 
 DIST_FILES = application.ini
 
 GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
 GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
 
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
 
-SOURCE_STAMP := $(shell cd $(topsrcdir) ; hg identify . 2>/dev/null | cut -f1 -d' ')
-ifdef SOURCE_STAMP
-DEFINES += -DMOZ_SOURCE_STAMP="$(SOURCE_STAMP)"
+MOZ_SOURCE_STAMP ?= $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null)
+ifdef MOZ_SOURCE_STAMP
+DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
 SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
 
 LIBS += $(JEMALLOC_LIBS)
--- a/toolkit/content/Makefile.in
+++ b/toolkit/content/Makefile.in
@@ -53,19 +53,19 @@ DEFINES += \
   -DCC_VERSION="$(CC_VERSION)" \
   -DCFLAGS="$(CFLAGS)" \
   -DCXX="$(CXX)" \
   -DCXX_VERSION="$(CXX_VERSION)" \
   -DCXXFLAGS="$(CXXFLAGS)" \
   -DCPPFLAGS="$(CPPFLAGS)" \
   $(NULL)
 
-CHANGESET := $(shell cd $(topsrcdir) && hg identify . 2>/dev/null | cut -f1 -d' ')
-ifdef CHANGESET
-DEFINES += -DSOURCE_CHANGESET="$(CHANGESET)"
+MOZ_SOURCE_STAMP ?= $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null)
+ifdef MOZ_SOURCE_STAMP
+DEFINES += -DSOURCE_CHANGESET="$(MOZ_SOURCE_STAMP)"
 endif
 
 # strip a trailing slash from the repo URL because it's not always present,
 # and we want to construct a working URL in buildconfig.html
 # make+shell+sed = awful
 _dollar=$$
 SOURCE_REPO := $(shell cd $(topsrcdir) && hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" )
 # extra sanity check for old versions of hg
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -216,25 +216,25 @@ DEFINES		+= -DWRAP_SYSTEM_INCLUDES
 endif
 
 ifeq ($(OS_ARCH),Linux)
 ifneq (,$(findstring lib64,$(libdir)))
 DEFINES     += -DHAVE_USR_LIB64_DIR
 endif
 endif
 
-SOURCE_STAMP := $(shell cd $(topsrcdir) && hg identify . 2>/dev/null | cut -f1 -d' ')
+MOZ_SOURCE_STAMP ?= $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null)
 # strip a trailing slash from the repo URL because it's not always present,
 # and we want to construct a working URL in buildconfig.html
 # make+shell+sed = awful
 _dollar=$$
 SOURCE_REPO := $(shell cd $(topsrcdir) && hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" )
 
-ifdef SOURCE_STAMP
-INIARGS = --sourcestamp=$(SOURCE_STAMP)
+ifdef MOZ_SOURCE_STAMP
+INIARGS = --sourcestamp=$(MOZ_SOURCE_STAMP)
 # extra sanity check for old versions of hg
 # that don't support showconfig
 ifeq (http,$(patsubst http%,http,$(SOURCE_REPO)))
 INIARGS += --sourcerepo=$(SOURCE_REPO)
 endif
 endif
 
 platform.ini: FORCE