Mercurial > public > mercurial-scm > hg
comparison mercurial/extensions.py @ 34088:a763c891f36e
wrapcommand: use functools.partial
Like the previous patch, this helps remove noises in traceback.
Practically, this removes another 6 lines in `rebase -s . -d .` traceback in
my setup:
....
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
-File "hg/mercurial/extensions.py", line 331, in closure
- return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "fb-hgext/hgext3rd/fbhistedit.py", line 283, in _rebase
return orig(ui, repo, **opts)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
-File "hg/mercurial/extensions.py", line 331, in closure
- return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "remotenames.py", line 633, in exrebasecmd
ret = orig(ui, repo, **opts)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
-File "hg/mercurial/extensions.py", line 331, in closure
- return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "fb-hgext/hgext3rd/fbamend/__init__.py", line 453, in wraprebase
return orig(ui, repo, **opts)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
....
Differential Revision: https://phab.mercurial-scm.org/D633
author | Jun Wu <quark@fb.com> |
---|---|
date | Tue, 05 Sep 2017 15:18:45 -0700 |
parents | 5361771f9714 |
children | 82bd4c5a81e5 |
comparison
equal
deleted
inserted
replaced
34087:5361771f9714 | 34088:a763c891f36e |
---|---|
375 if e is entry: | 375 if e is entry: |
376 key = alias | 376 key = alias |
377 break | 377 break |
378 | 378 |
379 origfn = entry[0] | 379 origfn = entry[0] |
380 wrap = bind(util.checksignature(wrapper), util.checksignature(origfn)) | 380 wrap = functools.partial(util.checksignature(wrapper), |
381 util.checksignature(origfn)) | |
381 _updatewrapper(wrap, origfn, wrapper) | 382 _updatewrapper(wrap, origfn, wrapper) |
382 if docstring is not None: | 383 if docstring is not None: |
383 wrap.__doc__ += docstring | 384 wrap.__doc__ += docstring |
384 | 385 |
385 newentry = list(entry) | 386 newentry = list(entry) |