aboutsummaryrefslogtreecommitdiffstats
path: root/becommands
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-05 01:30:30 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-05 01:30:30 -0500
commit281e98e998b4a1ec550c6702aee0eead003905be (patch)
tree91995f4247e674451f16e7698f944a063fc51879 /becommands
parent1bbf068f28a6c05da563bc1224a4456f635227a4 (diff)
downloadbugseverywhere-281e98e998b4a1ec550c6702aee0eead003905be.tar.gz
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.
Diffstat (limited to 'becommands')
-rw-r--r--becommands/diff.py29
1 files changed, 7 insertions, 22 deletions
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="""