comparison hgext/remotefilelog/shallowrepo.py @ 41077:517a51d9cd7f

remotefilelog: fix bug in maybesparsematch returning alwaysmatcher The description of the method says that it should return None if sparse is not used in this repository; since sparse.matcher() returns alwaysmatcher if sparse is not enabled, I'm using that as the signal to return None here to preserve the previous behavior. Differential Revision: https://phab.mercurial-scm.org/D5487
author Kyle Lippincott <spectral@google.com>
date Thu, 27 Dec 2018 15:19:46 -0800
parents b6a6dc1a14bd
children 0531dff73d0b
comparison
equal deleted inserted replaced
41076:8ecb17b7f432 41077:517a51d9cd7f
141 A wrapper that allows the remotefilelog to invoke sparsematch() if 141 A wrapper that allows the remotefilelog to invoke sparsematch() if
142 this is a sparse repository, or returns None if this is not a 142 this is a sparse repository, or returns None if this is not a
143 sparse repository. 143 sparse repository.
144 ''' 144 '''
145 if revs: 145 if revs:
146 return sparse.matcher(repo, revs=revs) 146 ret = sparse.matcher(repo, revs=revs)
147 return sparse.matcher(repo) 147 else:
148 ret = sparse.matcher(repo)
149
150 if ret.always():
151 return None
152 return ret
148 153
149 def file(self, f): 154 def file(self, f):
150 if f[0] == '/': 155 if f[0] == '/':
151 f = f[1:] 156 f = f[1:]
152 157