hgext/mq.py
changeset 14671 35c2cc322ba8
parent 14636 b98063487a6f
child 14732 e9ed3506f066
equal deleted inserted replaced
14670:19197fa4c41c 14671:35c2cc322ba8
   517             self.ui.warn(_('error removing undo: %s\n') % str(inst))
   517             self.ui.warn(_('error removing undo: %s\n') % str(inst))
   518 
   518 
   519     def printdiff(self, repo, diffopts, node1, node2=None, files=None,
   519     def printdiff(self, repo, diffopts, node1, node2=None, files=None,
   520                   fp=None, changes=None, opts={}):
   520                   fp=None, changes=None, opts={}):
   521         stat = opts.get('stat')
   521         stat = opts.get('stat')
   522         m = scmutil.match(repo, files, opts)
   522         m = scmutil.match(repo[node1], files, opts)
   523         cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2,  m,
   523         cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2,  m,
   524                                changes, stat, fp)
   524                                changes, stat, fp)
   525 
   525 
   526     def mergeone(self, repo, mergeq, head, patch, rev, diffopts):
   526     def mergeone(self, repo, mergeq, head, patch, rev, diffopts):
   527         # first try just applying the patch
   527         # first try just applying the patch
   897         if inclsubs:
   897         if inclsubs:
   898             inclsubs.append('.hgsubstate')
   898             inclsubs.append('.hgsubstate')
   899         if opts.get('include') or opts.get('exclude') or pats:
   899         if opts.get('include') or opts.get('exclude') or pats:
   900             if inclsubs:
   900             if inclsubs:
   901                 pats = list(pats or []) + inclsubs
   901                 pats = list(pats or []) + inclsubs
   902             match = scmutil.match(repo, pats, opts)
   902             match = scmutil.match(repo[None], pats, opts)
   903             # detect missing files in pats
   903             # detect missing files in pats
   904             def badfn(f, msg):
   904             def badfn(f, msg):
   905                 if f != '.hgsubstate': # .hgsubstate is auto-created
   905                 if f != '.hgsubstate': # .hgsubstate is auto-created
   906                     raise util.Abort('%s: %s' % (f, msg))
   906                     raise util.Abort('%s: %s' % (f, msg))
   907             match.bad = badfn
   907             match.bad = badfn
  1378             # caching against the next repo.status call
  1378             # caching against the next repo.status call
  1379             mm, aa, dd = repo.status(patchparent, top)[:3]
  1379             mm, aa, dd = repo.status(patchparent, top)[:3]
  1380             changes = repo.changelog.read(top)
  1380             changes = repo.changelog.read(top)
  1381             man = repo.manifest.read(changes[0])
  1381             man = repo.manifest.read(changes[0])
  1382             aaa = aa[:]
  1382             aaa = aa[:]
  1383             matchfn = scmutil.match(repo, pats, opts)
  1383             matchfn = scmutil.match(repo[None], pats, opts)
  1384             # in short mode, we only diff the files included in the
  1384             # in short mode, we only diff the files included in the
  1385             # patch already plus specified files
  1385             # patch already plus specified files
  1386             if opts.get('short'):
  1386             if opts.get('short'):
  1387                 # if amending a patch, we start with existing
  1387                 # if amending a patch, we start with existing
  1388                 # files plus specified files - unfiltered
  1388                 # files plus specified files - unfiltered
  1389                 match = scmutil.matchfiles(repo, mm + aa + dd + matchfn.files())
  1389                 match = scmutil.matchfiles(repo, mm + aa + dd + matchfn.files())
  1390                 # filter with inc/exl options
  1390                 # filter with inc/exl options
  1391                 matchfn = scmutil.match(repo, opts=opts)
  1391                 matchfn = scmutil.match(repo[None], opts=opts)
  1392             else:
  1392             else:
  1393                 match = scmutil.matchall(repo)
  1393                 match = scmutil.matchall(repo)
  1394             m, a, r, d = repo.status(match=match)[:4]
  1394             m, a, r, d = repo.status(match=match)[:4]
  1395             mm = set(mm)
  1395             mm = set(mm)
  1396             aa = set(aa)
  1396             aa = set(aa)