# HG changeset patch # User Mads Kiilerich # Date 1570970400 -7200 # Node ID 6ceb3721e2035aeaffdaa1941b20ddabc6a688ce # Parent a819b5777727a42f568c139b70a02fb74f17e127 localrepo: debug log of filter name when filtering through a function diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1903,10 +1903,12 @@ break if not fn: fn = lambda s, c, **kwargs: procutil.filter(s, c) + fn.__name__ = 'commandfilter' # Wrap old filters not supporting keyword arguments if not pycompat.getargspec(fn)[2]: oldfn = fn fn = lambda s, c, **kwargs: oldfn(s, c) + fn.__name__ = 'compat-' + oldfn.__name__ l.append((mf, fn, params)) self._filterpats[filter] = l return self._filterpats[filter] @@ -1914,7 +1916,10 @@ def _filter(self, filterpats, filename, data): for mf, fn, cmd in filterpats: if mf(filename): - self.ui.debug(b"filtering %s through %s\n" % (filename, cmd)) + self.ui.debug( + b"filtering %s through %s\n" + % (filename, cmd or pycompat.sysbytes(fn.__name__)) + ) data = fn(data, cmd, ui=self.ui, repo=self, filename=filename) break diff --git a/tests/test-eol-update.t b/tests/test-eol-update.t --- a/tests/test-eol-update.t +++ b/tests/test-eol-update.t @@ -187,21 +187,21 @@ calling hook preupdate.eol: hgext.eol.preupdate .hgeol: remote created -> g getting .hgeol - filtering .hgeol through + filtering .hgeol through compat-isbinary a.txt: remote created -> g getting a.txt - filtering a.txt through + filtering a.txt through tolf f: remote created -> g getting f - filtering f through + filtering f through tolf 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg st M f $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate $ hg up -C -r 0 -v --debug eol: detected change in .hgeol - filtering .hgeol through - filtering a.txt through + filtering .hgeol through compat-isbinary + filtering a.txt through tolf resolving manifests branchmerge: False, force: True, partial: False ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db @@ -263,20 +263,20 @@ calling hook preupdate.eol: hgext.eol.preupdate .hgeol: remote is newer -> g getting .hgeol - filtering .hgeol through + filtering .hgeol through compat-isbinary a.txt: remote is newer -> g getting a.txt - filtering a.txt through + filtering a.txt through tolf f: remote is newer -> g getting f - filtering f through + filtering f through tolf 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ touch .hgeol * $ hg st --debug eol: detected change in .hgeol - filtering .hgeol through - filtering a.txt through + filtering .hgeol through compat-isbinary + filtering a.txt through tolf M f $ hg diff diff --git a/f b/f @@ -291,8 +291,8 @@ $ touch .hgeol * $ hg up -C -r 0 -v --debug eol: detected change in .hgeol - filtering .hgeol through - filtering a.txt through + filtering .hgeol through compat-isbinary + filtering a.txt through tolf resolving manifests branchmerge: False, force: True, partial: False ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db @@ -304,8 +304,8 @@ $ touch .hgeol * $ hg st --debug eol: detected change in .hgeol - filtering .hgeol through - filtering a.txt through + filtering .hgeol through compat-isbinary + filtering a.txt through tolf $ cd ..