From c8f4173ac79691c6a2eb9fe59f755b4990227edf Mon Sep 17 00:00:00 2001 From: Raul Cuza Date: Wed, 6 Jul 2011 12:01:23 -0400 Subject: Create paranoid mode for export script. Paranoid mode does not modify the git repository, but does modify the files. This allows git-diff to be used to see what will change when run in regular mode. --- tools/export2.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tools/export2.py') diff --git a/tools/export2.py b/tools/export2.py index 0b8cc159d..17e732bf6 100755 --- a/tools/export2.py +++ b/tools/export2.py @@ -72,10 +72,17 @@ def main(argv=None): help = 'run in debun mode', default = False, dest = 'debug') + p.add_option('--paranoid', '-P', + action = 'store_true', + help = 'run in paranoid mode, make changes but do not commit to repository', + default = False, + dest = 'paranoid') options, arguments = p.parse_args() if options.debug: print options + print "What should debug mode do?" + quit() # py3k compatibility try: @@ -180,6 +187,8 @@ def main(argv=None): #FIXME: do this using python-dulwich commando = {} + commando["vcs_diff"] = "git diff" + commando["vcs_commit"] = "git commit -asm 'Version bump to %s'" % version # NOTE: This will use the default email address key. If you want to sign the tag @@ -196,7 +205,11 @@ def main(argv=None): commando["scp_archive"] = "scp %s* terra.mcs.anl.gov:/mcs/ftp/pub/bcfg/" % tarname # Execute the commands - commando_orders = ["vcs_commit","vcs_tag","create_archive","gpg_encrypt","scp_archive"] + if options.paranoid: + commando_orders = ["vcs_diff"] + else: + commando_orders = ["vcs_commit","vcs_tag","create_archive","gpg_encrypt","scp_archive"] + if options.dryrun: for cmd in commando_orders: print "*** dry-run: %s" % commando[cmd] -- cgit v1.2.3-1-g7c22