Patchwork [1,of,3] log: use an exact matcher for --patch --follow

login
register
mail settings
Submitter Siddharth Agarwal
Date July 13, 2014, 1:41 a.m.
Message ID <6ba1d8cf21e5dfc86c05.1405215660@dev1738.prn1.facebook.com>
Download mbox | patch
Permalink /patch/5156/
State Accepted
Commit e2530d4a47c10670409c4166b1b567f20af11089
Headers show

Comments

Siddharth Agarwal - July 13, 2014, 1:41 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1405215078 25200
#      Sat Jul 12 18:31:18 2014 -0700
# Node ID 6ba1d8cf21e5dfc86c05b9eb856d99831eeb720b
# Parent  0541680b3ed0f7068efcd2baa7696d2d07740605
log: use an exact matcher for --patch --follow

The arguments to log --patch --follow are expected to be exact paths.

This will be used to make manifest filtering for these cases more efficient in
upcoming patches.
Siddharth Agarwal - July 13, 2014, 1:51 a.m.
On 07/12/2014 06:41 PM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1405215078 25200
> #      Sat Jul 12 18:31:18 2014 -0700
> # Node ID 6ba1d8cf21e5dfc86c05b9eb856d99831eeb720b
> # Parent  0541680b3ed0f7068efcd2baa7696d2d07740605
> log: use an exact matcher for --patch --follow

These patches are logically independent of, but I wrote them on top of, 
my earlier patch "log: make --patch --follow work inside a subdirectory".

>
> The arguments to log --patch --follow are expected to be exact paths.
>
> This will be used to make manifest filtering for these cases more efficient in
> upcoming patches.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1499,7 +1499,6 @@
>       fcache = {}
>       fcacheready = [False]
>       pctx = repo['.']
> -    wctx = repo[None]
>   
>       def populate():
>           for fn in files:
> @@ -1512,7 +1511,7 @@
>               # Lazy initialization
>               fcacheready[0] = True
>               populate()
> -        return scmutil.match(wctx, fcache.get(rev, []), default='path')
> +        return scmutil.matchfiles(repo, fcache.get(rev, []))
>   
>       return filematcher
>   
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1499,7 +1499,6 @@ 
     fcache = {}
     fcacheready = [False]
     pctx = repo['.']
-    wctx = repo[None]
 
     def populate():
         for fn in files:
@@ -1512,7 +1511,7 @@ 
             # Lazy initialization
             fcacheready[0] = True
             populate()
-        return scmutil.match(wctx, fcache.get(rev, []), default='path')
+        return scmutil.matchfiles(repo, fcache.get(rev, []))
 
     return filematcher