Quantcast

[PATCH 1 of 4] largefiles: use repo[None].walk instead of repo.walk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 1 of 4] largefiles: use repo[None].walk instead of repo.walk

Augie Fackler-2
# HG changeset patch
# User Augie Fackler <[hidden email]>
# Date 1495144838 14400
#      Thu May 18 18:00:38 2017 -0400
# Node ID ea89086c4346e5f38bb1ccb4ea5fa0239ab0c931
# Parent  531e6a57abd252bef59a5921e3761f1e5d80abba
largefiles: use repo[None].walk instead of repo.walk

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -119,7 +119,7 @@ def addlargefiles(ui, repo, isaddremove,
     m = matcher
 
     wctx = repo[None]
-    for f in repo.walk(matchmod.badmatch(m, lambda x, y: None)):
+    for f in repo[None].walk(matchmod.badmatch(m, lambda x, y: None)):
         exact = m.exact(f)
         lfile = lfutil.standin(f) in wctx
         nfile = f in wctx
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 2 of 4] cmdutil: use repo[None].walk instead of repo.walk

Augie Fackler-2
# HG changeset patch
# User Augie Fackler <[hidden email]>
# Date 1495144852 14400
#      Thu May 18 18:00:52 2017 -0400
# Node ID fbe9d489a31ebac315164fbbb11989ab48faee43
# Parent  ea89086c4346e5f38bb1ccb4ea5fa0239ab0c931
cmdutil: use repo[None].walk instead of repo.walk

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -608,7 +608,7 @@ def copy(ui, repo, pats, opts, rename=Fa
         else:
             badstates = '?r'
         m = scmutil.match(repo[None], [pat], opts, globbed=True)
-        for abs in repo.walk(m):
+        for abs in repo[None].walk(m):
             state = repo.dirstate[abs]
             rel = m.rel(abs)
             exact = m.exact(abs)
@@ -2940,7 +2940,8 @@ def revert(ui, repo, ctx, parents, *pats
         targetsubs = sorted(s for s in wctx.substate if m(s))
 
         if not m.always():
-            for abs in repo.walk(matchmod.badmatch(m, lambda x, y: False)):
+            matcher = matchmod.badmatch(m, lambda x, y: False)
+            for abs in repo[None].walk(matcher):
                 names[abs] = m.rel(abs), m.exact(abs)
 
             # walk target manifest to fill `names`
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 3 of 4] debugcommands: use repo[None].walk instead of repo.walk

Augie Fackler-2
In reply to this post by Augie Fackler-2
# HG changeset patch
# User Augie Fackler <[hidden email]>
# Date 1495144861 14400
#      Thu May 18 18:01:01 2017 -0400
# Node ID d915f006acf67a7f8f57526a697f498cea3830cc
# Parent  fbe9d489a31ebac315164fbbb11989ab48faee43
debugcommands: use repo[None].walk instead of repo.walk

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2167,7 +2167,7 @@ def debugupgraderepo(ui, repo, run=False
 def debugwalk(ui, repo, *pats, **opts):
     """show how files match on given patterns"""
     m = scmutil.match(repo[None], pats, opts)
-    items = list(repo.walk(m))
+    items = list(repo[None].walk(m))
     if not items:
         return
     f = lambda fn: fn
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 4 of 4] localrepo: mark walk convenience method as deprecated

Augie Fackler-2
In reply to this post by Augie Fackler-2
# HG changeset patch
# User Augie Fackler <[hidden email]>
# Date 1495144908 14400
#      Thu May 18 18:01:48 2017 -0400
# Node ID 2166762eadc440a70f8bcfbae6248e2ce2712b64
# Parent  d915f006acf67a7f8f57526a697f498cea3830cc
localrepo: mark walk convenience method as deprecated

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1869,6 +1869,7 @@ class localrepository(object):
         changeset, finding all files matched by the match
         function
         '''
+        self.ui.deprecwarn('use repo[node].walk instead of repo.walk', '4.3')
         return self[node].walk(match)
 
     def status(self, node1='.', node2=None, match=None,
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 4 of 4] localrepo: mark walk convenience method as deprecated

Yuya Nishihara
On Fri, 19 May 2017 17:39:20 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <[hidden email]>
> # Date 1495144908 14400
> #      Thu May 18 18:01:48 2017 -0400
> # Node ID 2166762eadc440a70f8bcfbae6248e2ce2712b64
> # Parent  d915f006acf67a7f8f57526a697f498cea3830cc
> localrepo: mark walk convenience method as deprecated

Flagged this as (API) and queued, thanks.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 1 of 4] largefiles: use repo[None].walk instead of repo.walk

Martin von Zweigbergk via Mercurial-devel
In reply to this post by Augie Fackler-2
On Fri, May 19, 2017 at 2:39 PM, Augie Fackler <[hidden email]> wrote:

> # HG changeset patch
> # User Augie Fackler <[hidden email]>
> # Date 1495144838 14400
> #      Thu May 18 18:00:38 2017 -0400
> # Node ID ea89086c4346e5f38bb1ccb4ea5fa0239ab0c931
> # Parent  531e6a57abd252bef59a5921e3761f1e5d80abba
> largefiles: use repo[None].walk instead of repo.walk
>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -119,7 +119,7 @@ def addlargefiles(ui, repo, isaddremove,
>      m = matcher
>
>      wctx = repo[None]
> -    for f in repo.walk(matchmod.badmatch(m, lambda x, y: None)):
> +    for f in repo[None].walk(matchmod.badmatch(m, lambda x, y: None)):

Nit: could reuse the existing wctx here and in the next patch. I'll
fix that in a followup since I'm still not sure how our tooling keeps
track of accepts across obsmarkers and/or if pushing still menas
accepting everything pushed.

>          exact = m.exact(f)
>          lfile = lfutil.standin(f) in wctx
>          nfile = f in wctx
> _______________________________________________
> Mercurial-devel mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 1 of 4] largefiles: use repo[None].walk instead of repo.walk

Augie Fackler-2

> On May 20, 2017, at 22:30, Martin von Zweigbergk <[hidden email]> wrote:
>
> On Fri, May 19, 2017 at 2:39 PM, Augie Fackler <[hidden email]> wrote:
>> # HG changeset patch
>> # User Augie Fackler <[hidden email]>
>> # Date 1495144838 14400
>> #      Thu May 18 18:00:38 2017 -0400
>> # Node ID ea89086c4346e5f38bb1ccb4ea5fa0239ab0c931
>> # Parent  531e6a57abd252bef59a5921e3761f1e5d80abba
>> largefiles: use repo[None].walk instead of repo.walk
>>
>> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
>> --- a/hgext/largefiles/overrides.py
>> +++ b/hgext/largefiles/overrides.py
>> @@ -119,7 +119,7 @@ def addlargefiles(ui, repo, isaddremove,
>>     m = matcher
>>
>>     wctx = repo[None]
>> -    for f in repo.walk(matchmod.badmatch(m, lambda x, y: None)):
>> +    for f in repo[None].walk(matchmod.badmatch(m, lambda x, y: None)):
>
> Nit: could reuse the existing wctx here and in the next patch. I'll
> fix that in a followup since

> I'm still not sure how our tooling keeps
> track of accepts across obsmarkers

It doesn't chase obsmarkers on purpose, but it does look for things that are the same patch content. https://www.mercurial-scm.org/repo/accept/file/tip/tests/test-diffhashes.t might help explain the logic.

> and/or if pushing still menas
> accepting everything pushed.

It still does. :)

>
>>         exact = m.exact(f)
>>         lfile = lfutil.standin(f) in wctx
>>         nfile = f in wctx
>> _______________________________________________
>> Mercurial-devel mailing list
>> [hidden email]
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 1 of 4] largefiles: use repo[None].walk instead of repo.walk

Martin von Zweigbergk via Mercurial-devel
On Sat, May 20, 2017 at 10:32 PM, Augie Fackler <[hidden email]> wrote:

>
>> On May 20, 2017, at 22:30, Martin von Zweigbergk <[hidden email]> wrote:
>>
>> On Fri, May 19, 2017 at 2:39 PM, Augie Fackler <[hidden email]> wrote:
>>> # HG changeset patch
>>> # User Augie Fackler <[hidden email]>
>>> # Date 1495144838 14400
>>> #      Thu May 18 18:00:38 2017 -0400
>>> # Node ID ea89086c4346e5f38bb1ccb4ea5fa0239ab0c931
>>> # Parent  531e6a57abd252bef59a5921e3761f1e5d80abba
>>> largefiles: use repo[None].walk instead of repo.walk
>>>
>>> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
>>> --- a/hgext/largefiles/overrides.py
>>> +++ b/hgext/largefiles/overrides.py
>>> @@ -119,7 +119,7 @@ def addlargefiles(ui, repo, isaddremove,
>>>     m = matcher
>>>
>>>     wctx = repo[None]
>>> -    for f in repo.walk(matchmod.badmatch(m, lambda x, y: None)):
>>> +    for f in repo[None].walk(matchmod.badmatch(m, lambda x, y: None)):
>>
>> Nit: could reuse the existing wctx here and in the next patch. I'll
>> fix that in a followup since
>
>> I'm still not sure how our tooling keeps
>> track of accepts across obsmarkers
>
> It doesn't chase obsmarkers on purpose, but it does look for things that are the same patch content. https://www.mercurial-scm.org/repo/accept/file/tip/tests/test-diffhashes.t might help explain the logic.

Ah, makes sense, that's even better. Thanks.

>
>> and/or if pushing still menas
>> accepting everything pushed.
>
> It still does. :)
>
>>
>>>         exact = m.exact(f)
>>>         lfile = lfutil.standin(f) in wctx
>>>         nfile = f in wctx
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> [hidden email]
>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Loading...