Commits

Steve Borho  committed b740366

changeset: provide filtered changes to patch.diff

The repo.status() call in patch.diff() was how the provided matcher was used
to build the list of files to be diffed. So now we directly filter the cached
repo.status() results and pass those to patch.diff()

  • Participants
  • Parent commits 491dba8
  • Branches stable
  • Tags 1.1.6.1

Comments (0)

Files changed (1)

File tortoisehg/hgtk/changeset.py

                     _(' %s is larger than the specified max diff size') % wfile]
         else:
             lines = []
-            m = cmdutil.matchfiles(self.repo, [wfile])
+            M, A, R = self.changes
+            if wfile in M:
+                changes = [wfile], [], []
+            elif wfile in A:
+                changes = [], [wfile], []
+            else:
+                changes = [], [], [wfile]
             opts = mdiff.diffopts(git=True, nodates=True)
             try:
-                for s in patch.diff(self.repo, n1, n2, changes=self.changes,
-                                    match=m, opts=opts):
+                for s in patch.diff(self.repo, n1, n2, changes=changes, opts=opts):
                     lines.extend(s.splitlines())
             except (error.RepoError, error.LookupError), e:
                 err = _('Repository Error:  %s, refresh suggested') % str(e)