##// END OF EJS Templates
shelve: use a context manager for file I/O in listcmd
Bryan O'Sullivan -
r27775:3ea35a07 default
parent child Browse files
Show More
@@ -424,8 +424,7 b' def listcmd(ui, repo, pats, opts):'
424 424 ui.write(age, label='shelve.age')
425 425 ui.write(' ' * (12 - len(age)))
426 426 used += 12
427 fp = open(name + '.patch', 'rb')
428 try:
427 with open(name + '.patch', 'rb') as fp:
429 428 while True:
430 429 line = fp.readline()
431 430 if not line:
@@ -447,8 +446,6 b' def listcmd(ui, repo, pats, opts):'
447 446 for chunk, label in patch.diffstatui(difflines, width=width,
448 447 git=True):
449 448 ui.write(chunk, label=label)
450 finally:
451 fp.close()
452 449
453 450 def singlepatchcmds(ui, repo, pats, opts, subcommand):
454 451 """subcommand that displays a single shelf"""
General Comments 0
You need to be logged in to leave comments. Login now