Rename a tag or branch. Refuses to step on an existing symbol or
rename a nonexistent one. 'rn' is a synonym for 'rename'.
-src list ['revision-range'] ['file'...]
+src list [-f fmt] ['revision-range'] ['file'...]
Sends summary information about the specified commits to standard output.
The summary line tagged with '*' is the state that the file would
- return to on checkout without a revision-spec.
+ return to on checkout without a revision-spec. See 'help list' for
+ information about custom formats.
src log ['revision-range'] ['file'...]
Sends log information about the specified commits to standard output.
With no revision, dumps a log of the entire current branch.
""",
"list" : """
-src list ['revision-range'] ['file'...]
+src list [-f fmt] ['revision-range'] ['file'...]
Sends summary information about the specified commits of each file
to standard output. The summary information includes the revision
With no revision, dumps a log of the entire current branch.
+The -f option allows you to set a custom fomat string. Available
+substitutions are:
+
+{0} The file name
+{1} The revision number
+{2} The mark - * is this is the currently checked out revision, else '-'.
+{3} The date in RFC3339 format
+{4} The summary line
+
'li' is a synonym for 'list'.
""",
"diff" : """
def list_method(*args):
"Generate a summary listing of commits, one line per commit."
+ args = list(args)
+ custom = None
+ if args[0] == '--':
+ args.pop(0)
+ elif args[0] == "-f":
+ args.pop(0)
+ try:
+ custom = args[0]
+ args.pop(0)
+ except IndexError:
+ croak("list -f requires a following string")
+ elif args[0].startswith("-f"):
+ custom = args[0][2:]
+ args.pop(0)
ctx = CommandContext("list", args, default_to="branch_reversed")
width = screenwidth()
for arg in ctx.args:
if ignore(arg) or not registered(arg):
continue
- sys.stdout.write("= %s %s\n" % (arg, ((width - len(arg) - 5) * "=")))
+ if custom is None:
+ sys.stdout.write("= %s %s\n" % (arg, ((width - len(arg) - 5) * "=")))
for item in ctx.resolve(History(arg), backwards=True):
# Must allow enough room for revno and date
- summary = item.log.strip()[:width - 34]
if item.selected():
mark = "*"
else:
mark = "-"
- sys.stdout.write("%-4d %s %s %s\n" \
+ summary = item.log.split('\n')[0][:width - 34]
+ if custom is None:
+ summary = summary[:width - 34]
+ sys.stdout.write("%-4d %s %s %s\n" \
% (item.revno, mark, item.date, summary))
+ else:
+ sys.stdout.write(custom.format(arg, item.revno, mark, item.date, summary))
def log_method(*args):
"Report revision logs"