changeset 1582:e15dc9e9cd56

wrappers: lock the repo for the whole pull operation It prevents from an unnecessary loading of 'fncache' on each revision.
author Ivan Lezhankin <ilezhankin@yandex-team.ru>
date Mon, 06 Aug 2018 14:52:33 +0300
parents 363d4c2cb880
children f778fdd82c83 6cc986fee28e
files hgsubversion/wrappers.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -477,6 +477,7 @@ def pull(repo, source, heads=[], force=F
             total = svn.HEAD - start
         lastpulled = None
 
+        lock = meta.repo.lock()
         try:
             # start converting revisions
             firstrun = True
@@ -534,6 +535,8 @@ def pull(repo, source, heads=[], force=F
 
         except KeyboardInterrupt:
             ui.traceback()
+        finally:
+            lock.release()
     finally:
         if total is not None:
             ui.progress('pull', None, total=total)