[svn r38797] fixing the too global revision caching
--HG-- branch : trunk
This commit is contained in:
parent
09f7bc947d
commit
1fd940c579
|
@ -170,15 +170,18 @@ def get_rel_sourcepath(projpath, filename, default=None):
|
||||||
return default
|
return default
|
||||||
return relpath
|
return relpath
|
||||||
|
|
||||||
_rev = -1
|
def get_package_revision(packageroot, _revcache={}):
|
||||||
def get_package_revision(packageroot):
|
try:
|
||||||
global _rev
|
rev = _revcache[packageroot]
|
||||||
if _rev == -1:
|
except KeyError:
|
||||||
_rev = None
|
|
||||||
wc = py.path.svnwc(packageroot)
|
wc = py.path.svnwc(packageroot)
|
||||||
|
rev = None
|
||||||
if wc.check(versioned=True):
|
if wc.check(versioned=True):
|
||||||
_rev = py.path.svnwc(packageroot).info().rev
|
rev = py.path.svnwc(packageroot).info().rev
|
||||||
return _rev
|
_revcache[packageroot] = rev
|
||||||
|
if packageroot.basename == "py":
|
||||||
|
assert rev is not None
|
||||||
|
return rev
|
||||||
|
|
||||||
# the PageBuilder classes take care of producing the docs (using the stuff
|
# the PageBuilder classes take care of producing the docs (using the stuff
|
||||||
# above)
|
# above)
|
||||||
|
|
Loading…
Reference in New Issue