Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'cached-get-branch' of http://github.com/scbash/trac-git…

…-plugin into scbash-cached-get-branch
  • Loading branch information...
commit 8b9e9043edeb62d263962dd064a189f040ffa4d8 2 parents f65bc12 + 3da8eea
Herbert Valerio Riedel authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 tracext/git/git_fs.py
11 tracext/git/git_fs.py
View
@@ -19,7 +19,7 @@
from trac.versioncontrol.api import \
Changeset, Node, Repository, IRepositoryConnector, NoSuchChangeset, NoSuchNode
from trac.wiki 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 trac.web.chrome 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"
Please sign in to comment.
Something went wrong with that request. Please try again.