diff options
author | Raul Cuza <raulcuza@gmail.com> | 2011-07-06 12:01:23 -0400 |
---|---|---|
committer | Raul Cuza <raulcuza@gmail.com> | 2011-07-06 13:38:00 -0400 |
commit | c8f4173ac79691c6a2eb9fe59f755b4990227edf (patch) | |
tree | ec1e7059b4381633e883d412fffed7b1cd4ea6b7 | |
parent | 6c4f30ab28d8200239350242b545c1021cb084d5 (diff) | |
download | bcfg2-c8f4173ac79691c6a2eb9fe59f755b4990227edf.tar.gz bcfg2-c8f4173ac79691c6a2eb9fe59f755b4990227edf.tar.bz2 bcfg2-c8f4173ac79691c6a2eb9fe59f755b4990227edf.zip |
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.
-rwxr-xr-x | tools/export2.py | 15 |
1 files changed, 14 insertions, 1 deletions
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] |