Commits

Benoît Allard committed 24dd0aa

Add include and exclude pattern availability to the command line

  • Participants
  • Parent commits ecc8477

Comments (0)

Files changed (1)

 
 from math import exp
 
-from mercurial import cmdutil, scmutil
+from mercurial import cmdutil, scmutil, commands
 from mercurial.i18n import _
 from mercurial.node import nullrev
 from mercurial.match import match
     raise
 
 @command('hotfiles',
-         [('r', 'rev', '', _('revision'), 'REV'),
-          ('p', 'pattern', '', _('pattern to filter issue-fixing commits'), 'REGEX')
-          ],
+         [('r', 'rev', '', _('operate up to a given revision'), 'REV'),
+          ('p', 'pattern', '', _('pattern to filter issue-fixing commits'),
+           'REGEX')
+          ] + commands.walkopts,
          _('[-r REV] [-p REGEX]')
 )
 def hotfiles(ui, repo, node=None, rev='.', pattern=None, **opts):
     r = re.compile(pattern)
 
     excludeglob = ui.configlist('hotfiles', 'exclude.glob', [])
+    excludeglob.extend(opts.get('exclude', []))
     includeglob = ui.configlist('hotfiles', 'include.glob', [])
+    includeglob.extend(opts.get('include', []))
     m = match(repo.root, '', None, exclude=excludeglob, include=includeglob)
 
     if not node: