diff options
author | W. Trevor King <wking@drexel.edu> | 2010-06-26 11:58:08 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-06-26 11:58:08 -0400 |
commit | 8d7ee45073087fddf3155c08ae51dfc97b0927fa (patch) | |
tree | 691b8d4b797b886f48f46ef0d2359e50d54263e9 /libbe/storage/vcs/darcs.py | |
parent | c63a03efc36ab29e3ddddfab5a2f72d1d9d9f9d8 (diff) | |
download | bugseverywhere-8d7ee45073087fddf3155c08ae51dfc97b0927fa.tar.gz |
Removed libbe.storage.vcs.base._get_version
It had been catching exceptions from ._vcs_version, but ._vcs_version
should catch its own exceptions.
Also use cached results from .version in Darcs and
Bzr.version_cmp() rather than calling ._vcs_version directly.
Diffstat (limited to 'libbe/storage/vcs/darcs.py')
-rw-r--r-- | libbe/storage/vcs/darcs.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbe/storage/vcs/darcs.py b/libbe/storage/vcs/darcs.py index 556404e..7ff4554 100644 --- a/libbe/storage/vcs/darcs.py +++ b/libbe/storage/vcs/darcs.py @@ -74,7 +74,7 @@ class Darcs(base.VCS): -------- >>> d = Darcs(repo='.') - >>> d._vcs_version = lambda : "2.3.1 (release)" + >>> d._version = '2.3.1 (release)' >>> d.version_cmp(2,3,1) 0 >>> d.version_cmp(2,3,2) @@ -83,7 +83,7 @@ class Darcs(base.VCS): 1 >>> d.version_cmp(3) -1 - >>> d._vcs_version = lambda : "2.0.0pre2" + >>> d._version = '2.0.0pre2' >>> d._parsed_version = None >>> d.version_cmp(3) -1 @@ -94,7 +94,7 @@ class Darcs(base.VCS): """ if not hasattr(self, '_parsed_version') \ or self._parsed_version == None: - num_part = self._vcs_version().split(' ')[0] + num_part = self.version().split(' ')[0] self._parsed_version = [] for num in num_part.split('.'): try: @@ -105,7 +105,7 @@ class Darcs(base.VCS): if type(current) != types.IntType: raise NotImplementedError( 'Cannot parse non-integer portion "%s" of Darcs version "%s"' - % (current, self._vcs_version())) + % (current, self.version())) c = cmp(current,other) if c != 0: return c |