aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwking <wking@thialfi>2010-06-22 13:19:59 -0400
committerwking <wking@thialfi>2010-06-22 13:19:59 -0400
commit1bb788dee94ab5e882c35f5c1bb95c1eecf69c16 (patch)
tree47fde90b9a4be69c6f9424ed2fa7627460632c4f
parent1fc4f31d28cee02fc137b4997a252e0ddb5ca294 (diff)
downloadbugseverywhere-1bb788dee94ab5e882c35f5c1bb95c1eecf69c16.tar.gz
Darcs._vcs_get_user_id() now also checks ~/.darcs/prefs/author|email.
Thanks to Gour for pointing out that it should.
-rw-r--r--libbe/storage/vcs/darcs.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbe/storage/vcs/darcs.py b/libbe/storage/vcs/darcs.py
index 483b155..f64a7f6 100644
--- a/libbe/storage/vcs/darcs.py
+++ b/libbe/storage/vcs/darcs.py
@@ -112,12 +112,14 @@ class Darcs(base.VCS):
def _vcs_get_user_id(self):
# following http://darcs.net/manual/node4.html#SECTION00410030000000000000
- # as of June 29th, 2009
+ # as of June 22th, 2010
if self.repo == None:
return None
- darcs_dir = os.path.join(self.repo, '_darcs')
- if darcs_dir != None:
- for pref_file in ['author', 'email']:
+ for pref_file in ['author', 'email']:
+ for darcs_dir in [os.path.join(self.repo, '_darcs'),
+ os.path.expanduser(os.path.join('~', '.darcs'))]:
+ if darcs_dir == None:
+ continue
pref_path = os.path.join(darcs_dir, 'prefs', pref_file)
if os.path.exists(pref_path):
return self._vcs_get_file_contents(pref_path).strip()