##// END OF EJS Templates
localrepo: use lock.release for single lock
Simon Heimberg -
r8646:60f9e574 default
parent child Browse files
Show More
@@ -971,18 +971,17 b' class localrepository(repo.repository):'
971
971
972 # update dirstate for files that are actually clean
972 # update dirstate for files that are actually clean
973 if fixup:
973 if fixup:
974 wlock = None
975 try:
974 try:
975 wlock = self.wlock(False)
976 try:
976 try:
977 # updating the dirstate is optional
977 # updating the dirstate is optional
978 # so we don't wait on the lock
978 # so we don't wait on the lock
979 wlock = self.wlock(False)
980 for f in fixup:
979 for f in fixup:
981 self.dirstate.normal(f)
980 self.dirstate.normal(f)
981 finally:
982 wlock.release()
982 except error.LockError:
983 except error.LockError:
983 pass
984 pass
984 finally:
985 release(wlock)
986
985
987 if not parentworking:
986 if not parentworking:
988 mf1 = mfmatches(ctx1)
987 mf1 = mfmatches(ctx1)
@@ -1062,8 +1061,6 b' class localrepository(repo.repository):'
1062 wlock.release()
1061 wlock.release()
1063
1062
1064 def remove(self, list, unlink=False):
1063 def remove(self, list, unlink=False):
1065 wlock = None
1066 try:
1067 if unlink:
1064 if unlink:
1068 for f in list:
1065 for f in list:
1069 try:
1066 try:
@@ -1072,6 +1069,7 b' class localrepository(repo.repository):'
1072 if inst.errno != errno.ENOENT:
1069 if inst.errno != errno.ENOENT:
1073 raise
1070 raise
1074 wlock = self.wlock()
1071 wlock = self.wlock()
1072 try:
1075 for f in list:
1073 for f in list:
1076 if unlink and os.path.exists(self.wjoin(f)):
1074 if unlink and os.path.exists(self.wjoin(f)):
1077 self.ui.warn(_("%s still exists!\n") % f)
1075 self.ui.warn(_("%s still exists!\n") % f)
@@ -1082,7 +1080,7 b' class localrepository(repo.repository):'
1082 else:
1080 else:
1083 self.dirstate.remove(f)
1081 self.dirstate.remove(f)
1084 finally:
1082 finally:
1085 release(wlock)
1083 wlock.release()
1086
1084
1087 def undelete(self, list):
1085 def undelete(self, list):
1088 manifests = [self.manifest.read(self.changelog.read(p)[0])
1086 manifests = [self.manifest.read(self.changelog.read(p)[0])
General Comments 0
You need to be logged in to leave comments. Login now