summaryrefslogtreecommitdiff
diff options
authorJelmer Vernooij <jelmer@jelmer.uk>2019-12-28 14:10:36 +0000
committerJelmer Vernooij <jelmer@jelmer.uk>2019-12-28 14:10:36 +0000
commitd754c546a7d5eaa9b71d73d4ce58879a5ee5f36f (patch)
tree3f66f2fdc02fbf080e5f8ea97ffe32ece643d83b
parentce7838c2af6bc07c26a1a96421c4108240cc62b2 (diff)
Python3 compatibility.
-rw-r--r--breezy/patches.py6
-rw-r--r--breezy/tests/test_patches.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/breezy/patches.py b/breezy/patches.py
index aae2e02be0..3eb34bfa6f 100644
--- a/breezy/patches.py
+++ b/breezy/patches.py
@@ -586,10 +586,10 @@ def apply_patches(tt, patches, prefix=1):
orig_contents = tt._tree.get_file_text(oldname)
tt.delete_contents(trans_id)
- if patch.newname != '/dev/null':
+ if patch.newname != b'/dev/null':
newname = strip_prefix(patch.newname.decode())
- new_contents = b''.join(iter_patched_from_hunks(
- orig_contents.splitlines(True), patch.hunks))
+ new_contents = iter_patched_from_hunks(
+ orig_contents.splitlines(True), patch.hunks)
if trans_id is None:
parts = os.path.split(newname)
trans_id = tt.root
diff --git a/breezy/tests/test_patches.py b/breezy/tests/test_patches.py
index 8139af5dab..7b372448d3 100644
--- a/breezy/tests/test_patches.py
+++ b/breezy/tests/test_patches.py
@@ -333,7 +333,7 @@ class AppliedPatchesTests(TestCaseWithTransport):
self.build_tree_contents([('a', 'a\n')])
tree.add('a')
tree.commit('Add a')
- patch = parse_patch("""\
+ patch = parse_patch(b"""\
--- a/a
+++ a/a
@@ -1 +1 @@
@@ -348,7 +348,7 @@ class AppliedPatchesTests(TestCaseWithTransport):
self.build_tree_contents([('a', 'a\n')])
tree.add('a')
tree.commit('Add a')
- patch = parse_patch("""\
+ patch = parse_patch(b"""\
--- a/a
+++ /dev/null
@@ -1 +0,0 @@
@@ -362,7 +362,7 @@ class AppliedPatchesTests(TestCaseWithTransport):
self.build_tree_contents([('a', 'a\n')])
tree.add('a')
tree.commit('Add a')
- patch = parse_patch("""\
+ patch = parse_patch(b"""\
--- /dev/null
+++ a/b
@@ -0,0 +1 @@