transaction: trivial refactoring
authorValentin Gatien-Baron <valentin.gatienbaron@gmail.com>
Sun, 16 May 2021 10:57:14 -0400
changeset 47307 13dd5bb5492a
parent 47306 aa07bcc4f505
child 47308 bb4606f35d37
transaction: trivial refactoring Differential Revision: https://phab.mercurial-scm.org/D10714
mercurial/transaction.py
--- a/mercurial/transaction.py	Tue May 18 23:36:21 2021 -0400
+++ b/mercurial/transaction.py	Sun May 16 10:57:14 2021 -0400
@@ -720,9 +720,8 @@
     entries = []
     backupentries = []
 
-    fp = opener.open(file)
-    lines = fp.readlines()
-    fp.close()
+    with opener.open(file) as fp:
+        lines = fp.readlines()
     for l in lines:
         try:
             f, o = l.split(b'\0')