From 269dc552a8990780ab3e6a24b22363e2d1e23266 Mon Sep 17 00:00:00 2001 From: mhagger Date: Fri, 17 May 2013 10:25:48 +0000 Subject: [PATCH] Make sure to close CVS repository files after parsing them. The same problem that was fixed in the last commit also existed in InternalRevisionCollector. Fix it there in the same manner. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5422 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/checkout_internal.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cvs2svn_lib/checkout_internal.py b/cvs2svn_lib/checkout_internal.py index 6d4d1df8..3bb959e3 100644 --- a/cvs2svn_lib/checkout_internal.py +++ b/cvs2svn_lib/checkout_internal.py @@ -610,10 +610,11 @@ class InternalRevisionCollector(RevisionCollector): # A map from cvs_rev_id to TextRecord instance: self.text_record_db = TextRecordDatabase(self._delta_db, NullDatabase()) - parse( - open(cvs_file_items.cvs_file.rcs_path, 'rb'), - _Sink(self, cvs_file_items), - ) + f = open(cvs_file_items.cvs_file.rcs_path, 'rb') + try: + parse(f, _Sink(self, cvs_file_items)) + finally: + f.close() self.text_record_db.recompute_refcounts(cvs_file_items) self.text_record_db.free_unused() -- 2.11.4.GIT