##// END OF EJS Templates
commands: use a context manager for file I/O in debugdiscovery
Bryan O'Sullivan -
r27771:338c9d22 default
parent child Browse files
Show More
@@ -2311,8 +2311,7 b' def debugdiscovery(ui, repo, remoteurl="'
2311 2311 serverlogs = opts.get('serverlog')
2312 2312 if serverlogs:
2313 2313 for filename in serverlogs:
2314 logfile = open(filename, 'r')
2315 try:
2314 with open(filename, 'r') as logfile:
2316 2315 line = logfile.readline()
2317 2316 while line:
2318 2317 parts = line.strip().split(';')
@@ -2324,9 +2323,6 b' def debugdiscovery(ui, repo, remoteurl="'
2324 2323 elif op == 'unb':
2325 2324 doit(parts[3].split(' '), parts[2].split(' '))
2326 2325 line = logfile.readline()
2327 finally:
2328 logfile.close()
2329
2330 2326 else:
2331 2327 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches,
2332 2328 opts.get('remote_head'))
General Comments 0
You need to be logged in to leave comments. Login now