Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Merge branch 'cached-get-branch' of…

…-plugin into scbash-cached-get-branch
  • Loading branch information...
commit 8b9e9043edeb62d263962dd064a189f040ffa4d8 2 parents f65bc12 + 3da8eea
@hvr authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 tracext/git/
11 tracext/git/
@@ -19,7 +19,7 @@
from trac.versioncontrol.api import \
Changeset, Node, Repository, IRepositoryConnector, NoSuchChangeset, NoSuchNode
from import IWikiSyntaxProvider
-from trac.versioncontrol.cache import CachedRepository
+from trac.versioncontrol.cache import CachedRepository, CachedChangeset
from trac.versioncontrol.web_ui import IPropertyRenderer
from trac.config import BoolOption, IntOption, PathOption, Option
from import Chrome
@@ -55,7 +55,16 @@ def normalize_rev(self, rev):
if normrev is None:
raise NoSuchChangeset(rev)
return normrev
+ def get_changeset(self, rev):
+ return CachedChangeset2(self, self.normalize_rev(rev), self.env)
+class CachedChangeset2(CachedChangeset):
+ def get_branches(self):
+ _rev = self.rev
+ return [ (k, v == _rev) for k, v in
+ self.repos.repos.git.get_branch_contains(_rev, resolve=True) ]
def _last_iterable(iterable):
"helper for detecting last iteration in for-loop"

0 comments on commit 8b9e904

Please sign in to comment.
Something went wrong with that request. Please try again.