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/base.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/base.py')
-rw-r--r-- | libbe/storage/vcs/base.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py index 62f4576..594a10c 100644 --- a/libbe/storage/vcs/base.py +++ b/libbe/storage/vcs/base.py @@ -518,21 +518,9 @@ class VCS (libbe.storage.base.VersionedStorage): def version(self): # Cache version string for efficiency. if not hasattr(self, '_version'): - self._version = self._get_version() + self._version = self._vcs_version() return self._version - def _get_version(self): - try: - ret = self._vcs_version() - return ret - except OSError, e: - if e.errno == errno.ENOENT: - return None - else: - raise OSError, e - except CommandError: - return None - def installed(self): if self.version() != None: return True @@ -547,6 +535,11 @@ class VCS (libbe.storage.base.VersionedStorage): """ if not hasattr(self, 'user_id'): self.user_id = self._vcs_get_user_id() + if self.user_id == None: + # guess missing info + name = libbe.ui.util.user.get_fallback_username() + email = libbe.ui.util.user.get_fallback_email() + self.user_id = libbe.ui.util.user.create_user_id(name, email) return self.user_id def _detect(self, path='.'): |