From dcf2c3bd2aaf76e2b6e0cc92f838688712ebda6c Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 17 Dec 2009 12:20:37 +0100 Subject: config: GitConfigReader now allows to override its lock-type. By default it uses a 'failing' lock file, but now its possible to easily put a blocking lock file in its place --- lib/git/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/git/utils.py') diff --git a/lib/git/utils.py b/lib/git/utils.py index 5b061631..69ee927a 100644 --- a/lib/git/utils.py +++ b/lib/git/utils.py @@ -163,13 +163,20 @@ class LockFile(object): self._owns_lock = True + def _obtain_lock(self): + """ + The default implementation will raise if a lock cannot be obtained. + Subclasses may override this method to provide a different implementation + """ + return self._obtain_lock_or_raise() + def _release_lock(self): """ Release our lock if we have one """ if not self._has_lock(): return - + os.remove(self._lock_file_path()) self._owns_lock = False -- cgit v1.2.1