[PATCH 3 of 8 STABLE RFC] largefiles: use duplicated 'match' object to modify it

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Feb 17 10:07:29 CST 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1329494572 -32400
# Branch stable
# Node ID 5a568b210fe58273670925aef2278c5fc0d059e0
# Parent  7a58a75274f8356ea503f207a321033023daf371
largefiles: use duplicated 'match' object to modify it

current implementation of 'lfiles_repo.status()' modifies '_files'
field of specified 'match' object directory, but caller of
'repo.status()' does not provide against such cases.

this patch uses duplicated 'match' object for safety.

this patch also does "m._fmap = set(m._files)" to keep internal
consistency in "match", even though this is required only in cases
using "match.exact(f)".

diff -r 7a58a75274f8 -r 5a568b210fe5 hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py	Sat Feb 18 01:02:52 2012 +0900
+++ b/hgext/largefiles/reposetup.py	Sat Feb 18 01:02:52 2012 +0900
@@ -172,8 +172,10 @@
                         orig_ignore = lfdirstate._ignore
                         lfdirstate._ignore = _ignoreoverride
 
+                        match = copy.copy(match)
                         match._files = [f for f in match._files if f in
                             lfdirstate]
+                        match._fmap = set(match._files)
                         # Don't waste time getting the ignored and unknown
                         # files again; we already have them
                         s = lfdirstate.status(match, [], False,


More information about the Mercurial-devel mailing list