# HG changeset patch # User Dirkjan Ochtman # Date 2010-06-17 13:51:27 # Node ID 9916263d9a60ffcaac9180d358b99fa454b04df2 # Parent ad764a6a2eede95eb9ef1498c27bc35ba6480b3e patch: inline small, single-use 'write' function diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -527,13 +527,6 @@ class patchfile(object): 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 _applydiff(ui, fp, patcher, copyfn, 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)