Mercurial > hg
comparison hgext/mq.py @ 6582:5acbdd3941c4
walk: remove remaining users of cmdutils.matchpats
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 May 2008 11:37:07 -0500 |
parents | 090f2145df7d |
children | cd4db3999ef9 |
comparison
equal
deleted
inserted
replaced
6581:1ae7cb678d24 | 6582:5acbdd3941c4 |
---|---|
318 except OSError, inst: | 318 except OSError, inst: |
319 self.ui.warn('error removing undo: %s\n' % str(inst)) | 319 self.ui.warn('error removing undo: %s\n' % str(inst)) |
320 | 320 |
321 def printdiff(self, repo, node1, node2=None, files=None, | 321 def printdiff(self, repo, node1, node2=None, files=None, |
322 fp=None, changes=None, opts={}): | 322 fp=None, changes=None, opts={}): |
323 fns, matchfn, anypats = cmdutil.matchpats(repo, files, opts) | 323 m = cmdutil.match(repo, files, opts) |
324 | 324 patch.diff(repo, node1, node2, m.files(), match=m, |
325 patch.diff(repo, node1, node2, fns, match=matchfn, | |
326 fp=fp, changes=changes, opts=self.diffopts()) | 325 fp=fp, changes=changes, opts=self.diffopts()) |
327 | 326 |
328 def mergeone(self, repo, mergeq, head, patch, rev): | 327 def mergeone(self, repo, mergeq, head, patch, rev): |
329 # first try just applying the patch | 328 # first try just applying the patch |
330 (err, n) = self.apply(repo, [ patch ], update_status=False, | 329 (err, n) = self.apply(repo, [ patch ], update_status=False, |
619 date = util.parsedate(date) | 618 date = util.parsedate(date) |
620 self.check_reserved_name(patch) | 619 self.check_reserved_name(patch) |
621 if os.path.exists(self.join(patch)): | 620 if os.path.exists(self.join(patch)): |
622 raise util.Abort(_('patch "%s" already exists') % patch) | 621 raise util.Abort(_('patch "%s" already exists') % patch) |
623 if opts.get('include') or opts.get('exclude') or pats: | 622 if opts.get('include') or opts.get('exclude') or pats: |
624 fns, match, anypats = cmdutil.matchpats(repo, pats, opts) | 623 match = cmdutil.match(repo, pats, opts) |
625 m, a, r, d = repo.status(files=fns, match=match)[:4] | 624 m, a, r, d = repo.status(files=match.files(), match=match)[:4] |
626 else: | 625 else: |
627 m, a, r, d = self.check_localchanges(repo, force) | 626 m, a, r, d = self.check_localchanges(repo, force) |
628 fns, match, anypats = cmdutil.matchpats(repo, m + a + r) | 627 match = cmdutil.match(repo, m + a + r) |
629 commitfiles = m + a + r | 628 commitfiles = m + a + r |
630 self.check_toppatch(repo) | 629 self.check_toppatch(repo) |
631 wlock = repo.wlock() | 630 wlock = repo.wlock() |
632 try: | 631 try: |
633 insert = self.full_series_end() | 632 insert = self.full_series_end() |
1022 comments = "\n".join(comments) + '\n\n' | 1021 comments = "\n".join(comments) + '\n\n' |
1023 patchf.write(comments) | 1022 patchf.write(comments) |
1024 | 1023 |
1025 if opts.get('git'): | 1024 if opts.get('git'): |
1026 self.diffopts().git = True | 1025 self.diffopts().git = True |
1027 fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) | 1026 matchfn = cmdutil.match(repo, pats, opts) |
1028 tip = repo.changelog.tip() | 1027 tip = repo.changelog.tip() |
1029 if top == tip: | 1028 if top == tip: |
1030 # if the top of our patch queue is also the tip, there is an | 1029 # if the top of our patch queue is also the tip, there is an |
1031 # optimization here. We update the dirstate in place and strip | 1030 # optimization here. We update the dirstate in place and strip |
1032 # off the tip commit. Then just commit the current directory | 1031 # off the tip commit. Then just commit the current directory |