On Mon, 27 Nov 2017 07:35:04 -0500, Yuya Nishihara <y...@tcha.org> wrote:
On Sun, 26 Nov 2017 20:11:25 -0500, Matt Harbison wrote:
On Sun, 26 Nov 2017 05:38:53 -0500, Yuya Nishihara <y...@tcha.org>
wrote:
> On Sat, 25 Nov 2017 23:53:45 -0500, Matt Harbison wrote:
>> It's probably beyond the scope of what you were fixing, but should
all
>> subrepo recursion be guarded like this?
>>
>> > sub = ctx.sub(subpath)
>> > try:
>> > submatch = matchmod.subdirmatcher(subpath, matcher)
>
> Maybe we'll need ctx.walksub(matcher) which yields (subrepo,
submatcher)
> pairs?
I like it.
I wonder if the exception handler that prints 'skipping..' can be rolled
in too.
I think that's up to a caller whether a missing subrepo can be ignored
or not.
I agree in theory. I was thinking if the majority of the callers did one
thing, the others could change the default behavior by passing an optional
callback. Or maybe there are a couple of predefined callback handlers,
and everyone has to pass one. (I wonder how many places aren't handling
the errors because of oversight.) But maybe that's too awkward.
At least cmdutil.add() and cmdutil.cat() catch different things,
and I have a vague recollection that there was also some uncaught
exception in this area. (I don't recall what it was, maybe the subrepo
being completely missing?)
Perhaps catching error.LookupError is wrong. It's the exception raised
when
ambiguous identifier is passed to repo[].
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel