From e9886142f89fde4d7df7e1f43dbfea88c8ef03a5 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Thu, 5 Aug 2010 12:48:42 +0200 Subject: Implement initial-merge options -n --dry-run --- src/pyfedpkg/initial_merge.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/pyfedpkg') diff --git a/src/pyfedpkg/initial_merge.py b/src/pyfedpkg/initial_merge.py index 28e922e..759518a 100755 --- a/src/pyfedpkg/initial_merge.py +++ b/src/pyfedpkg/initial_merge.py @@ -187,6 +187,9 @@ class Action(argparse.Action): def fedpkg_command(args): + global_dry_run = args.dry_run + if global_dry_run: + print "NOTE: Running in dry-run mode, i.e. we will not actually perform any merges." for repo in args.repos: handle_path(repo) @@ -196,6 +199,12 @@ def get_parser(subparsers): sp = subparsers.add_parser('initial-merge', help = 'git merge to join branches with identical trees', epilog = _module_doc) + sp.add_argument('-n', '--dry-run', + dest='dry_run', + action='store_const', const=True, + default=False, + help = ('Whether to actually perform the merges. '+ + 'Local tracking branches wil be created anyway.')) sp.add_argument('repos', metavar='repo-path', nargs='*', default=['.'], action=Action, -- cgit