--- a/client.py
+++ b/client.py
@@ -44,29 +44,32 @@ except ImportError:
def check_call_noisy(cmd, *args, **kwargs):
print "Executing command:", cmd
check_call(cmd, *args, **kwargs)
def do_hg_pull(dir, repository, hg, rev):
fulldir = os.path.join(topsrcdir, dir)
# clone if the dir doesn't exist, pull if it does
+ hgopts = []
+ if options.hgopts:
+ hgopts = options.hgopts.split()
if not os.path.exists(fulldir):
fulldir = os.path.join(topsrcdir, dir)
- check_call_noisy([hg, 'clone', repository, fulldir])
+ check_call_noisy([hg, 'clone'] + hgopts + [repository, fulldir])
else:
- cmd = [hg, 'pull', '-R', fulldir]
+ cmd = [hg, 'pull', '-R', fulldir ] + hgopts
if repository is not None:
cmd.append(repository)
check_call_noisy(cmd)
# update to specific revision
if options.verbose:
- cmd = [hg, 'update', '-v', '-r', rev, '-R', fulldir]
+ cmd = [hg, 'update', '-v', '-r', rev, '-R', fulldir ] + hgopts
else:
- cmd = [hg, 'update', '-r', rev, '-R', fulldir]
+ cmd = [hg, 'update', '-r', rev, '-R', fulldir ] + hgopts
check_call_noisy(cmd)
check_call([hg, 'parent', '-R', fulldir,
'--template=Updated to revision {node}.\n'])
def do_cvs_checkout(modules, tag, cvsroot, cvs, checkoutdir):
"""Check out a CVS directory into the mozilla/ subdirectory.
modules is a list of directories to check out, e.g. ['extensions/irc']
"""
@@ -134,17 +137,18 @@ o.add_option("--hg", dest="hg", default=
o.add_option("--cvs", dest="cvs", default=os.environ.get('CVS', 'cvs'),
help="The location of the cvs binary")
o.add_option("--cvsroot", dest="cvsroot",
default=os.environ.get('CVSROOT', ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'),
help="The CVSROOT (default: :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot")
o.add_option("-v", "--verbose", dest="verbose",
action="store_true", default=False,
help="Enable verbose output on hg updates")
-
+o.add_option("--hg-options", dest="hgopts",
+ help="Pass arbitrary options to hg commands (i.e. --debug, --time)")
def fixup_repo_options(options):
""" Check options.comm_repo and options.mozilla_repo values;
populate mozilla_repo if needed.
options.comm_repo and options.mozilla_repo are normally None.
This is fine-- our "hg pull" commands will omit the repo URL.
The exception is the initial checkout, which does an "hg clone"