Now libbe.git.Git handles missing name/email and guesses instead.
authorW. Trevor King <wking@drexel.edu>
Tue, 4 Aug 2009 19:42:49 +0000 (15:42 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 4 Aug 2009 19:42:49 +0000 (15:42 -0400)
.be/bugs/dcca51b3-bf8f-4482-8f67-662cfbcb9c6c/values
libbe/git.py

index 65944200919bf87df40a4042f15d3c86cd40f3c3..375e44d0908d937123e31324b31cf18926d8daaf 100644 (file)
@@ -7,7 +7,7 @@ reporter: Gianluca Montecchi <gian@grys.it>
 severity: minor
 
 
-status: open
+status: fixed
 
 
 summary: BE should not crash if user.email  and user.name are not defined
index f7e96463c4734db509770ab72cda18f193b69971..53bc030f7564bca6fe109b0528cec489b3973c44 100644 (file)
@@ -53,10 +53,18 @@ class Git(RCS):
     def _rcs_init(self, path):
         self._u_invoke_client("init", directory=path)
     def _rcs_get_user_id(self):
-        status,output,error = self._u_invoke_client("config", "user.name")
-        name = output.rstrip('\n')
-        status,output,error = self._u_invoke_client("config", "user.email")
-        email = output.rstrip('\n')
+        status,output,error = \
+            self._u_invoke_client("config", "user.name", expect=(0,1))
+        if status == 0:
+            name = output.rstrip('\n')
+        else:
+            name = ""
+        status,output,error = \
+            self._u_invoke_client("config", "user.email", expect=(0,1))
+        if status == 0:
+            email = output.rstrip('\n')
+        else:
+            email = ""
         if name != "" or email != "": # got something!
             # guess missing info, if necessary
             if name == "":