diff -r b9dcee25be8e -r 9dc64c8414ca mercurial/util.py --- a/mercurial/util.py Sat Mar 03 18:59:54 2007 -0800 +++ b/mercurial/util.py Sun Mar 04 09:03:21 2007 -0300 @@ -790,6 +790,14 @@ if inst.errno != 0: raise self.close() raise IOError(errno.EPIPE, 'Broken pipe') + + def flush(self): + try: + return self.fp.flush() + except IOError, inst: + if inst.errno != errno.EINVAL: raise + self.close() + raise IOError(errno.EPIPE, 'Broken pipe') sys.stdout = winstdout(sys.stdout)