diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-12-10 23:17:21 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-12-10 23:17:21 +0100 |
commit | bc66da0d66a9024f0bd86ada1c3cd4451acd8907 (patch) | |
tree | 897609e3176466f36a71671a3f79d0e28243f77a | |
parent | 16a0c64dd5e69ed794ea741bc447f6a1a2bc98e5 (diff) | |
download | gitpython-bc66da0d66a9024f0bd86ada1c3cd4451acd8907.tar.gz |
removed nonsense IndexLock implementation
-rw-r--r-- | lib/git/index.py | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/lib/git/index.py b/lib/git/index.py index 041dfff7..9748df9f 100644 --- a/lib/git/index.py +++ b/lib/git/index.py @@ -69,38 +69,7 @@ class _TemporaryFileSwap(object): os.remove(self.file_path) os.rename(self.tmp_file_path, self.file_path) # END temp file exists - -class IndexLock(BlockingLockFile): - """Specialized lock that will wait for the index to be locked and immediately - move the lock out of the way. This allows a git command to take the lock - which has to follow right after the lock() call. - - Right before the lock is released, we will move our original lock back into place. - This lock should be used to gain fine-grained control over multiple processes - or threads that try to manipulate the index and would otherwise fail. - Using this lock, these will wait for each other. - - NOTE: - There is still a small chance that git will fail as file system - operations take time as well. - """ - __slots__ = '_tmp_file_path' - - def _obtain_lock_or_raise(self): - super(IndexLock, self)._obtain_lock_or_raise() - self._tmp_file_path = self._lock_file_path() + tempfile.mktemp('','','') - # rename lock we aquired to move it out of the way - os.rename(self._lock_file_path(), self._tmp_file_path) - - def _release_lock(self): - # move our lock back into place - if hasattr(self, '_tmp_file_path') and os.path.isfile(self._tmp_file_path): - lock_file = self._lock_file_path() - if os.name == 'nt' and os.path.exists(lock_file): - os.remove(lock_file) - os.rename(self._tmp_file_path, lock_file) - # END temp file exists - super(IndexLock, self)._release_lock() + class BlobFilter(object): """ |