##// END OF EJS Templates
Added --date option to annotate.
lupus@debian.org -
r1522:d07d729c default
parent child Browse files
Show More
@@ -87,7 +87,7 b' addremove [options] [files ...]::'
87 New files are ignored if they match any of the patterns in .hgignore. As
87 New files are ignored if they match any of the patterns in .hgignore. As
88 with add, these changes take effect at the next commit.
88 with add, these changes take effect at the next commit.
89
89
90 annotate [-r <rev> -u -n -c] [files ...]::
90 annotate [-r <rev> -u -n -c -d] [files ...]::
91 List changes in files, showing the revision id responsible for each line
91 List changes in files, showing the revision id responsible for each line
92
92
93 This command is useful to discover who did a change or when a change took
93 This command is useful to discover who did a change or when a change took
@@ -103,6 +103,7 b' annotate [-r <rev> -u -n -c] [files ...]'
103 -X, --exclude <pat> exclude names matching the given patterns
103 -X, --exclude <pat> exclude names matching the given patterns
104 -r, --revision <rev> annotate the specified revision
104 -r, --revision <rev> annotate the specified revision
105 -u, --user list the author
105 -u, --user list the author
106 -d, --date list the commit date
106 -c, --changeset list the changeset
107 -c, --changeset list the changeset
107 -n, --number list the revision number (default)
108 -n, --number list the revision number (default)
108
109
@@ -538,11 +538,19 b' def annotate(ui, repo, *pats, **opts):'
538 cl = repo.changelog.read(repo.changelog.node(rev))
538 cl = repo.changelog.read(repo.changelog.node(rev))
539 return trimuser(ui, cl[1], rev, ucache)
539 return trimuser(ui, cl[1], rev, ucache)
540
540
541 dcache = {}
542 def getdate(rev):
543 datestr = dcache.get(rev)
544 if datestr is None:
545 cl = repo.changelog.read(repo.changelog.node(rev))
546 datestr = dcache[rev] = util.datestr(cl[2])
547 return datestr
548
541 if not pats:
549 if not pats:
542 raise util.Abort(_('at least one file name or pattern required'))
550 raise util.Abort(_('at least one file name or pattern required'))
543
551
544 opmap = [['user', getname], ['number', str], ['changeset', getnode]]
552 opmap = [['user', getname], ['number', str], ['changeset', getnode], ['date', getdate]]
545 if not opts['user'] and not opts['changeset']:
553 if not opts['user'] and not opts['changeset'] and not opts['date']:
546 opts['number'] = 1
554 opts['number'] = 1
547
555
548 if opts['rev']:
556 if opts['rev']:
@@ -2140,6 +2148,7 b' table = {'
2140 [('r', 'rev', '', _('annotate the specified revision')),
2148 [('r', 'rev', '', _('annotate the specified revision')),
2141 ('a', 'text', None, _('treat all files as text')),
2149 ('a', 'text', None, _('treat all files as text')),
2142 ('u', 'user', None, _('list the author')),
2150 ('u', 'user', None, _('list the author')),
2151 ('d', 'date', None, _('list the date')),
2143 ('n', 'number', None, _('list the revision number (default)')),
2152 ('n', 'number', None, _('list the revision number (default)')),
2144 ('c', 'changeset', None, _('list the changeset')),
2153 ('c', 'changeset', None, _('list the changeset')),
2145 ('I', 'include', [], _('include names matching the given patterns')),
2154 ('I', 'include', [], _('include names matching the given patterns')),
General Comments 0
You need to be logged in to leave comments. Login now