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="""
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():
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"),
def __init__(self, bug=None, uuid=None, from_disk=False,
in_reply_to=None, body=None):
"""
- Set from_disk=True to load an old bug.
- Set from_disk=False to create a new bug.
+ Set from_disk=True to load an old comment.
+ Set from_disk=False to create a new comment.
The uuid option is required when from_disk==True.