1. Marcus Lindblom Sonestedt
  2. ml-hgext

Commits

Marcus Lindblom Sonestedt  committed 45a4024

checkfiles: import match from scmutil (1.9+) and fallback to cmdutil (<=1.8) on fail (fixes #13)

  • Participants
  • Parent commits 3bdc82d
  • Branches default

Comments (0)

Files changed (1)

File checkfiles.py

View file
             if len(self.ctx.parents()) == 1:
                 # XXX would be nicer if checked_exts were a proper pattern;
                 # then cmdutil.match would work naturally with it
+                try:
+                    from scmutil import match
+                except ImportError:
+                    from cmdutil import match
+
                 file = None
                 hunk = None
                 lastlabel = None
                 for chunk, label in patch.diffui(self.repo,
                                                  self.ctx.p1().node(),
                                                  self.ctx.node(),
-                                                 cmdutil.match(self.repo)):
+                                                 match(self.repo)):
                     if len(label) > 0 or chunk != '\n':
                         self.ui.debug('checkfiles: %s="%s"\n' % (label, chunk))
                     if label == 'diff.file_b':