##// END OF EJS Templates
localrepo: import "lock" module as "lockmod" for readability...
FUJIWARA Katsunori -
r20088:7cbb79bd default
parent child Browse files
Show More
@@ -8,7 +8,8 b' from node import hex, nullid, short'
8 from i18n import _
8 from i18n import _
9 import peer, changegroup, subrepo, discovery, pushkey, obsolete, repoview
9 import peer, changegroup, subrepo, discovery, pushkey, obsolete, repoview
10 import changelog, dirstate, filelog, manifest, context, bookmarks, phases
10 import changelog, dirstate, filelog, manifest, context, bookmarks, phases
11 import lock, transaction, store, encoding
11 import lock as lockmod
12 import transaction, store, encoding
12 import scmutil, util, extensions, hook, error, revset
13 import scmutil, util, extensions, hook, error, revset
13 import match as matchmod
14 import match as matchmod
14 import merge as mergemod
15 import merge as mergemod
@@ -1001,15 +1002,16 b' class localrepository(object):'
1001
1002
1002 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
1003 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
1003 try:
1004 try:
1004 l = lock.lock(lockname, 0, releasefn, desc=desc)
1005 l = lockmod.lock(lockname, 0, releasefn, desc=desc)
1005 except error.LockHeld, inst:
1006 except error.LockHeld, inst:
1006 if not wait:
1007 if not wait:
1007 raise
1008 raise
1008 self.ui.warn(_("waiting for lock on %s held by %r\n") %
1009 self.ui.warn(_("waiting for lock on %s held by %r\n") %
1009 (desc, inst.locker))
1010 (desc, inst.locker))
1010 # default to 600 seconds timeout
1011 # default to 600 seconds timeout
1011 l = lock.lock(lockname, int(self.ui.config("ui", "timeout", "600")),
1012 l = lockmod.lock(lockname,
1012 releasefn, desc=desc)
1013 int(self.ui.config("ui", "timeout", "600")),
1014 releasefn, desc=desc)
1013 if acquirefn:
1015 if acquirefn:
1014 acquirefn()
1016 acquirefn()
1015 return l
1017 return l
General Comments 0
You need to be logged in to leave comments. Login now