Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/reposetup.py @ 16282:50247a7a9983 stable
largefiles: use 'dirstate.dirs()' for 'directory pattern' relation check
original implementation queries whether specified pattern is related
or not to largefiles in target context by 'dirstate.__contains__()'.
but this can't recognize 'directory pattern' correctly, so this patch
uses 'dirstate.dirs()' for it.
this patch uses dirstate instead of lfdirstate in 'working' route
(second patch hunk for 'hgext/largefiles/reposetup.py'), because
'dirs()' information may be already built for dirstate but not yet for
lfdirstate at this point. this prevents lfdirstate from building up
and having 'dirs()' information.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 22 Mar 2012 23:58:47 +0900 |
parents | d8cc67114dc3 |
children | e53c0b2d7b60 |
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py Thu Mar 22 23:58:47 2012 +0900 +++ b/hgext/largefiles/reposetup.py Thu Mar 22 23:58:47 2012 +0900 @@ -137,8 +137,11 @@ # Create a copy of match that matches standins instead # of largefiles. def tostandin(file): - if working and lfutil.standin(file) in repo.dirstate: - return lfutil.standin(file) + if working: + sf = lfutil.standin(file) + dirstate = repo.dirstate + if sf in dirstate or sf in dirstate.dirs(): + return sf return file # Create a function that we can use to override what is @@ -167,8 +170,12 @@ orig_ignore = lfdirstate._ignore lfdirstate._ignore = _ignoreoverride - match._files = [f for f in match._files if f in - lfdirstate] + def sfindirstate(f): + sf = lfutil.standin(f) + dirstate = repo.dirstate + return sf in dirstate or sf in dirstate.dirs() + match._files = [f for f in match._files + if sfindirstate(f)] # Don't waste time getting the ignored and unknown # files again; we already have them s = lfdirstate.status(match, [], False,