hgext/fix.py
changeset 43227 f02d3c0eed18
parent 43221 0e2a2fab4b2e
child 43380 579672b347d2
--- a/hgext/fix.py	Sat Oct 12 11:30:20 2019 -0700
+++ b/hgext/fix.py	Sat Oct 12 11:30:25 2019 -0700
@@ -46,8 +46,10 @@
 to false.
 
 The :pattern suboption determines which files will be passed through each
-configured tool. See :hg:`help patterns` for possible values. If there are file
-arguments to :hg:`fix`, the intersection of these patterns is used.
+configured tool. See :hg:`help patterns` for possible values. However, all
+patterns are relative to the repo root, even if that text says they are relative
+to the current working directory. If there are file arguments to :hg:`fix`, the
+intersection of these patterns is used.
 
 There is also a configurable limit for the maximum size of file that will be
 processed by :hg:`fix`::
@@ -140,6 +142,7 @@
     context,
     copies,
     error,
+    match as matchmod,
     mdiff,
     merge,
     obsolete,
@@ -843,7 +846,11 @@
 
     def affects(self, opts, fixctx, path):
         """Should this fixer run on the file at the given path and context?"""
-        return scmutil.match(fixctx, [self._pattern], opts)(path)
+        repo = fixctx.repo()
+        matcher = matchmod.match(
+            repo.root, repo.root, [self._pattern], ctx=fixctx
+        )
+        return matcher(path)
 
     def shouldoutputmetadata(self):
         """Should the stdout of this fixer start with JSON and a null byte?"""