##// END OF EJS Templates
narrow: copy store narrowspec to working copy immediately...
Martin von Zweigbergk -
r41265:50ca531f default
parent child Browse files
Show More
@@ -432,9 +432,9 b' def trackedcmd(ui, repo, remotepath=None'
432 432 return 0
433 433
434 434 if update_working_copy:
435 with repo.wlock(), repo.lock(), repo.transaction('narrow-wc') as tr:
435 with repo.wlock(), repo.lock(), repo.transaction('narrow-wc'):
436 436 narrowspec.updateworkingcopy(repo)
437 narrowspec.copytoworkingcopy(repo, tr)
437 narrowspec.copytoworkingcopy(repo)
438 438 return 0
439 439
440 440 if not widening and not narrowing:
@@ -334,7 +334,7 b' def postshare(sourcerepo, destrepo, defa'
334 334 destrepo.vfs.write('hgrc', util.tonativeeol(template % default))
335 335 if repositorymod.NARROW_REQUIREMENT in sourcerepo.requirements:
336 336 with destrepo.wlock():
337 narrowspec.copytoworkingcopy(destrepo, None)
337 narrowspec.copytoworkingcopy(destrepo)
338 338
339 339 def _postshareupdate(repo, update, checkout=None):
340 340 """Maybe perform a working directory update after a shared repo is created.
@@ -1252,7 +1252,7 b' class localrepository(object):'
1252 1252
1253 1253 def setnarrowpats(self, newincludes, newexcludes):
1254 1254 narrowspec.save(self, newincludes, newexcludes)
1255 narrowspec.copytoworkingcopy(self, self.currenttransaction())
1255 narrowspec.copytoworkingcopy(self)
1256 1256 self.invalidate(clearfilecache=True)
1257 1257 # So the next access won't be considered a conflict
1258 1258 # TODO: It seems like there should be a way of doing this that
@@ -161,15 +161,7 b' def save(repo, includepats, excludepats)'
161 161 spec = format(includepats, excludepats)
162 162 repo.svfs.write(FILENAME, spec)
163 163
164 def copytoworkingcopy(repo, tr):
165 if tr:
166 def write(file):
167 spec = repo.svfs.read(FILENAME)
168 file.write(spec)
169 file.close()
170 tr.addfilegenerator('narrowspec', (DIRSTATE_FILENAME,), write,
171 location='plain')
172 else:
164 def copytoworkingcopy(repo):
173 165 spec = repo.svfs.read(FILENAME)
174 166 repo.vfs.write(DIRSTATE_FILENAME, spec)
175 167
General Comments 0
You need to be logged in to leave comments. Login now