From 1fc4f31d28cee02fc137b4997a252e0ddb5ca294 Mon Sep 17 00:00:00 2001 From: wking Date: Tue, 22 Jun 2010 13:09:23 -0400 Subject: Use 'darcs add --boring' for Darcs > 0.9.10 --- libbe/storage/vcs/darcs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libbe/storage/vcs') diff --git a/libbe/storage/vcs/darcs.py b/libbe/storage/vcs/darcs.py index 0f23278..483b155 100644 --- a/libbe/storage/vcs/darcs.py +++ b/libbe/storage/vcs/darcs.py @@ -153,7 +153,10 @@ class Darcs(base.VCS): def _vcs_add(self, path): if os.path.isdir(path): return - self._u_invoke_client('add', path) + if self.version_cmp(0, 9, 10) == 1: + self._u_invoke_client('add', '--boring', path) + else: # really old versions <= 0.9.10 lack --boring + self._u_invoke_client('add', path) def _vcs_remove(self, path): if not os.path.isdir(self._u_abspath(path)): -- cgit From 1bb788dee94ab5e882c35f5c1bb95c1eecf69c16 Mon Sep 17 00:00:00 2001 From: wking Date: Tue, 22 Jun 2010 13:19:59 -0400 Subject: Darcs._vcs_get_user_id() now also checks ~/.darcs/prefs/author|email. Thanks to Gour for pointing out that it should. --- libbe/storage/vcs/darcs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libbe/storage/vcs') 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() -- cgit From 0b8658523a1ce8d9380540010335ab1b829342f7 Mon Sep 17 00:00:00 2001 From: wking Date: Tue, 22 Jun 2010 13:23:07 -0400 Subject: Darcs should look in ~/.darcs/author not ~/.darcs/prefs/author From: http://darcs.net/manual/node7.html#env:DARCS_EMAIL --- libbe/storage/vcs/darcs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libbe/storage/vcs') diff --git a/libbe/storage/vcs/darcs.py b/libbe/storage/vcs/darcs.py index f64a7f6..b0e5705 100644 --- a/libbe/storage/vcs/darcs.py +++ b/libbe/storage/vcs/darcs.py @@ -116,11 +116,11 @@ class Darcs(base.VCS): if self.repo == None: return None for pref_file in ['author', 'email']: - for darcs_dir in [os.path.join(self.repo, '_darcs'), + for prefs_dir in [os.path.join(self.repo, '_darcs', 'prefs'), os.path.expanduser(os.path.join('~', '.darcs'))]: - if darcs_dir == None: + if prefs_dir == None: continue - pref_path = os.path.join(darcs_dir, 'prefs', pref_file) + pref_path = os.path.join(prefs_dir, pref_file) if os.path.exists(pref_path): return self._vcs_get_file_contents(pref_path).strip() for env_variable in ['DARCS_EMAIL', 'EMAIL']: -- cgit