Commits

Simon H. committed 89b6400

Add argument for number of hot files to show

only number of files, no range and no % of total files

Comments (0)

Files changed (1)

 @command('hotfiles',
          [('r', 'rev', '', _('operate up to a given revision'), 'REV'),
           ('p', 'pattern', '', _('pattern to filter issue-fixing commits'),
-           'REGEX')
+           'REGEX'),
+          ('n', 'nfiles', 10, _('number of files to show'), 'NUM'),
           ] + commands.walkopts,
          _('[-r REV] [-p REGEX]')
 )
 
     b = getb()
 
+    endlist = opts.get('nfiles', 10)
+
     excludeglob = ui.configlist('hotfiles', 'exclude.glob', [])
     excludeglob.extend(opts.get('exclude', []))
     if b is not None:
         pos += 1
     ui.progress('score', None)
 
-    d = sorted(d, key=lambda x: x[1], reverse=True)[:10]
+    d = sorted(d, key=lambda x: x[1], reverse=True)[:endlist]
 
     if d:
         max = d[0][1]