Bug 1361370 - Allow overrride of MOZ_SOURCE_CHANGESET and MOZ_SOURCE_REPO. r=glandium
--- a/configure.in
+++ b/configure.in
@@ -11,19 +11,23 @@ dnl the --with-external-source-dir rules
dnl ========================================================
divert(0)dnl
#!/bin/sh
SRCDIR=$(dirname $0)
TOPSRCDIR="$SRCDIR"
MOZILLA_SRCDIR="${SRCDIR}/mozilla"
export OLD_CONFIGURE="${MOZILLA_SRCDIR}"/old-configure
-# Ensure the comm-* values are used.
-export MOZ_SOURCE_CHANGESET=$(hg -R "$TOPSRCDIR" parent --template="{node}" 2>/dev/null)
-export MOZ_SOURCE_REPO=$(hg -R "$TOPSRCDIR" showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/https:/")
+# Ensure the comm-* values are used unless overridden by environment variables.
+if test -z "$MOZ_SOURCE_CHANGESET"; then
+ export MOZ_SOURCE_CHANGESET=$(hg -R "$TOPSRCDIR" parent --template="{node}" 2>/dev/null)
+fi
+if test -z "$MOZ_SOURCE_REPO"; then
+ export MOZ_SOURCE_REPO=$(hg -R "$TOPSRCDIR" showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/https:/")
+fi
# If MOZCONFIG isn't set, use the .mozconfig from the current directory. This
# overrides the lookup in mozilla-central's configure, which looks in the wrong
# directory for this file.
if test -z "$MOZCONFIG" -a -f "$SRCDIR"/.mozconfig; then
export MOZCONFIG="$SRCDIR"/.mozconfig
elif test -z "$MOZCONFIG" -a -f "$SRCDIR"/mozconfig; then
export MOZCONFIG="$SRCDIR"/mozconfig