Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG056a9c8813aa: py3: handle keyword arguments correctly in hook.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| durin42 |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| raise error.HookLoadError( | raise error.HookLoadError( | ||||
| _('%s hook is invalid: "%s" is not callable') | _('%s hook is invalid: "%s" is not callable') | ||||
| % (hname, funcname)) | % (hname, funcname)) | ||||
| ui.note(_("calling hook %s: %s\n") % (hname, funcname)) | ui.note(_("calling hook %s: %s\n") % (hname, funcname)) | ||||
| starttime = util.timer() | starttime = util.timer() | ||||
| try: | try: | ||||
| r = obj(ui=ui, repo=repo, hooktype=htype, **args) | r = obj(ui=ui, repo=repo, hooktype=htype, **pycompat.strkwargs(args)) | ||||
| except Exception as exc: | except Exception as exc: | ||||
| if isinstance(exc, error.Abort): | if isinstance(exc, error.Abort): | ||||
| ui.warn(_('error: %s hook failed: %s\n') % | ui.warn(_('error: %s hook failed: %s\n') % | ||||
| (hname, exc.args[0])) | (hname, exc.args[0])) | ||||
| else: | else: | ||||
| ui.warn(_('error: %s hook raised an exception: ' | ui.warn(_('error: %s hook raised an exception: ' | ||||
| '%s\n') % (hname, encoding.strtolocal(str(exc)))) | '%s\n') % (hname, encoding.strtolocal(str(exc)))) | ||||
| if throw: | if throw: | ||||