##// END OF EJS Templates
narrowspec: replace one recursion-avoidance hack with another...
Martin von Zweigbergk -
r42603:4738c292 default
parent child Browse files
Show More
@@ -262,6 +262,9 b' def _writeaddedfiles(repo, pctx, files):'
262 262 mctx=repo['.'], overwrite=False)
263 263
264 264 def checkworkingcopynarrowspec(repo):
265 # Avoid infinite recursion when updating the working copy
266 if getattr(repo, '_updatingnarrowspec', False):
267 return
265 268 storespec = repo.svfs.tryread(FILENAME)
266 269 wcspec = repo.vfs.tryread(DIRSTATE_FILENAME)
267 270 if wcspec != storespec:
@@ -276,6 +279,7 b' def updateworkingcopy(repo, assumeclean='
276 279 """
277 280 oldspec = repo.vfs.tryread(DIRSTATE_FILENAME)
278 281 newspec = repo.svfs.tryread(FILENAME)
282 repo._updatingnarrowspec = True
279 283
280 284 oldincludes, oldexcludes = parseconfig(repo.ui, oldspec)
281 285 newincludes, newexcludes = parseconfig(repo.ui, newspec)
@@ -305,10 +309,9 b' def updateworkingcopy(repo, assumeclean='
305 309 for f in clean + trackeddirty:
306 310 ds.drop(f)
307 311
308 repo.narrowpats = newincludes, newexcludes
309 repo._narrowmatch = newmatch
310 312 pctx = repo['.']
311 313 newfiles = [f for f in pctx.manifest().walk(addedmatch) if f not in ds]
312 314 for f in newfiles:
313 315 ds.normallookup(f)
314 316 _writeaddedfiles(repo, pctx, newfiles)
317 repo._updatingnarrowspec = False
General Comments 0
You need to be logged in to leave comments. Login now