patch: inline small, single-use 'close' function
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 17 Jun 2010 15:50:35 +0200
changeset 11376 ad764a6a2eed
parent 11375 0f33abfccaa1
child 11377 9916263d9a60
patch: inline small, single-use 'close' function
mercurial/patch.py
--- a/mercurial/patch.py	Thu Jun 17 15:53:26 2010 +0200
+++ b/mercurial/patch.py	Thu Jun 17 15:50:35 2010 +0200
@@ -534,10 +534,6 @@
             dest = self.fname
         self.writelines(dest, self.lines)
 
-    def close(self):
-        self.write()
-        self.write_rej()
-
     def apply(self, h):
         if not h.complete():
             raise PatchError(_("bad hunk #%d %s (%d %d %d %d)") %
@@ -1159,7 +1155,8 @@
     def closefile():
         if not current_file:
             return 0
-        current_file.close()
+        current_file.write()
+        current_file.write_rej()
         return len(current_file.rej)
 
     for state, values in iterhunks(ui, fp, sourcefile):