From 281e98e998b4a1ec550c6702aee0eead003905be Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 5 Dec 2009 01:30:30 -0500 Subject: Replaced `be diff` options --new, --removed, --modified, and --all with --uuids. We'll be adding a --subscribe option which will select the bugs/changes we're interested in, which deprecates the selection portion of the old options. The new --uuids just selects the "bug uuid" output over the default "change summary" output. --- becommands/diff.py | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'becommands') diff --git a/becommands/diff.py b/becommands/diff.py index f581ace..aebbfdb 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -84,16 +84,11 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): d = diff.Diff(old_bd, bd) tree = d.report_tree() - uuids = [] - if options.all == True: - options.new = options.modified = options.removed = True - if options.new == True: - uuids.extend([c.name for c in tree.child_by_path("/bugs/new")]) - if options.modified == True: - uuids.extend([c.name for c in tree.child_by_path("/bugs/mod")]) - if options.removed == True: - uuids.extend([c.name for c in tree.child_by_path("/bugs/rem")]) - if (options.new or options.modified or options.removed) == True: + if options.uuids == True: + uuids = [] + bugs = tree.child_by_path("/bugs") + for bug_type in bugs: + uuids.extend([bug.name for bug in bug_type]) print "\n".join(uuids) else : rep = tree.report_string() @@ -105,20 +100,10 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): def get_parser(): parser = cmdutil.CmdOptionParser("be diff [options] REVISION") - # boolean options - bools = (("n", "new", "Print UUIDS for new bugs"), - ("m", "modified", "Print UUIDS for modified bugs"), - ("r", "removed", "Print UUIDS for removed bugs"), - ("a", "all", "Print UUIDS for all changed bugs")) - for s in bools: - attr = s[1].replace('-','_') - short = "-%c" % s[0] - long = "--%s" % s[1] - help = s[2] - parser.add_option(short, long, action="store_true", - default=False, dest=attr, help=help) parser.add_option("-d", "--dir", dest="dir", metavar="DIR", help="Compare with repository in DIR instead of the current directory.") + parser.add_option("-u", "--uuids", action="store_true", dest="uuids", + help="Only print the bug UUIDS.", default=False) return parser longhelp=""" -- cgit