Mercurial > hg
comparison hgext/churn.py @ 24139:73b3218bb078
churn: deprecate -t option in favour of -T
We use -T consistently elsewhere to refer to the --template option.
The old -t option is now renamed to --oldtemplate so that -t still
works. This has the benign side effect of introducing and immediately
deprecating a new long option.
We also test with both -t and -T options.
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Tue, 24 Feb 2015 11:37:07 -0500 |
parents | 8d43c6bb38c0 |
children | fd7287f0b43c |
comparison
equal
deleted
inserted
replaced
24138:eabe44ec5af5 | 24139:73b3218bb078 |
---|---|
44 def getkey(ctx): | 44 def getkey(ctx): |
45 t, tz = ctx.date() | 45 t, tz = ctx.date() |
46 date = datetime.datetime(*time.gmtime(float(t) - tz)[:6]) | 46 date = datetime.datetime(*time.gmtime(float(t) - tz)[:6]) |
47 return date.strftime(opts['dateformat']) | 47 return date.strftime(opts['dateformat']) |
48 else: | 48 else: |
49 tmpl = opts.get('template', '{author|email}') | 49 tmpl = opts.get('oldtemplate') or opts.get('template') |
50 tmpl = maketemplater(ui, repo, tmpl) | 50 tmpl = maketemplater(ui, repo, tmpl) |
51 def getkey(ctx): | 51 def getkey(ctx): |
52 ui.pushbuffer() | 52 ui.pushbuffer() |
53 tmpl.show(ctx) | 53 tmpl.show(ctx) |
54 return ui.popbuffer() | 54 return ui.popbuffer() |
93 @command('churn', | 93 @command('churn', |
94 [('r', 'rev', [], | 94 [('r', 'rev', [], |
95 _('count rate for the specified revision or revset'), _('REV')), | 95 _('count rate for the specified revision or revset'), _('REV')), |
96 ('d', 'date', '', | 96 ('d', 'date', '', |
97 _('count rate for revisions matching date spec'), _('DATE')), | 97 _('count rate for revisions matching date spec'), _('DATE')), |
98 ('t', 'template', '{author|email}', | 98 ('t', 'oldtemplate', '', |
99 _('template to group changesets (DEPRECATED)'), _('TEMPLATE')), | |
100 ('T', 'template', '{author|email}', | |
99 _('template to group changesets'), _('TEMPLATE')), | 101 _('template to group changesets'), _('TEMPLATE')), |
100 ('f', 'dateformat', '', | 102 ('f', 'dateformat', '', |
101 _('strftime-compatible format for grouping by date'), _('FORMAT')), | 103 _('strftime-compatible format for grouping by date'), _('FORMAT')), |
102 ('c', 'changesets', False, _('count rate by number of changesets')), | 104 ('c', 'changesets', False, _('count rate by number of changesets')), |
103 ('s', 'sort', False, _('sort by key (default: sort by count)')), | 105 ('s', 'sort', False, _('sort by key (default: sort by count)')), |