##// END OF EJS Templates
Invalidate gits parsed_refs cache after commit, tagging or tag remove
marcink -
r2539:da18c423 beta
parent child Browse files
Show More
@@ -149,6 +149,8 b' class GitInMemoryChangeset(BaseInMemoryC'
149 # Update vcs repository object & recreate dulwich repo
149 # Update vcs repository object & recreate dulwich repo
150 self.repository.revisions.append(commit.id)
150 self.repository.revisions.append(commit.id)
151 self.repository._repo = Repo(self.repository.path)
151 self.repository._repo = Repo(self.repository.path)
152 # invalidate parsed refs after commit
153 self.repository._parsed_refs = self.repository._get_parsed_refs()
152 tip = self.repository.get_changeset()
154 tip = self.repository.get_changeset()
153 self.reset()
155 self.reset()
154 return tip
156 return tip
@@ -312,6 +312,7 b' class GitRepository(BaseRepository):'
312 changeset.raw_id)
312 changeset.raw_id)
313 self._repo.refs["refs/tags/%s" % name] = changeset._commit.id
313 self._repo.refs["refs/tags/%s" % name] = changeset._commit.id
314
314
315 self._parsed_refs = self._get_parsed_refs()
315 self.tags = self._get_tags()
316 self.tags = self._get_tags()
316 return changeset
317 return changeset
317
318
@@ -331,12 +332,16 b' class GitRepository(BaseRepository):'
331 tagpath = posixpath.join(self._repo.refs.path, 'refs', 'tags', name)
332 tagpath = posixpath.join(self._repo.refs.path, 'refs', 'tags', name)
332 try:
333 try:
333 os.remove(tagpath)
334 os.remove(tagpath)
335 self._parsed_refs = self._get_parsed_refs()
334 self.tags = self._get_tags()
336 self.tags = self._get_tags()
335 except OSError, e:
337 except OSError, e:
336 raise RepositoryError(e.strerror)
338 raise RepositoryError(e.strerror)
337
339
338 @LazyProperty
340 @LazyProperty
339 def _parsed_refs(self):
341 def _parsed_refs(self):
342 return self._get_parsed_refs()
343
344 def _get_parsed_refs(self):
340 refs = self._repo.get_refs()
345 refs = self._repo.get_refs()
341 keys = [('refs/heads/', 'H'),
346 keys = [('refs/heads/', 'H'),
342 ('refs/remotes/origin/', 'RH'),
347 ('refs/remotes/origin/', 'RH'),
General Comments 0
You need to be logged in to leave comments. Login now