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

login
register
mail settings
Submitter Augie Fackler
Date May 19, 2017, 9:39 p.m.
Message ID <ea89086c4346e5f38bb1.1495229957@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/20744/
State Accepted
Headers show

Comments

Augie Fackler - May 19, 2017, 9:39 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# 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
via Mercurial-devel - May 21, 2017, 5:30 a.m.
On Fri, May 19, 2017 at 2:39 PM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # 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
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Augie Fackler - May 21, 2017, 5:32 a.m.
> On May 20, 2017, at 22:30, Martin von Zweigbergk <martinvonz@google.com> wrote:
> 
> On Fri, May 19, 2017 at 2:39 PM, Augie Fackler <raf@durin42.com> wrote:
>> # HG changeset patch
>> # User Augie Fackler <augie@google.com>
>> # 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
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
via Mercurial-devel - May 21, 2017, 5:36 a.m.
On Sat, May 20, 2017 at 10:32 PM, Augie Fackler <raf@durin42.com> wrote:
>
>> On May 20, 2017, at 22:30, Martin von Zweigbergk <martinvonz@google.com> wrote:
>>
>> On Fri, May 19, 2017 at 2:39 PM, Augie Fackler <raf@durin42.com> wrote:
>>> # HG changeset patch
>>> # User Augie Fackler <augie@google.com>
>>> # 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
>>> Mercurial-devel@mercurial-scm.org
>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

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