From 75577588a978be2d7d8a8a71a00ea5b6ee53d944 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 4 Aug 2009 15:42:49 -0400 Subject: Now libbe.git.Git handles missing name/email and guesses instead. --- libbe/git.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libbe') diff --git a/libbe/git.py b/libbe/git.py index f7e9646..53bc030 100644 --- a/libbe/git.py +++ b/libbe/git.py @@ -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 == "": -- cgit