Mercurial > public > mercurial-scm > hg
changeset 1525:c85e5bbfd141
Merge with TAH
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 09 Nov 2005 13:42:16 -0800 |
parents | 0d47bb884330 (diff) 95ee4f12fbd9 (current diff) |
children | c230939283c3 b4ed825282fe |
files | mercurial/commands.py |
diffstat | 4 files changed, 20 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/hg.1.txt Wed Nov 09 22:31:18 2005 +0100 +++ b/doc/hg.1.txt Wed Nov 09 13:42:16 2005 -0800 @@ -87,7 +87,7 @@ New files are ignored if they match any of the patterns in .hgignore. As with add, these changes take effect at the next commit. -annotate [-r <rev> -u -n -c] [files ...]:: +annotate [-r <rev> -u -n -c -d] [files ...]:: List changes in files, showing the revision id responsible for each line This command is useful to discover who did a change or when a change took @@ -103,6 +103,7 @@ -X, --exclude <pat> exclude names matching the given patterns -r, --revision <rev> annotate the specified revision -u, --user list the author + -d, --date list the commit date -c, --changeset list the changeset -n, --number list the revision number (default)
--- a/mercurial/commands.py Wed Nov 09 22:31:18 2005 +0100 +++ b/mercurial/commands.py Wed Nov 09 13:42:16 2005 -0800 @@ -538,11 +538,20 @@ cl = repo.changelog.read(repo.changelog.node(rev)) return trimuser(ui, cl[1], rev, ucache) + dcache = {} + def getdate(rev): + datestr = dcache.get(rev) + if datestr is None: + cl = repo.changelog.read(repo.changelog.node(rev)) + datestr = dcache[rev] = util.datestr(cl[2]) + return datestr + if not pats: raise util.Abort(_('at least one file name or pattern required')) - opmap = [['user', getname], ['number', str], ['changeset', getnode]] - if not opts['user'] and not opts['changeset']: + opmap = [['user', getname], ['number', str], ['changeset', getnode], + ['date', getdate]] + if not opts['user'] and not opts['changeset'] and not opts['date']: opts['number'] = 1 if opts['rev']: @@ -2140,6 +2149,7 @@ [('r', 'rev', '', _('annotate the specified revision')), ('a', 'text', None, _('treat all files as text')), ('u', 'user', None, _('list the author')), + ('d', 'date', None, _('list the date')), ('n', 'number', None, _('list the revision number (default)')), ('c', 'changeset', None, _('list the changeset')), ('I', 'include', [], _('include names matching the given patterns')),
--- a/mercurial/hgweb.py Wed Nov 09 22:31:18 2005 +0100 +++ b/mercurial/hgweb.py Wed Nov 09 13:42:16 2005 -0800 @@ -999,7 +999,10 @@ .replace("//", "/")) # update time with local timezone - d = (get_mtime(path), util.makedate()[1]) + try: + d = (get_mtime(path), util.makedate()[1]) + except OSError: + continue yield dict(contact=(get("ui", "username") or # preferred get("web", "contact") or # deprecated