# HG changeset patch # User Dirkjan Ochtman # Date 1276782687 -7200 # Node ID 9916263d9a60ffcaac9180d358b99fa454b04df2 # Parent ad764a6a2eede95eb9ef1498c27bc35ba6480b3e patch: inline small, single-use 'write' function diff -r ad764a6a2eed -r 9916263d9a60 mercurial/patch.py --- a/mercurial/patch.py Thu Jun 17 15:50:35 2010 +0200 +++ b/mercurial/patch.py Thu Jun 17 15:51:27 2010 +0200 @@ -527,13 +527,6 @@ self.writelines(fname, rejlines()) - def write(self, dest=None): - if not self.dirty: - return - if not dest: - dest = self.fname - self.writelines(dest, self.lines) - def apply(self, h): if not h.complete(): raise PatchError(_("bad hunk #%d %s (%d %d %d %d)") % @@ -1155,7 +1148,8 @@ def closefile(): if not current_file: return 0 - current_file.write() + if current_file.dirty: + current_file.writelines(current_file.fname, current_file.lines) current_file.write_rej() return len(current_file.rej)