diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-25 16:45:42 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-25 16:45:42 -0500 |
commit | 0c032afab8b5a22428d6148bd611cfe171934ae2 (patch) | |
tree | ce21723e35bb8db0169ac461130a2f52249cb7d1 /becommands | |
parent | da9c84914deb5da645f46cff892d1245cd4eaf99 (diff) | |
download | bugseverywhere-0c032afab8b5a22428d6148bd611cfe171934ae2.tar.gz |
Added -a/n/m/r to becommands/diff.py.
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/diff.py | 36 | ||||
-rw-r--r-- | becommands/list.py | 2 |
2 files changed, 34 insertions, 4 deletions
diff --git a/becommands/diff.py b/becommands/diff.py index 8714d77..1696913 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -52,11 +52,37 @@ def execute(args, test=False): else: old_bd = bd.duplicate_bugdir(revision) r,m,a = diff.diff(old_bd, bd) - print diff.diff_report((r,m,a), bd).encode(bd.encoding) + + optbugs = [] + if options.all == True: + options.new = options.modified = options.removed = True + if options.new == True: + optbugs.extend(a) + if options.modified == True: + optbugs.extend([new for old,new in m]) + if options.removed == True: + optbugs.extend(r) + if len(optbugs) > 0: + for bug in optbugs: + print bug.uuid + else : + print diff.diff_report((r,m,a), bd).encode(bd.encoding) bd.remove_duplicate_bugdir() def get_parser(): - parser = cmdutil.CmdOptionParser("be diff [SPECIFIER]") + 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", + dest=attr, help=help) return parser longhelp=""" @@ -64,7 +90,11 @@ Uses the RCS to compare the current tree with a previous tree, and prints a pretty report. If specifier is given, it is a specifier for the particular previous tree to use. Specifiers are specific to their RCS. -For Arch: a fully-qualified revision name +For Arch your specifier must be a fully-qualified revision name. + +Besides the standard summary output, you can use the options to output +UUIDS for the different categories. This output can be used as the +input to 'be show' to get and understanding of the current status. """ def help(): diff --git a/becommands/list.py b/becommands/list.py index 1f5b462..5c0d326 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -136,7 +136,7 @@ def get_parser(): help="List options matching ASSIGNED", default=None) parser.add_option("-t", "--target", metavar="TARGET", dest="target", help="List options matching TARGET", default=None) - # boolean shortucts. All of these are special cases of long forms + # boolean options. All but uuids are special cases of long forms bools = (("u", "uuids", "Only print the bug UUIDS"), ("w", "wishlist", "List bugs with 'wishlist' severity"), ("i", "important", "List bugs with >= 'serious' severity"), |