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

Martin von Zweigbergk martinvonz at google.com
Fri Mar 20 23:21:04 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".
>
> Another use of the current behavior is to archive changed files at that
> revision.
>
>   $ hg archive -r $rev -I 'set:added() or set:modified()'
>
> > 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.
>

Actually, revert is why I sent this patch. While I do think the other cases
I listed are also not what I expect, I think the bug in revert is a deeper
one. I tried fixing it in a better way (which I only now realize was in
fact better), but largefiles is a mess and...


>
> > 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.
>
> Regards,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150321/b7a9e8d9/attachment.html>


More information about the Mercurial-devel mailing list