##// END OF EJS Templates
localrepo: debug log of filter name when filtering through a function
Mads Kiilerich -
r43472:6ceb3721 default
parent child Browse files
Show More
@@ -1903,10 +1903,12 b' class localrepository(object):'
1903 break
1903 break
1904 if not fn:
1904 if not fn:
1905 fn = lambda s, c, **kwargs: procutil.filter(s, c)
1905 fn = lambda s, c, **kwargs: procutil.filter(s, c)
1906 fn.__name__ = 'commandfilter'
1906 # Wrap old filters not supporting keyword arguments
1907 # Wrap old filters not supporting keyword arguments
1907 if not pycompat.getargspec(fn)[2]:
1908 if not pycompat.getargspec(fn)[2]:
1908 oldfn = fn
1909 oldfn = fn
1909 fn = lambda s, c, **kwargs: oldfn(s, c)
1910 fn = lambda s, c, **kwargs: oldfn(s, c)
1911 fn.__name__ = 'compat-' + oldfn.__name__
1910 l.append((mf, fn, params))
1912 l.append((mf, fn, params))
1911 self._filterpats[filter] = l
1913 self._filterpats[filter] = l
1912 return self._filterpats[filter]
1914 return self._filterpats[filter]
@@ -1914,7 +1916,10 b' class localrepository(object):'
1914 def _filter(self, filterpats, filename, data):
1916 def _filter(self, filterpats, filename, data):
1915 for mf, fn, cmd in filterpats:
1917 for mf, fn, cmd in filterpats:
1916 if mf(filename):
1918 if mf(filename):
1917 self.ui.debug(b"filtering %s through %s\n" % (filename, cmd))
1919 self.ui.debug(
1920 b"filtering %s through %s\n"
1921 % (filename, cmd or pycompat.sysbytes(fn.__name__))
1922 )
1918 data = fn(data, cmd, ui=self.ui, repo=self, filename=filename)
1923 data = fn(data, cmd, ui=self.ui, repo=self, filename=filename)
1919 break
1924 break
1920
1925
@@ -187,21 +187,21 b' from tip ... which evidently is wrong:'
187 calling hook preupdate.eol: hgext.eol.preupdate
187 calling hook preupdate.eol: hgext.eol.preupdate
188 .hgeol: remote created -> g
188 .hgeol: remote created -> g
189 getting .hgeol
189 getting .hgeol
190 filtering .hgeol through
190 filtering .hgeol through compat-isbinary
191 a.txt: remote created -> g
191 a.txt: remote created -> g
192 getting a.txt
192 getting a.txt
193 filtering a.txt through
193 filtering a.txt through tolf
194 f: remote created -> g
194 f: remote created -> g
195 getting f
195 getting f
196 filtering f through
196 filtering f through tolf
197 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 $ hg st
198 $ hg st
199 M f
199 M f
200 $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate
200 $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate
201 $ hg up -C -r 0 -v --debug
201 $ hg up -C -r 0 -v --debug
202 eol: detected change in .hgeol
202 eol: detected change in .hgeol
203 filtering .hgeol through
203 filtering .hgeol through compat-isbinary
204 filtering a.txt through
204 filtering a.txt through tolf
205 resolving manifests
205 resolving manifests
206 branchmerge: False, force: True, partial: False
206 branchmerge: False, force: True, partial: False
207 ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db
207 ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db
@@ -263,20 +263,20 b' for f in revision 0, and it thus ends up'
263 calling hook preupdate.eol: hgext.eol.preupdate
263 calling hook preupdate.eol: hgext.eol.preupdate
264 .hgeol: remote is newer -> g
264 .hgeol: remote is newer -> g
265 getting .hgeol
265 getting .hgeol
266 filtering .hgeol through
266 filtering .hgeol through compat-isbinary
267 a.txt: remote is newer -> g
267 a.txt: remote is newer -> g
268 getting a.txt
268 getting a.txt
269 filtering a.txt through
269 filtering a.txt through tolf
270 f: remote is newer -> g
270 f: remote is newer -> g
271 getting f
271 getting f
272 filtering f through
272 filtering f through tolf
273 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274
274
275 $ touch .hgeol *
275 $ touch .hgeol *
276 $ hg st --debug
276 $ hg st --debug
277 eol: detected change in .hgeol
277 eol: detected change in .hgeol
278 filtering .hgeol through
278 filtering .hgeol through compat-isbinary
279 filtering a.txt through
279 filtering a.txt through tolf
280 M f
280 M f
281 $ hg diff
281 $ hg diff
282 diff --git a/f b/f
282 diff --git a/f b/f
@@ -291,8 +291,8 b' Workaround: Update again - this will rea'
291 $ touch .hgeol *
291 $ touch .hgeol *
292 $ hg up -C -r 0 -v --debug
292 $ hg up -C -r 0 -v --debug
293 eol: detected change in .hgeol
293 eol: detected change in .hgeol
294 filtering .hgeol through
294 filtering .hgeol through compat-isbinary
295 filtering a.txt through
295 filtering a.txt through tolf
296 resolving manifests
296 resolving manifests
297 branchmerge: False, force: True, partial: False
297 branchmerge: False, force: True, partial: False
298 ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db
298 ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db
@@ -304,8 +304,8 b' Workaround: Update again - this will rea'
304 $ touch .hgeol *
304 $ touch .hgeol *
305 $ hg st --debug
305 $ hg st --debug
306 eol: detected change in .hgeol
306 eol: detected change in .hgeol
307 filtering .hgeol through
307 filtering .hgeol through compat-isbinary
308 filtering a.txt through
308 filtering a.txt through tolf
309
309
310 $ cd ..
310 $ cd ..
311
311
General Comments 0
You need to be logged in to leave comments. Login now