comparison hgext/record.py @ 24309:fefcafda10b8

record: change interface of dorecord to accept new filters This makes it easier to add different filtering logic (record /crecord ...)
author Laurent Charignon <lcharignon@fb.com>
date Wed, 11 Mar 2015 16:39:38 -0700
parents 7fcd9f4af49b
children 80c5b2666a96
comparison
equal deleted inserted replaced
24308:1725843a7644 24309:fefcafda10b8
64 # We can't pass *pats here since qrefresh will undo all other 64 # We can't pass *pats here since qrefresh will undo all other
65 # changed files in the patch that aren't in pats. 65 # changed files in the patch that aren't in pats.
66 mq.refresh(ui, repo, **opts) 66 mq.refresh(ui, repo, **opts)
67 67
68 # backup all changed files 68 # backup all changed files
69 cmdutil.dorecord(ui, repo, committomq, 'qrefresh', True, *pats, **opts) 69 cmdutil.dorecord(ui, repo, committomq, 'qrefresh', True,
70 cmdutil.recordfilter, *pats, **opts)
70 71
71 # This command registration is replaced during uisetup(). 72 # This command registration is replaced during uisetup().
72 @command('qrecord', 73 @command('qrecord',
73 [], 74 [],
74 _('hg qrecord [OPTION]... PATCH [FILE]...'), 75 _('hg qrecord [OPTION]... PATCH [FILE]...'),
89 90
90 def committomq(ui, repo, *pats, **opts): 91 def committomq(ui, repo, *pats, **opts):
91 opts['checkname'] = False 92 opts['checkname'] = False
92 mq.new(ui, repo, patch, *pats, **opts) 93 mq.new(ui, repo, patch, *pats, **opts)
93 94
94 cmdutil.dorecord(ui, repo, committomq, 'qnew', False, *pats, **opts) 95 cmdutil.dorecord(ui, repo, committomq, 'qnew', False,
96 cmdutil.recordfilter, *pats, **opts)
95 97
96 def qnew(origfn, ui, repo, patch, *args, **opts): 98 def qnew(origfn, ui, repo, patch, *args, **opts):
97 if opts['interactive']: 99 if opts['interactive']:
98 return qrecord(ui, repo, patch, *args, **opts) 100 return qrecord(ui, repo, patch, *args, **opts)
99 return origfn(ui, repo, patch, *args, **opts) 101 return origfn(ui, repo, patch, *args, **opts)