[PATCH 1 of 2 stable] fileset: add tests of generated working copy states

Martin von Zweigbergk martinvonz at google.com
Fri Jan 23 11:55:40 CST 2015


+Pierre-Yves & Mathias (others: sorry about the spam)

On Fri Jan 23 2015 at 9:47:01 AM Martin von Zweigbergk <
martinvonz at google.com> wrote:

> On Fri Jan 23 2015 at 9:39:06 AM Martin von Zweigbergk <
> martinvonz at google.com> wrote:
>
>> On Fri Jan 23 2015 at 4:08:34 AM Yuya Nishihara <yuya at tcha.org> wrote:
>>
>>> I got many diffs with quick workaround for issue4497.
>>>
>>> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
>>> --- a/mercurial/cmdutil.py
>>> +++ b/mercurial/cmdutil.py
>>> @@ -2578,7 +2578,8 @@ def revert(ui, repo, ctx, parents, *pats
>>>                          return
>>>                  ui.warn("%s: %s\n" % (m.rel(path), msg))
>>>
>>> -            m = scmutil.match(ctx, pats, opts)
>>> +            # XXX not work with largefiles, can't use 'set:**', etc.
>>> +            m = scmutil.match(repo[None], pats, opts)
>>>
>>
>> That same patch was my first attempt too, but it seems to be a deeper
>> issue of what context to evaluate the filesets in. Filesets accept a
>> revision so you can do things like " hg files 'set:added()' -r
>> bead0c7b4f68" and see which files were added in that revision. However,
>> while most people expect "hg revert 'set:added()'" to revert added files
>> (i.e. to forget them), since that is equivalent to "hg revert -r .
>> 'set:added()'" it also makes sense to say that set:added() should be
>> evaluated in '.'. Perhaps the answer is, as I think Pierre-Yves suggested,
>> to add a revision parameter to set:added() and make it default to the
>> working copy, so "hg revert 'set:added()'" still reverts to the parent of
>> the working copy, but the fileset is evaluated against the working copy.
>> That would mean that "hg files 'set:added()' -r bead0c7b4f68" instead has
>> to be written "hg files 'set:added(bead0c7b4f68)'". What do you think?
>>
>>
> Wait, that "hg files 'set:added(bead0c7b4f68)'" should have been "hg files
> 'set:added(bead0c7b4f68)' -r bead0c7b4f68" in order to list the files in
> that revision that were added in that revision, not the files in the
> working copy (?) that were added in that revision. This is confusing :-(
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150123/a488f7cd/attachment.html>


More information about the Mercurial-devel mailing list