aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage/vcs/git.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2011-02-22 21:02:11 -0500
committerW. Trevor King <wking@drexel.edu>2011-02-22 21:02:11 -0500
commit893bbc21bdac3a5f25c17e547df8adab00dbd670 (patch)
treee3ff8ea586da98cc08776110802db11883c63dca /libbe/storage/vcs/git.py
parent2e32d6fc84d3b211b57a8c39a47b28b991b3ea32 (diff)
downloadbugseverywhere-893bbc21bdac3a5f25c17e547df8adab00dbd670.tar.gz
Local imports and better missing-client detection in client-based VCS classes.
Diffstat (limited to 'libbe/storage/vcs/git.py')
-rw-r--r--libbe/storage/vcs/git.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/libbe/storage/vcs/git.py b/libbe/storage/vcs/git.py
index 7c9199d..5c17303 100644
--- a/libbe/storage/vcs/git.py
+++ b/libbe/storage/vcs/git.py
@@ -30,8 +30,8 @@ import shutil
import unittest
import libbe
-import libbe.ui.util.user
-import base
+from ...ui.util import user as _user
+from . import base
if libbe.TESTING == True:
import doctest
@@ -52,7 +52,10 @@ class Git(base.VCS):
self.versioned = True
def _vcs_version(self):
- status,output,error = self._u_invoke_client('--version')
+ try:
+ status,output,error = self._u_invoke_client('--version')
+ except CommandError: # command not found?
+ return None
return output.strip()
def _vcs_get_user_id(self):
@@ -71,10 +74,10 @@ class Git(base.VCS):
if name != '' or email != '': # got something!
# guess missing info, if necessary
if name == '':
- name = libbe.ui.util.user.get_fallback_username()
+ name = _user.get_fallback_username()
if email == '':
- email = libe.ui.util.user.get_fallback_email()
- return libbe.ui.util.user.create_user_id(name, email)
+ email = _user.get_fallback_email()
+ return _user.create_user_id(name, email)
return None # Git has no infomation
def _vcs_detect(self, path):