changeset 11376:ad764a6a2eed

patch: inline small, single-use 'close' function
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Thu, 17 Jun 2010 15:50:35 +0200
parents 0f33abfccaa1
children 9916263d9a60
files mercurial/patch.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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):