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/bzr.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/bzr.py')
-rw-r--r-- | libbe/storage/vcs/bzr.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbe/storage/vcs/bzr.py b/libbe/storage/vcs/bzr.py index facb869..45a6cd2 100644 --- a/libbe/storage/vcs/bzr.py +++ b/libbe/storage/vcs/bzr.py @@ -81,7 +81,7 @@ class Bzr(base.VCS): -------- >>> b = Bzr(repo='.') - >>> b._vcs_version = lambda : "2.3.1 (release)" + >>> b._version = '2.3.1 (release)' >>> b.version_cmp(2,3,1) 0 >>> b.version_cmp(2,3,2) @@ -90,7 +90,7 @@ class Bzr(base.VCS): 1 >>> b.version_cmp(3) -1 - >>> b._vcs_version = lambda : "2.0.0pre2" + >>> b._version = '2.0.0pre2' >>> b._parsed_version = None >>> b.version_cmp(3) -1 @@ -101,7 +101,7 @@ class Bzr(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: @@ -112,7 +112,7 @@ class Bzr(base.VCS): if type(current) != types.IntType: raise NotImplementedError( 'Cannot parse non-integer portion "%s" of Bzr version "%s"' - % (current, self._vcs_version())) + % (current, self.version())) c = cmp(current,other) if c != 0: return c |