This is an archive of the discontinued Mercurial Phabricator instance.

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

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



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

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

Event Timeline

Alphare created this revision.Nov 6 2019, 10:24 AM
Alphare added a comment.EditedNov 6 2019, 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>
  File "/home/alphare/hg/mercurial/", line 111, in run
    status = dispatch(req)
  File "/home/alphare/hg/mercurial/", line 250, in dispatch
    ret = _runcatch(req) or 0
  File "/home/alphare/hg/mercurial/", line 424, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/home/alphare/hg/mercurial/", line 433, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/home/alphare/hg/mercurial/", line 177, in callcatch
    return func()
  File "/home/alphare/hg/mercurial/", line 414, in _runcatchfunc
    return _dispatch(req)
  File "/home/alphare/hg/mercurial/", line 1174, in _dispatch
    lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
  File "/home/alphare/hg/mercurial/", line 862, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/alphare/hg/mercurial/", line 1185, in _runcommand
    return cmdfunc()
  File "/home/alphare/hg/mercurial/", line 1171, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/home/alphare/hg/mercurial/", line 1843, in check
    return func(*args, **kwargs)
  File "/home/alphare/hg/hgext/", line 204, in inner
    return fn(*args, **kwargs)
  File "/home/alphare/hg/hgext/", line 1158, in phabsend
  File "/home/alphare/hg/mercurial/", 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.Nov 6 2019, 12:36 PM
kevincox accepted this revision.Nov 6 2019, 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.