diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-12-17 12:20:37 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-12-17 12:20:37 +0100 |
commit | dcf2c3bd2aaf76e2b6e0cc92f838688712ebda6c (patch) | |
tree | e6572a1df772872075911a55ecdca8b6519a10c5 /lib/git/utils.py | |
parent | a38a0053d31d0285dd1e6ebe6efc28726a9656cc (diff) | |
download | gitpython-dcf2c3bd2aaf76e2b6e0cc92f838688712ebda6c.tar.gz |
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
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r-- | lib/git/utils.py | 9 |
1 files changed, 8 insertions, 1 deletions
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 |