changeset 2854:7706fa503677

import: get lock and wlock one time this makes import of many patches 6x faster in kernel repo.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 11 Aug 2006 14:50:41 -0700
parents 619f1c65384c
children c9b08cacf983 b3d1145ed06c 81f351c5264d 8e59010158ce
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Aug 11 09:11:54 2006 +0200
+++ b/mercurial/commands.py	Fri Aug 11 14:50:41 2006 -0700
@@ -1822,6 +1822,9 @@
                         'retrieving revision [0-9]+(\.[0-9]+)*$|' +
                         '(---|\*\*\*)[ \t])', re.MULTILINE)
 
+    wlock = repo.wlock()
+    lock = repo.lock()
+
     for patch in patches:
         pf = os.path.join(d, patch)
 
@@ -1910,8 +1913,8 @@
                 cwd = repo.getcwd()
                 if cwd:
                     cfiles = [util.pathto(cwd, f) for f in files]
-                addremove_lock(ui, repo, cfiles, {})
-            repo.commit(files, message, user, date)
+                addremove_lock(ui, repo, cfiles, {}, wlock=wlock)
+            repo.commit(files, message, user, date, wlock=wlock, lock=lock)
         finally:
             os.unlink(tmpname)