##// END OF EJS Templates
with: use context manager for wlock in cmdutilforget
Bryan O'Sullivan -
r27824:0e55e93b default
parent child Browse files
Show More
@@ -1053,8 +1053,7 b' def cmdutilforget(orig, ui, repo, match,'
1053
1053
1054 # Need to lock because standin files are deleted then removed from the
1054 # Need to lock because standin files are deleted then removed from the
1055 # repository and we could race in-between.
1055 # repository and we could race in-between.
1056 wlock = repo.wlock()
1056 with repo.wlock():
1057 try:
1058 lfdirstate = lfutil.openlfdirstate(ui, repo)
1057 lfdirstate = lfutil.openlfdirstate(ui, repo)
1059 for f in forget:
1058 for f in forget:
1060 if lfdirstate[f] == 'a':
1059 if lfdirstate[f] == 'a':
@@ -1066,8 +1065,6 b' def cmdutilforget(orig, ui, repo, match,'
1066 for f in standins:
1065 for f in standins:
1067 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1066 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1068 rejected = repo[None].forget(standins)
1067 rejected = repo[None].forget(standins)
1069 finally:
1070 wlock.release()
1071
1068
1072 bad.extend(f for f in rejected if f in m.files())
1069 bad.extend(f for f in rejected if f in m.files())
1073 forgot.extend(f for f in forget if f not in rejected)
1070 forgot.extend(f for f in forget if f not in rejected)
General Comments 0
You need to be logged in to leave comments. Login now