Mercurial > kallithea
comparison rhodecode/lib/diffs.py @ 2552:e8650fbc4d4e beta
Moved BytesIO into compat because of py25 compatibility issue
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 06 Jul 2012 00:01:09 +0200 |
parents | 8eab81115660 |
children | d097d4bb0437 |
comparison
equal
deleted
inserted
replaced
2551:968c84475f73 | 2552:e8650fbc4d4e |
---|---|
24 # | 24 # |
25 # You should have received a copy of the GNU General Public License | 25 # You should have received a copy of the GNU General Public License |
26 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 26 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
27 | 27 |
28 import re | 28 import re |
29 import io | |
30 import difflib | 29 import difflib |
31 import markupsafe | 30 import markupsafe |
32 | 31 |
33 from itertools import tee, imap | 32 from itertools import tee, imap |
34 | 33 |
37 from mercurial.bundlerepo import bundlerepository | 36 from mercurial.bundlerepo import bundlerepository |
38 from mercurial import localrepo | 37 from mercurial import localrepo |
39 | 38 |
40 from pylons.i18n.translation import _ | 39 from pylons.i18n.translation import _ |
41 | 40 |
41 from rhodecode.lib.compat import BytesIO | |
42 from rhodecode.lib.vcs.exceptions import VCSError | 42 from rhodecode.lib.vcs.exceptions import VCSError |
43 from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode | 43 from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode |
44 from rhodecode.lib.helpers import escape | 44 from rhodecode.lib.helpers import escape |
45 from rhodecode.lib.utils import EmptyChangeset, make_ui | 45 from rhodecode.lib.utils import EmptyChangeset, make_ui |
46 | 46 |
601 other_repo.ui.setconfig('hooks', k, None) | 601 other_repo.ui.setconfig('hooks', k, None) |
602 | 602 |
603 unbundle = other_repo.getbundle('incoming', common=common, | 603 unbundle = other_repo.getbundle('incoming', common=common, |
604 heads=rheads) | 604 heads=rheads) |
605 | 605 |
606 buf = io.BytesIO() | 606 buf = BytesIO() |
607 while True: | 607 while True: |
608 chunk = unbundle._stream.read(1024 * 4) | 608 chunk = unbundle._stream.read(1024 * 4) |
609 if not chunk: | 609 if not chunk: |
610 break | 610 break |
611 buf.write(chunk) | 611 buf.write(chunk) |