Page MenuHomePhabricator

rust-matchers: remove default implementations for `Matcher` trait
ClosedPublic

Authored by Alphare on Wed, Nov 6, 10:24 AM.

Details

Summary

We don't expect a whole lot of matchers to be defined, and this makes it more
obvious what a matcher does by reading its impl Matcher for FooMatcher.

This patch has the added benefit of fixing the AlwaysMatcher, its matches
function differs from the former default.

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

Alphare created this revision.Wed, Nov 6, 10:24 AM
Alphare added a comment.EditedWed, Nov 6, 10:27 AM

phabsend failed with the following:

** Unknown exception encountered with possibly-broken third-party extension perf
** which supports versions unknown of Mercurial.
** Please disable perf and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.15 (default, Feb 11 2019, 16:23:45) [GCC 8.2.0]
** Mercurial Distributed SCM (version 5.2rc0+2-dcf396551305)
** Extensions loaded: evolve, topic, patchbomb, rebase, absorb, phabricator, histedit, formatsource, perf, fix
Traceback (most recent call last):
  File "/home/alphare/hg/hg", line 36, in <module>
    dispatch.run()
  File "/home/alphare/hg/mercurial/dispatch.py", line 111, in run
    status = dispatch(req)
  File "/home/alphare/hg/mercurial/dispatch.py", line 250, in dispatch
    ret = _runcatch(req) or 0
  File "/home/alphare/hg/mercurial/dispatch.py", line 424, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/home/alphare/hg/mercurial/dispatch.py", line 433, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/home/alphare/hg/mercurial/scmutil.py", line 177, in callcatch
    return func()
  File "/home/alphare/hg/mercurial/dispatch.py", line 414, in _runcatchfunc
    return _dispatch(req)
  File "/home/alphare/hg/mercurial/dispatch.py", line 1174, in _dispatch
    lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
  File "/home/alphare/hg/mercurial/dispatch.py", line 862, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/alphare/hg/mercurial/dispatch.py", line 1185, in _runcommand
    return cmdfunc()
  File "/home/alphare/hg/mercurial/dispatch.py", line 1171, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/home/alphare/hg/mercurial/util.py", line 1843, in check
    return func(*args, **kwargs)
  File "/home/alphare/hg/hgext/phabricator.py", line 204, in inner
    return fn(*args, **kwargs)
  File "/home/alphare/hg/hgext/phabricator.py", line 1158, in phabsend
    extra=old.extra(),
  File "/home/alphare/hg/mercurial/context.py", line 2885, in __init__
    r"can't reuse the manifest: its p1 "
RuntimeError: can't reuse the manifest: its p1 doesn't match the new ctx p1

I'll have to figure out which extension broke.

EDIT: somehow I managed to empty my changeset (whether that's a bug in my brain or in mercurial remains to be seen ;) ), and phabsend does not handle empty changesets gracefully.

Alphare updated this revision to Diff 17626.Wed, Nov 6, 12:36 PM
kevincox accepted this revision.Wed, Nov 6, 12:43 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.