[PATCH] log: prefer 'wctx' over 'pctx' for working context

Martin von Zweigbergk martinvonz at google.com
Thu Mar 19 11:41:58 CDT 2015


On Thu, Mar 19, 2015 at 9:38 AM Durham Goode <durham at fb.com> wrote:

>
>
> On 3/19/15 9:24 AM, Martin von Zweigbergk wrote:
>
>
>
> On Thu, Mar 19, 2015 at 9:19 AM Martin von Zweigbergk <
> martinvonz at google.com> wrote:
>
>> # HG changeset patch
>> # User Martin von Zweigbergk <martinvonz at google.com>
>> # Date 1426740265 25200
>> #      Wed Mar 18 21:44:25 2015 -0700
>> # Node ID ef0698d6c3bb363ec4d7face69409f6555d0e7c2
>> # Parent  5cb459dc32d209653a3e5d77749cf989ab9a51e4
>> log: prefer 'wctx' over 'pctx' for working context
>>
>>     diff -r 5cb459dc32d2 -r ef0698d6c3bb mercurial/cmdutil.py
>> --- a/mercurial/cmdutil.py      Tue Oct 28 22:32:18 2014 -0700
>> +++ b/mercurial/cmdutil.py      Wed Mar 18 21:44:25 2015 -0700
>> @@ -1924,12 +1924,12 @@
>>      # _matchfiles() revset but walkchangerevs() builds its matcher with
>>      # scmutil.match(). The difference is input pats are globbed on
>>      # platforms without shell expansion (windows).
>> -    pctx = repo[None]
>> -    match, pats = scmutil.matchandpats(pctx, pats, opts)
>> +    wctx = repo[None]
>> +    match, pats = scmutil.matchandpats(wctx, pats, opts)
>>      slowpath = match.anypats() or (match.files() and opts.get('removed'))
>>      if not slowpath:
>>          for f in match.files():
>> -            if follow and f not in pctx:
>> +            if follow and f not in wctx:
>>
>
>  Hmm... perhaps this was meant to be repo['.']? The error message soon
> after says "cannot follow file not in parent revision". Durham, you touched
> this code a while back (July 2014), do you have any idea?
>
>
> Yea, the message seems a bit wrong (but it's the message from prior to my
> change too).  Functionality wise I could see this going either way
> (repo['.'] or repo[None]).  Probably not a big deal though.
>

I think I'll do something else here, so please ignore this patch.

The way it currently works, you "hg log --follow contrib/mergetools.hgrc"
(a deleted file) fails, but if you touch the file first, it "works",
although I don't think it actually follow. We should probably change the
check.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150319/9bcdf604/attachment.html>


More information about the Mercurial-devel mailing list