Mercurial > hg
comparison mercurial/pure/mpatch.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 | f736f98e16ca |
children | f2846d546645 |
comparison
equal
deleted
inserted
replaced
28860:50d11dd8ac02 | 28861:86db5cb55d46 |
---|---|
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from __future__ import absolute_import | 8 from __future__ import absolute_import |
9 | 9 |
10 import cStringIO | |
11 import struct | 10 import struct |
12 | 11 |
13 StringIO = cStringIO.StringIO | 12 from . import pycompat |
13 stringio = pycompat.stringio | |
14 | 14 |
15 class mpatchError(Exception): | 15 class mpatchError(Exception): |
16 """error raised when a delta cannot be decoded | 16 """error raised when a delta cannot be decoded |
17 """ | 17 """ |
18 | 18 |
64 b1, b2 = 0, bl | 64 b1, b2 = 0, bl |
65 | 65 |
66 if not tl: | 66 if not tl: |
67 return a | 67 return a |
68 | 68 |
69 m = StringIO() | 69 m = stringio() |
70 | 70 |
71 # load our original text | 71 # load our original text |
72 m.write(a) | 72 m.write(a) |
73 frags = [(len(a), b1)] | 73 frags = [(len(a), b1)] |
74 | 74 |