Patchwork [4,of,4,stable] largefiles: don't walk through all ignored files

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 21, 2012, 6:56 p.m.
Message ID <e4654db0c8f807bbc7d4.1356116164@mk-desktop>
Download mbox | patch
Permalink /patch/248/
State Accepted
Commit a907826c158cf53b8c3d5381323c039a10409c63
Headers show

Comments

Mads Kiilerich - Dec. 21, 2012, 6:56 p.m.
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1355422746 -3600
# Branch stable
# Node ID e4654db0c8f807bbc7d4ceaa30661dbbbbbbb234
# Parent  35c531de3fa7d96feca31fcff87d55b40dd8b45f
largefiles: don't walk through all ignored files

Problem: 'hg status' with largefiles enabled would walk through all ignored
files. That was obviously wrong and made it slow if a lot of files were
.hgignored or the cache was cold.

It seems like there was a reason to this, but other improvements has rendered
this unnecessary.

Solution: .hgignore is now only ignored when that is requested.

This is a minimal 'stable' change. There is room for other improvement.
Kevin Bullock - Dec. 21, 2012, 7:14 p.m.
On Dec 21, 2012, at 12:56 PM, Mads Kiilerich wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1355422746 -3600
> # Branch stable
> # Node ID e4654db0c8f807bbc7d4ceaa30661dbbbbbbb234
> # Parent  35c531de3fa7d96feca31fcff87d55b40dd8b45f
> largefiles: don't walk through all ignored files
> 
> Problem: 'hg status' with largefiles enabled would walk through all ignored
> files. That was obviously wrong and made it slow if a lot of files were
> .hgignored or the cache was cold.
> 
> It seems like there was a reason to this, but other improvements has rendered
> this unnecessary.
> 
> Solution: .hgignore is now only ignored when that is requested.

Eh? Do you mean "now only _consulted_" ?

pacem in terris / ??? / ?????? / ????????? / ??
Kevin R. Bullock
Mads Kiilerich - Dec. 21, 2012, 7:56 p.m.
On 12/21/2012 08:14 PM, Kevin Bullock wrote:
> On Dec 21, 2012, at 12:56 PM, Mads Kiilerich wrote:
>
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1355422746 -3600
>> # Branch stable
>> # Node ID e4654db0c8f807bbc7d4ceaa30661dbbbbbbb234
>> # Parent  35c531de3fa7d96feca31fcff87d55b40dd8b45f
>> largefiles: don't walk through all ignored files
>>
>> Problem: 'hg status' with largefiles enabled would walk through all ignored
>> files. That was obviously wrong and made it slow if a lot of files were
>> .hgignored or the cache was cold.
>>
>> It seems like there was a reason to this, but other improvements has rendered
>> this unnecessary.
>>
>> Solution: .hgignore is now only ignored when that is requested.
> Eh? Do you mean "now only _consulted_" ?

No. It always ran status as if --ignored had been specified. With this 
change it only ignores .hgignore if --ignore is specified. (I'm not sure 
it should obey the ignored flag at all when looking at lfdirstate ... 
but this is a conservative change.)

/Mads

Patch

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -164,10 +164,8 @@ 
                 m = copy.copy(match)
                 m._files = tostandins(m._files)
 
-                # Get ignored files here even if we weren't asked for them; we
-                # must use the result here for filtering later
                 result = super(lfilesrepo, self).status(node1, node2, m,
-                    True, clean, unknown, listsubrepos)
+                    ignored, clean, unknown, listsubrepos)
                 if working:
                     try:
                         # Any non-largefiles that were explicitly listed must be