This is an archive of the discontinued Mercurial Phabricator instance.

sparse: rework debugsparse's interface
ClosedPublic

Authored by valentin.gatienbaron on Feb 8 2022, 11:32 PM.

Details

Summary

hg debugsparse supports arguments like --include, similar to `hg
tracked --addinclude` or hg log --include. But in hg debugsparse,
the pattern is not an argument of the flag, instead the patterns are
the anonymous command line arguments.

Not only is this surprising, it makes it impossible to use --include
and --exclude in the same invocation, or --reset --exclude.

So I propose making debugsparse making --include, --exclude take an
argument, and rejecting anonymous command line arguments, as well as
allowing mixing several of these flags in one invocations.

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

I don't know if we have dropped py2 by now or not.

We're dropping Python 2 right after the 6.1 release due for on or around March 1st. Provided this can wait about a month, we can just take it as is then.

As for the patch, I've not read it in detail yet, but the overall idea seems sane to me.

valentin.gatienbaron edited the summary of this revision. (Show Details)Feb 9 2022, 6:29 PM
valentin.gatienbaron updated this revision to Diff 32111.

I don't know if we have dropped py2 by now or not.

We're dropping Python 2 right after the 6.1 release due for on or around March 1st. Provided this can wait about a month, we can just take it as is then.

Ok. I just dropped the part of the diff that required py3 then. It's not essential at all.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.