Mercurial > hg
comparison hgext/churn.py @ 21779:a57deb45c744
churn: define inferrepo in command decorator
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 04 May 2014 22:24:38 -0700 |
parents | 75c8720092ba |
children | 8d43c6bb38c0 |
comparison
equal
deleted
inserted
replaced
21778:f6a6d07b66b3 | 21779:a57deb45c744 |
---|---|
102 ('c', 'changesets', False, _('count rate by number of changesets')), | 102 ('c', 'changesets', False, _('count rate by number of changesets')), |
103 ('s', 'sort', False, _('sort by key (default: sort by count)')), | 103 ('s', 'sort', False, _('sort by key (default: sort by count)')), |
104 ('', 'diffstat', False, _('display added/removed lines separately')), | 104 ('', 'diffstat', False, _('display added/removed lines separately')), |
105 ('', 'aliases', '', _('file with email aliases'), _('FILE')), | 105 ('', 'aliases', '', _('file with email aliases'), _('FILE')), |
106 ] + commands.walkopts, | 106 ] + commands.walkopts, |
107 _("hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]")) | 107 _("hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]"), |
108 inferrepo=True) | |
108 def churn(ui, repo, *pats, **opts): | 109 def churn(ui, repo, *pats, **opts): |
109 '''histogram of changes to the repository | 110 '''histogram of changes to the repository |
110 | 111 |
111 This command will display a histogram representing the number | 112 This command will display a histogram representing the number |
112 of changed lines or revisions, grouped according to the given | 113 of changed lines or revisions, grouped according to the given |
195 def charnum(count): | 196 def charnum(count): |
196 return int(round(count * width / maxcount)) | 197 return int(round(count * width / maxcount)) |
197 | 198 |
198 for name, count in rate: | 199 for name, count in rate: |
199 ui.write(format(name, count)) | 200 ui.write(format(name, count)) |
200 | |
201 commands.inferrepo += " churn" |