hgext/mq.py
changeset 4571 eb403f295ff1
parent 4549 0c61124ad877
child 4578 eb3b7dd1e158
--- a/hgext/mq.py	Wed Jun 13 13:50:29 2007 -0700
+++ b/hgext/mq.py	Wed Jun 13 19:15:58 2007 -0300
@@ -438,11 +438,14 @@
     def apply(self, repo, series, list=False, update_status=True,
               strict=False, patchdir=None, merge=None, wlock=None,
               all_files={}):
+        if not wlock:
+            wlock = repo.wlock()
+        lock = repo.lock()
         tr = repo.transaction()
         try:
             ret = self._apply(tr, repo, series, list, update_status,
                               strict, patchdir, merge, wlock,
-                              all_files=all_files)
+                              lock=lock, all_files=all_files)
             tr.close()
             self.save_dirty()
             return ret
@@ -456,14 +459,11 @@
 
     def _apply(self, tr, repo, series, list=False, update_status=True,
                strict=False, patchdir=None, merge=None, wlock=None,
-               all_files={}):
+               lock=None, all_files={}):
         # TODO unify with commands.py
         if not patchdir:
             patchdir = self.path
         err = 0
-        if not wlock:
-            wlock = repo.wlock()
-        lock = repo.lock()
         n = None
         for patchname in series:
             pushable, reason = self.pushable(patchname)