##// END OF EJS Templates
fix: match patterns relative to root...
Martin von Zweigbergk -
r43501:f02d3c0e default
parent child Browse files
Show More
@@ -46,8 +46,10 b' tool needs to operate on unchanged files'
46 46 to false.
47 47
48 48 The :pattern suboption determines which files will be passed through each
49 configured tool. See :hg:`help patterns` for possible values. If there are file
50 arguments to :hg:`fix`, the intersection of these patterns is used.
49 configured tool. See :hg:`help patterns` for possible values. However, all
50 patterns are relative to the repo root, even if that text says they are relative
51 to the current working directory. If there are file arguments to :hg:`fix`, the
52 intersection of these patterns is used.
51 53
52 54 There is also a configurable limit for the maximum size of file that will be
53 55 processed by :hg:`fix`::
@@ -140,6 +142,7 b' from mercurial import ('
140 142 context,
141 143 copies,
142 144 error,
145 match as matchmod,
143 146 mdiff,
144 147 merge,
145 148 obsolete,
@@ -843,7 +846,11 b' class Fixer(object):'
843 846
844 847 def affects(self, opts, fixctx, path):
845 848 """Should this fixer run on the file at the given path and context?"""
846 return scmutil.match(fixctx, [self._pattern], opts)(path)
849 repo = fixctx.repo()
850 matcher = matchmod.match(
851 repo.root, repo.root, [self._pattern], ctx=fixctx
852 )
853 return matcher(path)
847 854
848 855 def shouldoutputmetadata(self):
849 856 """Should the stdout of this fixer start with JSON and a null byte?"""
@@ -157,8 +157,10 b' Help text for fix.'
157 157 :skipclean suboption to false.
158 158
159 159 The :pattern suboption determines which files will be passed through each
160 configured tool. See 'hg help patterns' for possible values. If there are file
161 arguments to 'hg fix', the intersection of these patterns is used.
160 configured tool. See 'hg help patterns' for possible values. However, all
161 patterns are relative to the repo root, even if that text says they are
162 relative to the current working directory. If there are file arguments to 'hg
163 fix', the intersection of these patterns is used.
162 164
163 165 There is also a configurable limit for the maximum size of file that will be
164 166 processed by 'hg fix':
@@ -1321,7 +1323,7 b' reasonable with that.'
1321 1323 $ echo modified > bar
1322 1324 $ hg fix -w bar
1323 1325 $ cat bar
1324 modified
1326 $TESTTMP/subprocesscwd
1325 1327
1326 1328 $ cd ../..
1327 1329
General Comments 0
You need to be logged in to leave comments. Login now