[PATCH] fileset: evaluate status sets in working directory (BC)

Martin von Zweigbergk martinvonz at google.com
Fri Mar 20 22:39:28 CDT 2015


On Fri, Mar 20, 2015 at 8:10 PM Yuya Nishihara <yuya at tcha.org> wrote:

> On Fri, 20 Mar 2015 15:33:34 -0700, Martin von Zweigbergk wrote:
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz at google.com>
> > # Date 1426873345 25200
> > #      Fri Mar 20 10:42:25 2015 -0700
> > # Node ID bad329a772daa6daf111b3b5bd30e15a44394eb1
> > # Parent  dc7588ce06b30a6ef347f7554e9646ac00e4456a
> > fileset: evaluate status sets in working directory (BC)
> >
> > When no revision argument is given, it's probably a safe bet that
> > users expect filesets to be evaluated in the working directory, so
> > e.g. "hg revert 'set:modified()'" will revert the files modified in
> > the working directory, not files modified in revision '.', for
> > example. This also matches what "hg help filesets" says, which is
> > "...according to status" without mentioning any revisions.
> >
> > Now consider what context the filesets are evaluated in for the
> > following commands:
> >
> >  1. hg status -r $rev 'set:modified()'
> >  2. hg revert -r $rev 'set:modified()'
> >  3. hg files -r $rev 'set:modified()'
>
> What about "hg status --change $rev 'set:modified()'" ?
> I expect it is the same as "hg status --change $rev --modified".
>

I'm not sure what I would expect, but I'm glad to know about --modified,
which seems to provide the functionality that this patch is taking away :-)

>
> Another use of the current behavior is to archive changed files at that
> revision.
>
>   $ hg archive -r $rev -I 'set:added() or set:modified()'
>

That's a fair example that I don't have an answer for (before we make it
possible to pass a different context to the fileset). What do you use it
for?


>
> > Since it seems like the user should mostly want to have status
> > filesets evaluated against the working directory, and since that's
> > also what the documentation seems to suggests, let's make it so.
>
> IMHO, "revert" is the only exception that I expect fileset is evaluated
> against workingctx.
>
> > we can later add a revision argument to these filesets ("hg files -r $rev
> > 'set:modified($rev')") if we see a need.
>
> I don't think 'set:modified($rev)' would work well because a fileset
> function
> narrows down given subset, which might not include all files at $rev.
>

I guess I don't know enough about filesets to follow. What's the "given
subset" here? Could you give an example of how to produce such a subset
that doesn't include the files?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150321/261c2d5c/attachment.html>


More information about the Mercurial-devel mailing list