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

Martin von Zweigbergk martinvonz at google.com
Thu Mar 19 11:24:15 CDT 2015


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 hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py     Tue Oct 28 22:32:18 2014 -0700
> +++ b/hgext/largefiles/overrides.py     Wed Mar 18 21:44:25 2015 -0700
> @@ -376,8 +376,8 @@
>      # The magic matchandpats override should be used for case (1) but not
> for
>      # case (2).
>      def overridemakelogfilematcher(repo, pats, opts):
> -        pctx = repo[None]
> -        match, pats = oldmatchandpats(pctx, pats, opts)
> +        wctx = repo[None]
> +        match, pats = oldmatchandpats(wctx, pats, opts)
>          return lambda rev: match
>
>      oldmatchandpats = installmatchandpatsfn(overridematchandpats)
> 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?


>                  # If the file exists, it may be a directory, so let it
>                  # take the slow path.
>                  if os.path.exists(repo.wjoin(f)):
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150319/dc761225/attachment.html>


More information about the Mercurial-devel mailing list