Author: glen Date: Mon Jan 31 15:36:25 2011 GMT Module: packages Tag: HEAD ---- Log message: - partial update to 0.12.0.5
---- Files affected: packages/trac-plugin-git: trac-git-plugin-python2.4.patch (1.1 -> 1.2) ---- Diffs: ================================================================ Index: packages/trac-plugin-git/trac-git-plugin-python2.4.patch diff -u packages/trac-plugin-git/trac-git-plugin-python2.4.patch:1.1 packages/trac-plugin-git/trac-git-plugin-python2.4.patch:1.2 --- packages/trac-plugin-git/trac-git-plugin-python2.4.patch:1.1 Thu Mar 4 14:43:58 2010 +++ packages/trac-plugin-git/trac-git-plugin-python2.4.patch Mon Jan 31 16:36:20 2011 @@ -1,36 +1,34 @@ from http://trac-hacks.org/ticket/6402 http://trac-hacks.org/attachment/ticket/6402/trac-git-plugin-python2.4.patch?format=raw -diff -Naur gitplugin/0.11/tracext/git/git_fs.py gitplugin-python2.4/0.11/tracext/git/git_fs.py ---- gitplugin/0.11/tracext/git/git_fs.py 2009-08-27 22:02:06.000000000 +0200 -+++ gitplugin-python2.4/0.11/tracext/git/git_fs.py 2010-01-07 16:03:52.000000000 +0100 -@@ -33,8 +33,8 @@ +--- trac-plugin-git-0.12.0.5/tracext/git/git_fs.py~ 2011-01-31 17:25:43.000000000 +0200 ++++ trac-plugin-git-0.12.0.5/tracext/git/git_fs.py 2011-01-31 17:26:46.305667522 +0200 +@@ -29,8 +29,8 @@ from datetime import datetime - import time, sys + import sys --if not sys.version_info[:2] >= (2,5): -- raise TracError("python >= 2.5 dependancy not met") -+if not sys.version_info[:2] >= (2,4): -+ raise TracError("python >= 2.4 dependancy not met") +-if not sys.version_info[:2] >= (2, 5): +- raise TracError("Python >= 2.5 dependancy not met") ++if not sys.version_info[:2] >= (2, 4): ++ raise TracError("Python >= 2.4 dependancy not met") import PyGIT -@@ -359,7 +359,11 @@ - def get_history(self, limit=None): - # TODO: find a way to follow renames/copies - for is_last,rev in _last_iterable(self.git.history(self.rev, self.__git_path(), limit)): -- yield (self.path, rev, Changeset.EDIT if not is_last else Changeset.ADD) -+ if is_last: -+ chg = Changeset.ADD -+ else: -+ chg = Changeset.EDIT -+ yield (self.path, rev, chg) - - def get_last_modified(self): - if not self.isfile: -diff -Naur gitplugin/0.11/tracext/git/PyGIT.py gitplugin-python2.4/0.11/tracext/git/PyGIT.py ---- gitplugin/0.11/tracext/git/PyGIT.py 2009-08-27 22:02:06.000000000 +0200 -+++ gitplugin-python2.4/0.11/tracext/git/PyGIT.py 2010-01-07 16:26:00.000000000 +0100 +@@ -530,7 +530,11 @@ + def get_history(self, limit=None): + # TODO: find a way to follow renames/copies + for is_last, rev in _last_iterable(self.repos.git.history(self.rev, self.__git_path(), limit)): +- yield (self.path, rev, Changeset.EDIT if not is_last else Changeset.ADD) ++ if is_last: ++ chg = Changeset.ADD ++ else: ++ chg = Changeset.EDIT ++ yield (self.path, rev, chg) + + def get_last_modified(self): + if not self.isfile: +--- trac-plugin-git-0.12.0.5/tracext/git/PyGIT.py~ 2011-01-31 17:25:43.000000000 +0200 ++++ trac-plugin-git-0.12.0.5/tracext/git/PyGIT.py 2011-01-31 17:30:07.310680747 +0200 @@ -12,11 +12,9 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. @@ -87,16 +85,6 @@ assert len(self) == len(self.__key_fifo) # invariant if not self.__contains__(name): -@@ -101,6 +118,9 @@ - - return rc - -+ finally: -+ self.__lock.release() -+ - def setdefault(k,d=None): - # TODO - raise AttributeError("SizedDict has no setdefault() method") @@ -113,7 +133,8 @@ def __init__(self, repo, log, weak=True, git_bin='git'): self.logger = log @@ -107,15 +95,6 @@ try: i = StorageFactory.__dict[repo] except KeyError: -@@ -128,6 +149,8 @@ - pass - else: - StorageFactory.__dict_nonweak[repo] = i -+ finally: -+ StorageFactory.__dict_lock.release() - - self.__inst = i - self.__repo = repo @@ -183,7 +206,7 @@ self.logger = log @@ -125,30 +104,36 @@ if not all(map(os.path.exists, map(__git_file_path, ['HEAD','objects','refs']))): -@@ -219,7 +242,8 @@ - # called by Storage.sync() +@@ -328,7 +331,8 @@ def __rev_cache_sync(self, youngest_rev=None): "invalidates revision db cache if necessary" + - with self.__rev_cache_lock: + self.__rev_cache_lock.acquire() + try: need_update = False if self.__rev_cache: - last_youngest_rev = self.__rev_cache[0] -@@ -234,8 +258,12 @@ + last_youngest_rev = self.__rev_cache.youngest_rev +@@ -343,6 +347,9 @@ return need_update + finally: -+ self.__rev_cache_lock.release() ++ self.__rev_cache_lock.release() + def get_rev_cache(self): + """ + Retrieve revision cache +@@ -352,7 +359,8 @@ + returns RevCache tupel + """ + - with self.__rev_cache_lock: + self.__rev_cache_lock.acquire() + try: if self.__rev_cache is None: # can be cleared by Storage.__rev_cache_sync() self.logger.debug("triggered rebuild of commit tree db for %d" % id(self)) - new_db = {} + ts0 = time.time() @@ -312,7 +340,10 @@ new_db = tmp @@ -207,15 +192,15 @@ "--", path]) lines = self.repo.diff_tree(*diff_tree_args).split('\0') -@@ -807,7 +848,10 @@ +@@ -992,7 +1000,10 @@ rev = g.head() - for mode,type,sha,_size,name in g.ls_tree(rev): + for mode, _type, sha, _size, name in g.ls_tree(rev): [last_rev] = g.history(rev, name, limit=1) -- s = g.get_obj_size(sha) if type == "blob" else 0 -+ if type == "blob": +- s = g.get_obj_size(sha) if _type == "blob" else 0 ++ if _type == "blob": + s = g.get_obj_size(sha) + else: + s = 0 msg = g.read_commit(last_rev) - print "%s %s %10d [%s]" % (type, last_rev, s, name) + print "%s %s %10d [%s]" % (_type, last_rev, s, name) ================================================================ ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/trac-plugin-git/trac-git-plugin-python2.4.patch?r1=1.1&r2=1.2&f=u _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
