( )⚙ D633 wrapcommand: use functools.partial

This is an archive of the discontinued Mercurial Phabricator instance.

wrapcommand: use functools.partial
ClosedPublic

Authored by quark on Sep 5 2017, 7:48 PM.

Details

Summary

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)
 ....

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

quark created this revision.Sep 5 2017, 7:48 PM
quark edited the summary of this revision. (Show Details)Sep 5 2017, 7:51 PM
quark retitled this revision from wrapcommand: use functools.partial to rapcommand: use functools.partial.
quark retitled this revision from rapcommand: use functools.partial to wrapcommand: use functools.partial.
phillco accepted this revision.Sep 6 2017, 6:03 PM
quark edited the summary of this revision. (Show Details)Sep 6 2017, 8:34 PM
quark updated this revision to Diff 1679.Sep 7 2017, 6:08 PM

Seems unlikely enough that someone passes a bound method as command wrapper. Queued.

This revision was automatically updated to reflect the committed changes.