mercurial/cmdutil.py
changeset 28861 86db5cb55d46
parent 28837 d54a7410307f
child 28891 ac30adb260ea
--- 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()