Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 28861:86db5cb55d46
pycompat: switch to util.stringio for py3 compat
author | timeless <timeless@mozdev.org> |
---|---|
date | Sun, 10 Apr 2016 20:55:37 +0000 |
parents | d54a7410307f |
children | ac30adb260ea |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sun Apr 10 21:32:08 2016 +0000 +++ b/mercurial/cmdutil.py Sun Apr 10 20:55:37 2016 +0000 @@ -7,7 +7,6 @@ from __future__ import absolute_import -import cStringIO import errno import os import re @@ -46,6 +45,7 @@ templater, util, ) +stringio = util.stringio def ishunk(x): hunkclasses = (crecordmod.uihunk, patch.recordhunk) @@ -211,7 +211,7 @@ util.copyfile(repo.wjoin(f), tmpname, copystat=True) backups[f] = tmpname - fp = cStringIO.StringIO() + fp = stringio() for c in chunks: fname = c.filename() if fname in backups: @@ -3298,7 +3298,7 @@ newlyaddedandmodifiedfiles = newandmodified(chunks, originalchunks) # Apply changes - fp = cStringIO.StringIO() + fp = stringio() for c in chunks: c.write(fp) dopatch = fp.tell()