Merge lp:~jelmer/brz/more-bees into lp:brz

Proposed by Jelmer Vernooij on 2018-02-18
Status: Merged
Approved by: Jelmer Vernooij on 2018-03-25
Approved revision: 6872
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/more-bees
Merge into: lp:brz
Prerequisite: lp:~jelmer/brz/bees
Diff against target: 18454 lines (+3603/-3340)
232 files modified
.bzrignore (+3/-0)
breezy/branch.py (+2/-1)
breezy/branchbuilder.py (+5/-5)
breezy/builtins.py (+1/-4)
breezy/bundle/bundle_data.py (+1/-4)
breezy/bundle/serializer/__init__.py (+1/-1)
breezy/bzr/branch.py (+3/-7)
breezy/bzr/bzrdir.py (+1/-1)
breezy/bzr/dirstate.py (+1/-4)
breezy/bzr/inventory.py (+5/-5)
breezy/bzr/knit.py (+27/-28)
breezy/bzr/smart/protocol.py (+35/-35)
breezy/bzr/smart/repository.py (+1/-4)
breezy/bzr/smart/vfs.py (+4/-4)
breezy/bzr/versionedfile.py (+1/-1)
breezy/bzr/weavefile.py (+4/-4)
breezy/bzr/workingtree.py (+3/-12)
breezy/bzr/workingtree_4.py (+1/-4)
breezy/bzr/xml_serializer.py (+2/-2)
breezy/cmd_test_script.py (+1/-4)
breezy/diff.py (+2/-8)
breezy/doc_generate/autodoc_rstx.py (+2/-3)
breezy/export/dir_exporter.py (+1/-4)
breezy/generate_ids.py (+2/-2)
breezy/iterablefile.py (+12/-0)
breezy/mutabletree.py (+1/-1)
breezy/plugins/commitfromnews/tests/test_committemplate.py (+10/-10)
breezy/plugins/email/tests/testemail.py (+1/-1)
breezy/plugins/fastimport/revision_store.py (+2/-2)
breezy/plugins/fastimport/tests/test_commands.py (+5/-5)
breezy/plugins/fastimport/tests/test_revision_store.py (+37/-37)
breezy/plugins/grep/test_grep.py (+7/-7)
breezy/plugins/launchpad/test_lp_api_lite.py (+7/-7)
breezy/plugins/po_merge/tests/test_po_merge.py (+11/-11)
breezy/plugins/stats/test_stats.py (+11/-11)
breezy/plugins/upload/tests/test_upload.py (+5/-5)
breezy/plugins/weave_fmt/repository.py (+1/-1)
breezy/plugins/weave_fmt/test_bzrdir.py (+73/-73)
breezy/plugins/weave_fmt/test_repository.py (+3/-3)
breezy/plugins/weave_fmt/test_workingtree.py (+16/-12)
breezy/repository.py (+1/-1)
breezy/shelf.py (+2/-2)
breezy/tests/blackbox/test_add.py (+4/-4)
breezy/tests/blackbox/test_added.py (+1/-1)
breezy/tests/blackbox/test_ancestry.py (+7/-7)
breezy/tests/blackbox/test_annotate.py (+20/-20)
breezy/tests/blackbox/test_bound_branches.py (+12/-12)
breezy/tests/blackbox/test_branch.py (+8/-8)
breezy/tests/blackbox/test_break_lock.py (+1/-1)
breezy/tests/blackbox/test_bundle_info.py (+2/-2)
breezy/tests/blackbox/test_cat.py (+8/-8)
breezy/tests/blackbox/test_cat_revision.py (+6/-6)
breezy/tests/blackbox/test_checkout.py (+7/-7)
breezy/tests/blackbox/test_commit.py (+13/-13)
breezy/tests/blackbox/test_config.py (+2/-2)
breezy/tests/blackbox/test_conflicts.py (+6/-6)
breezy/tests/blackbox/test_diff.py (+17/-17)
breezy/tests/blackbox/test_dpush.py (+6/-6)
breezy/tests/blackbox/test_export.py (+8/-8)
breezy/tests/blackbox/test_filesystem_cicp.py (+3/-3)
breezy/tests/blackbox/test_filtered_view_ops.py (+2/-2)
breezy/tests/blackbox/test_ignore.py (+4/-4)
breezy/tests/blackbox/test_ignored.py (+3/-3)
breezy/tests/blackbox/test_info.py (+2/-2)
breezy/tests/blackbox/test_init.py (+2/-2)
breezy/tests/blackbox/test_inventory.py (+3/-3)
breezy/tests/blackbox/test_join.py (+1/-1)
breezy/tests/blackbox/test_link_tree.py (+2/-2)
breezy/tests/blackbox/test_locale.py (+1/-1)
breezy/tests/blackbox/test_log.py (+31/-31)
breezy/tests/blackbox/test_lookup_revision.py (+1/-1)
breezy/tests/blackbox/test_ls.py (+4/-4)
breezy/tests/blackbox/test_merge.py (+58/-58)
breezy/tests/blackbox/test_merge_directive.py (+10/-10)
breezy/tests/blackbox/test_missing.py (+8/-8)
breezy/tests/blackbox/test_modified.py (+3/-3)
breezy/tests/blackbox/test_mv.py (+1/-1)
breezy/tests/blackbox/test_non_ascii.py (+16/-16)
breezy/tests/blackbox/test_pack.py (+1/-1)
breezy/tests/blackbox/test_ping.py (+1/-1)
breezy/tests/blackbox/test_pull.py (+11/-11)
breezy/tests/blackbox/test_push.py (+23/-23)
breezy/tests/blackbox/test_re_sign.py (+6/-6)
breezy/tests/blackbox/test_reconcile.py (+1/-1)
breezy/tests/blackbox/test_reconfigure.py (+7/-7)
breezy/tests/blackbox/test_reference.py (+2/-2)
breezy/tests/blackbox/test_resolve.py (+2/-2)
breezy/tests/blackbox/test_revert.py (+1/-1)
breezy/tests/blackbox/test_revision_history.py (+3/-3)
breezy/tests/blackbox/test_revision_info.py (+9/-9)
breezy/tests/blackbox/test_revno.py (+12/-12)
breezy/tests/blackbox/test_rmbranch.py (+2/-2)
breezy/tests/blackbox/test_script.py (+4/-4)
breezy/tests/blackbox/test_send.py (+16/-16)
breezy/tests/blackbox/test_serve.py (+3/-3)
breezy/tests/blackbox/test_shelve.py (+2/-2)
breezy/tests/blackbox/test_sign_my_commits.py (+6/-6)
breezy/tests/blackbox/test_split.py (+1/-1)
breezy/tests/blackbox/test_status.py (+4/-4)
breezy/tests/blackbox/test_switch.py (+5/-5)
breezy/tests/blackbox/test_tags.py (+23/-23)
breezy/tests/blackbox/test_uncommit.py (+22/-22)
breezy/tests/blackbox/test_unknowns.py (+1/-1)
breezy/tests/blackbox/test_update.py (+25/-25)
breezy/tests/blackbox/test_verify_signatures.py (+6/-6)
breezy/tests/blackbox/test_version_info.py (+4/-4)
breezy/tests/blackbox/test_versioning.py (+2/-2)
breezy/tests/commands/test_cat.py (+1/-1)
breezy/tests/fixtures.py (+2/-2)
breezy/tests/per_branch/test_branch.py (+5/-5)
breezy/tests/per_branch/test_iter_merge_sorted_revisions.py (+19/-19)
breezy/tests/per_branch/test_revision_id_to_revno.py (+2/-2)
breezy/tests/per_branch/test_stacking.py (+10/-10)
breezy/tests/per_branch/test_update.py (+4/-4)
breezy/tests/per_bzrdir/test_bzrdir.py (+3/-3)
breezy/tests/per_interbranch/test_copy_content_into.py (+2/-2)
breezy/tests/per_interbranch/test_fetch.py (+2/-2)
breezy/tests/per_interrepository/test_fetch.py (+37/-37)
breezy/tests/per_interrepository/test_interrepository.py (+2/-2)
breezy/tests/per_intertree/test_compare.py (+85/-85)
breezy/tests/per_intertree/test_file_content_matches.py (+10/-10)
breezy/tests/per_inventory/basics.py (+155/-155)
breezy/tests/per_merger.py (+56/-57)
breezy/tests/per_pack_repository.py (+8/-8)
breezy/tests/per_repository/test_file_graph.py (+2/-2)
breezy/tests/per_repository/test_repository.py (+3/-3)
breezy/tests/per_repository/test_signatures.py (+1/-1)
breezy/tests/per_repository_reference/test__make_parents_provider.py (+2/-2)
breezy/tests/per_repository_reference/test_check.py (+2/-2)
breezy/tests/per_repository_reference/test_commit_with_stacking.py (+21/-21)
breezy/tests/per_repository_vf/test_reconcile.py (+5/-5)
breezy/tests/per_repository_vf/test_refresh_data.py (+4/-4)
breezy/tests/per_repository_vf/test_repository.py (+6/-6)
breezy/tests/per_repository_vf/test_write_group.py (+7/-7)
breezy/tests/per_transport.py (+10/-10)
breezy/tests/per_tree/test_annotate_iter.py (+4/-4)
breezy/tests/per_tree/test_export.py (+1/-1)
breezy/tests/per_tree/test_get_root_id.py (+1/-1)
breezy/tests/per_tree/test_ids.py (+10/-10)
breezy/tests/per_workingtree/test_add.py (+9/-9)
breezy/tests/per_workingtree/test_add_reference.py (+2/-2)
breezy/tests/per_workingtree/test_annotate_iter.py (+22/-22)
breezy/tests/per_workingtree/test_commit.py (+4/-4)
breezy/tests/per_workingtree/test_content_filters.py (+10/-10)
breezy/tests/per_workingtree/test_eol_conversion.py (+5/-5)
breezy/tests/per_workingtree/test_inv.py (+37/-37)
breezy/tests/per_workingtree/test_is_ignored.py (+20/-20)
breezy/tests/per_workingtree/test_merge_from_branch.py (+11/-11)
breezy/tests/per_workingtree/test_move.py (+2/-2)
breezy/tests/per_workingtree/test_nested_specifics.py (+3/-3)
breezy/tests/per_workingtree/test_pull.py (+2/-2)
breezy/tests/per_workingtree/test_read_working_inventory.py (+1/-1)
breezy/tests/per_workingtree/test_readonly.py (+1/-1)
breezy/tests/per_workingtree/test_remove.py (+7/-7)
breezy/tests/per_workingtree/test_revision_tree.py (+2/-2)
breezy/tests/per_workingtree/test_set_root_id.py (+5/-5)
breezy/tests/per_workingtree/test_smart_add.py (+3/-3)
breezy/tests/per_workingtree/test_symlinks.py (+7/-7)
breezy/tests/per_workingtree/test_unversion.py (+1/-1)
breezy/tests/per_workingtree/test_workingtree.py (+15/-15)
breezy/tests/test__dirstate_helpers.py (+10/-10)
breezy/tests/test_annotate.py (+12/-12)
breezy/tests/test_atomicfile.py (+6/-6)
breezy/tests/test_branchbuilder.py (+1/-1)
breezy/tests/test_bundle.py (+119/-119)
breezy/tests/test_bzrdir.py (+1/-1)
breezy/tests/test_commit.py (+45/-45)
breezy/tests/test_commit_merge.py (+12/-12)
breezy/tests/test_conflicts.py (+3/-3)
breezy/tests/test_delta.py (+7/-7)
breezy/tests/test_diff.py (+83/-83)
breezy/tests/test_dirstate.py (+40/-40)
breezy/tests/test_export.py (+1/-1)
breezy/tests/test_extract.py (+10/-10)
breezy/tests/test_fetch.py (+36/-36)
breezy/tests/test_fetch_ghosts.py (+2/-2)
breezy/tests/test_foreign.py (+1/-1)
breezy/tests/test_inv.py (+127/-127)
breezy/tests/test_log.py (+38/-38)
breezy/tests/test_matchers.py (+10/-10)
breezy/tests/test_memorytree.py (+23/-22)
breezy/tests/test_merge.py (+219/-219)
breezy/tests/test_merge_core.py (+13/-13)
breezy/tests/test_merge_directive.py (+2/-2)
breezy/tests/test_mergetools.py (+4/-4)
breezy/tests/test_missing.py (+18/-18)
breezy/tests/test_msgeditor.py (+1/-1)
breezy/tests/test_osutils.py (+4/-4)
breezy/tests/test_read_bundle.py (+1/-1)
breezy/tests/test_reconfigure.py (+8/-8)
breezy/tests/test_remote.py (+2/-2)
breezy/tests/test_rename_map.py (+23/-23)
breezy/tests/test_repository.py (+80/-80)
breezy/tests/test_revert.py (+5/-5)
breezy/tests/test_revisionspec.py (+30/-30)
breezy/tests/test_revisiontree.py (+1/-1)
breezy/tests/test_script.py (+4/-4)
breezy/tests/test_selftest.py (+1/-1)
breezy/tests/test_sftp_transport.py (+3/-3)
breezy/tests/test_shelf.py (+132/-141)
breezy/tests/test_shelf_ui.py (+13/-13)
breezy/tests/test_smart.py (+18/-18)
breezy/tests/test_smart_transport.py (+204/-203)
breezy/tests/test_subsume.py (+7/-7)
breezy/tests/test_switch.py (+5/-5)
breezy/tests/test_testament.py (+9/-9)
breezy/tests/test_transform.py (+195/-195)
breezy/tests/test_tree.py (+60/-60)
breezy/tests/test_treeshape.py (+1/-1)
breezy/tests/test_uncommit.py (+1/-1)
breezy/tests/test_upgrade.py (+2/-2)
breezy/tests/test_upstream_import.py (+21/-27)
breezy/tests/test_version_info.py (+10/-13)
breezy/tests/test_weave.py (+1/-4)
breezy/tests/test_workingtree.py (+25/-25)
breezy/tests/test_workingtree_4.py (+34/-34)
breezy/tests/test_xml.py (+21/-21)
breezy/textfile.py (+1/-4)
breezy/transport/__init__.py (+12/-0)
breezy/transport/http/__init__.py (+2/-2)
breezy/transport/memory.py (+1/-0)
breezy/transport/sftp.py (+3/-6)
breezy/transport/ssh.py (+5/-6)
breezy/treebuilder.py (+1/-1)
breezy/workingtree.py (+4/-17)
python3.passing (+333/-1)
setup.py (+3/-7)
tools/check-newsbugs.py (+1/-4)
tools/generate_release_notes.py (+2/-8)
tools/rst2pdf.py (+2/-3)
tools/win32/brz-win32-bdist-postinstall.py (+2/-3)
tools/win32/brz_postinstall.py (+13/-18)
To merge this branch: bzr merge lp:~jelmer/brz/more-bees
Reviewer Review Type Date Requested Status
Martin Packman 2018-02-18 Approve on 2018-03-25
Review via email: mp+337919@code.launchpad.net

Description of the change

Add more bees. In particular:

* for file ids
* for revision ids
* for file contents in build_tree_contents()

To post a comment you must log in.
Martin Packman (gz) wrote :

A few inlines comments, but lets land and go from her.e

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2017-06-08 23:30:31 +0000
3+++ .bzrignore 2018-03-25 11:39:57 +0000
4@@ -71,3 +71,6 @@
5 breezy/_*.pyd
6 ./.ccache
7 .testrepository
8+python3.passing.old
9+python3.passing.new
10+selftest.log
11
12=== modified file 'breezy/branch.py'
13--- breezy/branch.py 2018-03-24 17:48:04 +0000
14+++ breezy/branch.py 2018-03-25 11:39:57 +0000
15@@ -53,6 +53,7 @@
16 from .lock import LogicalLockResult
17 from .sixish import (
18 BytesIO,
19+ text_type,
20 viewitems,
21 )
22 from .trace import mutter, mutter_callsite, note, is_quiet
23@@ -771,7 +772,7 @@
24 # FIXUP this and get_parent in a future branch format bump:
25 # read and rewrite the file. RBC 20060125
26 if url is not None:
27- if isinstance(url, unicode):
28+ if isinstance(url, text_type):
29 try:
30 url = url.encode('ascii')
31 except UnicodeEncodeError:
32
33=== modified file 'breezy/branchbuilder.py'
34--- breezy/branchbuilder.py 2018-03-14 02:53:33 +0000
35+++ breezy/branchbuilder.py 2018-03-25 11:39:57 +0000
36@@ -46,13 +46,13 @@
37 >>> builder = BranchBuilder(MemoryTransport("memory:///"))
38 >>> builder.start_series()
39 >>> builder.build_snapshot(None, [
40- ... ('add', ('', 'root-id', 'directory', '')),
41- ... ('add', ('filename', 'f-id', 'file', 'content\n'))],
42- ... revision_id='rev-id')
43+ ... ('add', ('', b'root-id', 'directory', '')),
44+ ... ('add', ('filename', b'f-id', 'file', 'content\n'))],
45+ ... revision_id=b'rev-id')
46 'rev-id'
47 >>> builder.build_snapshot(['rev-id'],
48- ... [('modify', ('f-id', 'new-content\n'))],
49- ... revision_id='rev2-id')
50+ ... [('modify', (b'f-id', 'new-content\n'))],
51+ ... revision_id=b'rev2-id')
52 'rev2-id'
53 >>> builder.finish_series()
54 >>> branch = builder.get_branch()
55
56=== modified file 'breezy/builtins.py'
57--- breezy/builtins.py 2018-03-24 10:24:48 +0000
58+++ breezy/builtins.py 2018-03-25 11:39:57 +0000
59@@ -3702,11 +3702,8 @@
60 def get_message(commit_obj):
61 """Callback to get commit message"""
62 if file:
63- f = open(file)
64- try:
65+ with open(file) as f:
66 my_message = f.read().decode(osutils.get_user_encoding())
67- finally:
68- f.close()
69 elif message is not None:
70 my_message = message
71 else:
72
73=== modified file 'breezy/bundle/bundle_data.py'
74--- breezy/bundle/bundle_data.py 2017-11-24 09:25:13 +0000
75+++ breezy/bundle/bundle_data.py 2018-03-25 11:39:57 +0000
76@@ -286,11 +286,8 @@
77 if rev.revision_id != revision_id:
78 raise AssertionError()
79 if sha1 != rev.inventory_sha1:
80- f = open(',,bogus-inv', 'wb')
81- try:
82+ with open(',,bogus-inv', 'wb') as f:
83 f.write(s)
84- finally:
85- f.close()
86 warning('Inventory sha hash mismatch for revision %s. %s'
87 ' != %s' % (revision_id, sha1, rev.inventory_sha1))
88
89
90=== modified file 'breezy/bundle/serializer/__init__.py'
91--- breezy/bundle/serializer/__init__.py 2018-02-17 02:02:38 +0000
92+++ breezy/bundle/serializer/__init__.py 2018-03-25 11:39:57 +0000
93@@ -36,7 +36,7 @@
94
95
96 # New bundles should try to use this header format
97-BUNDLE_HEADER = '# Bazaar revision bundle v'
98+BUNDLE_HEADER = b'# Bazaar revision bundle v'
99 BUNDLE_HEADER_RE = re.compile(
100 br'^# Bazaar revision bundle v(?P<version>\d+[\w.]*)(?P<lineending>\r?)\n$')
101 CHANGESET_OLD_HEADER_RE = re.compile(
102
103=== modified file 'breezy/bzr/branch.py'
104--- breezy/bzr/branch.py 2018-03-24 23:49:53 +0000
105+++ breezy/bzr/branch.py 2018-03-25 11:39:57 +0000
106@@ -348,7 +348,7 @@
107 with self.lock_write():
108 self._master_branch_cache = None
109 if location:
110- self._transport.put_bytes('bound', location+b'\n',
111+ self._transport.put_bytes('bound', location.encode('utf-8')+b'\n',
112 mode=self.controldir._get_file_mode())
113 else:
114 try:
115@@ -520,13 +520,10 @@
116 with self.lock_read():
117 if self._reference_info is not None:
118 return self._reference_info
119- rio_file = self._transport.get('references')
120- try:
121+ with self._transport.get('references') as rio_file:
122 stanzas = rio.read_stanzas(rio_file)
123 info_dict = dict((s['file_id'], (s['tree_path'],
124 s['branch_location'])) for s in stanzas)
125- finally:
126- rio_file.close()
127 self._reference_info = info_dict
128 return info_dict
129
130@@ -969,8 +966,7 @@
131 if name is None:
132 name = a_controldir._get_selected_branch()
133 branch_transport = a_controldir.get_branch_transport(self, name=name)
134- branch_transport.put_bytes('location',
135- target_branch.user_url)
136+ branch_transport.put_bytes('location', target_branch.user_url)
137 branch_transport.put_bytes('format', self.as_string())
138 branch = self.open(a_controldir, name, _found=True,
139 possible_transports=[target_branch.controldir.root_transport])
140
141=== modified file 'breezy/bzr/bzrdir.py'
142--- breezy/bzr/bzrdir.py 2018-03-24 17:48:04 +0000
143+++ breezy/bzr/bzrdir.py 2018-03-25 11:39:57 +0000
144@@ -847,7 +847,7 @@
145 ret = []
146 try:
147 for name in f:
148- ret.append(name.rstrip("\n"))
149+ ret.append(name.rstrip(b"\n"))
150 finally:
151 f.close()
152 return ret
153
154=== modified file 'breezy/bzr/dirstate.py'
155--- breezy/bzr/dirstate.py 2017-11-12 18:17:03 +0000
156+++ breezy/bzr/dirstate.py 2018-03-25 11:39:57 +0000
157@@ -301,12 +301,9 @@
158
159 def stat_and_sha1(self, abspath):
160 """Return the stat and sha1 of a file given its absolute path."""
161- file_obj = file(abspath, 'rb')
162- try:
163+ with file(abspath, 'rb') as file_obj:
164 statvalue = os.fstat(file_obj.fileno())
165 sha1 = osutils.sha_file(file_obj)
166- finally:
167- file_obj.close()
168 return statvalue, sha1
169
170
171
172=== modified file 'breezy/bzr/inventory.py'
173--- breezy/bzr/inventory.py 2018-03-25 02:13:54 +0000
174+++ breezy/bzr/inventory.py 2018-03-25 11:39:57 +0000
175@@ -123,7 +123,7 @@
176 src/hello.c
177 src/wibble
178 src/wibble/wibble.c
179- >>> i.id2path('2326')
180+ >>> i.id2path(b'2326')
181 'src/wibble/wibble.c'
182 """
183
184@@ -655,9 +655,9 @@
185 """Return as a string the path to file_id.
186
187 >>> i = Inventory()
188- >>> e = i.add(InventoryDirectory('src-id', 'src', ROOT_ID))
189- >>> e = i.add(InventoryFile('foo-id', 'foo.c', parent_id='src-id'))
190- >>> print i.id2path('foo-id')
191+ >>> e = i.add(InventoryDirectory(b'src-id', 'src', ROOT_ID))
192+ >>> e = i.add(InventoryFile(b'foo-id', 'foo.c', parent_id='src-id'))
193+ >>> print i.id2path(b'foo-id')
194 src/foo.c
195
196 :raises NoSuchId: If file_id is not present in the inventory.
197@@ -679,7 +679,7 @@
198 return
199 from_dir = self.root
200 yield '', self.root
201- elif isinstance(from_dir, (str, text_type)):
202+ elif isinstance(from_dir, bytes):
203 from_dir = self.get_entry(from_dir)
204
205 # unrolling the recursive called changed the time from
206
207=== modified file 'breezy/bzr/knit.py'
208--- breezy/bzr/knit.py 2018-02-17 02:55:34 +0000
209+++ breezy/bzr/knit.py 2018-03-25 11:39:57 +0000
210@@ -1044,7 +1044,7 @@
211 # Note: line_bytes is not modified to add a newline, that is tracked
212 # via the no_eol flag. 'lines' *is* modified, because that is the
213 # general values needed by the Content code.
214- if line_bytes and line_bytes[-1] != '\n':
215+ if line_bytes and not line_bytes.endswith(b'\n'):
216 options.append('no-eol')
217 no_eol = True
218 # Copy the existing list, or create a new one
219@@ -1053,7 +1053,7 @@
220 else:
221 lines = lines[:]
222 # Replace the last line with one that ends in a final newline
223- lines[-1] = lines[-1] + '\n'
224+ lines[-1] = lines[-1] + b'\n'
225 if lines is None:
226 lines = osutils.split_lines(line_bytes)
227
228@@ -1090,7 +1090,7 @@
229 # _record_to_data.
230 dense_lines = [line_bytes]
231 if no_eol:
232- dense_lines.append('\n')
233+ dense_lines.append(b'\n')
234 size, data = self._record_to_data(key, digest,
235 lines, dense_lines)
236 else:
237@@ -1946,26 +1946,25 @@
238 # 4168 calls in 2880 217 internal
239 # 4168 calls to _parse_record_header in 2121
240 # 4168 calls to readlines in 330
241- df = gzip.GzipFile(mode='rb', fileobj=BytesIO(data))
242- try:
243- record_contents = df.readlines()
244- except Exception as e:
245- raise KnitCorrupt(self, "Corrupt compressed record %r, got %s(%s)" %
246- (data, e.__class__.__name__, str(e)))
247- header = record_contents.pop(0)
248- rec = self._split_header(header)
249- last_line = record_contents.pop()
250- if len(record_contents) != int(rec[2]):
251- raise KnitCorrupt(self,
252- 'incorrect number of lines %s != %s'
253- ' for version {%s} %s'
254- % (len(record_contents), int(rec[2]),
255- rec[1], record_contents))
256- if last_line != 'end %s\n' % rec[1]:
257- raise KnitCorrupt(self,
258- 'unexpected version end line %r, wanted %r'
259- % (last_line, rec[1]))
260- df.close()
261+ with gzip.GzipFile(mode='rb', fileobj=BytesIO(data)) as df:
262+ try:
263+ record_contents = df.readlines()
264+ except Exception as e:
265+ raise KnitCorrupt(self, "Corrupt compressed record %r, got %s(%s)" %
266+ (data, e.__class__.__name__, str(e)))
267+ header = record_contents.pop(0)
268+ rec = self._split_header(header)
269+ last_line = record_contents.pop()
270+ if len(record_contents) != int(rec[2]):
271+ raise KnitCorrupt(self,
272+ 'incorrect number of lines %s != %s'
273+ ' for version {%s} %s'
274+ % (len(record_contents), int(rec[2]),
275+ rec[1], record_contents))
276+ if last_line != b'end %s\n' % rec[1]:
277+ raise KnitCorrupt(self,
278+ 'unexpected version end line %r, wanted %r'
279+ % (last_line, rec[1]))
280 return rec, record_contents
281
282 def _read_records_iter(self, records):
283@@ -2044,14 +2043,14 @@
284 this function spends less time resizing the final string.
285 :return: (len, a BytesIO instance with the raw data ready to read.)
286 """
287- chunks = ["version %s %d %s\n" % (key[-1], len(lines), digest)]
288+ chunks = [b"version %s %d %s\n" % (key[-1], len(lines), digest)]
289 chunks.extend(dense_lines or lines)
290- chunks.append("end %s\n" % key[-1])
291+ chunks.append(b"end " + key[-1] + b"\n")
292 for chunk in chunks:
293- if not isinstance(chunk, str):
294+ if not isinstance(chunk, bytes):
295 raise AssertionError(
296 'data must be plain bytes was %s' % type(chunk))
297- if lines and lines[-1][-1] != '\n':
298+ if lines and not lines[-1].endswith(b'\n'):
299 raise ValueError('corrupt lines value %r' % lines)
300 compressed_bytes = b''.join(tuned_gzip.chunks_to_gzip(chunks))
301 return len(compressed_bytes), compressed_bytes
302@@ -3215,7 +3214,7 @@
303 opaque index memo. For _KnitKeyAccess the memo is (key, pos,
304 length), where the key is the record key.
305 """
306- if not isinstance(raw_data, str):
307+ if not isinstance(raw_data, bytes):
308 raise AssertionError(
309 'data must be plain bytes was %s' % type(raw_data))
310 result = []
311
312=== modified file 'breezy/bzr/smart/protocol.py'
313--- breezy/bzr/smart/protocol.py 2018-02-17 02:02:38 +0000
314+++ breezy/bzr/smart/protocol.py 2018-03-25 11:39:57 +0000
315@@ -120,14 +120,14 @@
316 # support multiple chunks?
317 def _encode_bulk_data(self, body):
318 """Encode body as a bulk data chunk."""
319- return ''.join(('%d\n' % len(body), body, 'done\n'))
320+ return b''.join((b'%d\n' % len(body), body, b'done\n'))
321
322 def _serialise_offsets(self, offsets):
323 """Serialise a readv offset list."""
324 txt = []
325 for start, length in offsets:
326- txt.append('%d,%d' % (start, length))
327- return '\n'.join(txt)
328+ txt.append(b'%d,%d' % (start, length))
329+ return b'\n'.join(txt)
330
331
332 class SmartServerRequestProtocolOne(SmartProtocolBase):
333@@ -138,9 +138,9 @@
334 self._backing_transport = backing_transport
335 self._root_client_path = root_client_path
336 self._jail_root = jail_root
337- self.unused_data = ''
338+ self.unused_data = b''
339 self._finished = False
340- self.in_buffer = ''
341+ self.in_buffer = b''
342 self._has_dispatched = False
343 self.request = None
344 self._body_decoder = None
345@@ -171,7 +171,7 @@
346 if self.request.finished_reading:
347 # trivial request
348 self.unused_data = self.in_buffer
349- self.in_buffer = ''
350+ self.in_buffer = b''
351 self._send_response(self.request.response)
352 except KeyboardInterrupt:
353 raise
354@@ -194,7 +194,7 @@
355 # nothing to do.XXX: this routine should be a single state
356 # machine too.
357 self.unused_data += self.in_buffer
358- self.in_buffer = ''
359+ self.in_buffer = b''
360 return
361 if self._body_decoder is None:
362 self._body_decoder = LengthPrefixedBodyDecoder()
363@@ -209,7 +209,7 @@
364 if self.request.response is not None:
365 self._send_response(self.request.response)
366 self.unused_data = self.in_buffer
367- self.in_buffer = ''
368+ self.in_buffer = b''
369 else:
370 if self.request.finished_reading:
371 raise AssertionError(
372@@ -266,9 +266,9 @@
373 def _write_success_or_failure_prefix(self, response):
374 """Write the protocol specific success/failure prefix."""
375 if response.is_successful():
376- self._write_func('success\n')
377+ self._write_func(b'success\n')
378 else:
379- self._write_func('failed\n')
380+ self._write_func(b'failed\n')
381
382 def _write_protocol_version(self):
383 r"""Write any prefixes this protocol requires.
384@@ -347,14 +347,14 @@
385 self.finished_reading = False
386 self._in_buffer_list = []
387 self._in_buffer_len = 0
388- self.unused_data = ''
389+ self.unused_data = b''
390 self.bytes_left = None
391 self._number_needed_bytes = None
392
393 def _get_in_buffer(self):
394 if len(self._in_buffer_list) == 1:
395 return self._in_buffer_list[0]
396- in_buffer = ''.join(self._in_buffer_list)
397+ in_buffer = b''.join(self._in_buffer_list)
398 if len(in_buffer) != self._in_buffer_len:
399 raise AssertionError(
400 "Length of buffer did not match expected value: %s != %s"
401@@ -466,7 +466,7 @@
402
403 def _extract_line(self):
404 in_buf = self._get_in_buffer()
405- pos = in_buf.find('\n')
406+ pos = in_buf.find(b'\n')
407 if pos == -1:
408 # We haven't read a complete line yet, so request more bytes before
409 # we continue.
410@@ -489,7 +489,7 @@
411
412 def _state_accept_expecting_header(self):
413 prefix = self._extract_line()
414- if prefix == 'chunked':
415+ if prefix == b'chunked':
416 self.state_accept = self._state_accept_expecting_length
417 else:
418 raise errors.SmartProtocolError(
419@@ -497,12 +497,12 @@
420
421 def _state_accept_expecting_length(self):
422 prefix = self._extract_line()
423- if prefix == 'ERR':
424+ if prefix == b'ERR':
425 self.error = True
426 self.error_in_progress = []
427 self._state_accept_expecting_length()
428 return
429- elif prefix == 'END':
430+ elif prefix == b'END':
431 # We've read the end-of-body marker.
432 # Any further bytes are unused data, including the bytes left in
433 # the _in_buffer.
434@@ -510,7 +510,7 @@
435 return
436 else:
437 self.bytes_left = int(prefix, 16)
438- self.chunk_in_progress = ''
439+ self.chunk_in_progress = b''
440 self.state_accept = self._state_accept_reading_chunk
441
442 def _state_accept_reading_chunk(self):
443@@ -541,8 +541,8 @@
444 _StatefulDecoder.__init__(self)
445 self.state_accept = self._state_accept_expecting_length
446 self.state_read = self._state_read_no_data
447- self._body = ''
448- self._trailer_buffer = ''
449+ self._body = b''
450+ self._trailer_buffer = b''
451
452 def next_read_size(self):
453 if self.bytes_left is not None:
454@@ -566,7 +566,7 @@
455
456 def _state_accept_expecting_length(self):
457 in_buf = self._get_in_buffer()
458- pos = in_buf.find('\n')
459+ pos = in_buf.find(b'\n')
460 if pos == -1:
461 return
462 self.bytes_left = int(in_buf[:pos])
463@@ -592,8 +592,8 @@
464 self._set_in_buffer(None)
465 # TODO: what if the trailer does not match "done\n"? Should this raise
466 # a ProtocolViolation exception?
467- if self._trailer_buffer.startswith('done\n'):
468- self.unused_data = self._trailer_buffer[len('done\n'):]
469+ if self._trailer_buffer.startswith(b'done\n'):
470+ self.unused_data = self._trailer_buffer[len(b'done\n'):]
471 self.state_accept = self._state_accept_reading_unused
472 self.finished_reading = True
473
474@@ -602,11 +602,11 @@
475 self._set_in_buffer(None)
476
477 def _state_read_no_data(self):
478- return ''
479+ return b''
480
481 def _state_read_body_buffer(self):
482 result = self._body
483- self._body = ''
484+ self._body = b''
485 return result
486
487
488@@ -777,7 +777,7 @@
489
490 while not _body_decoder.finished_reading:
491 bytes = self._request.read_bytes(_body_decoder.next_read_size())
492- if bytes == '':
493+ if bytes == b'':
494 # end of file encountered reading from server
495 raise errors.ConnectionReset(
496 "Connection lost while reading response body.")
497@@ -866,7 +866,7 @@
498 _body_decoder = ChunkedBodyDecoder()
499 while not _body_decoder.finished_reading:
500 bytes = self._request.read_bytes(_body_decoder.next_read_size())
501- if bytes == '':
502+ if bytes == b'':
503 # end of file encountered reading from server
504 raise errors.ConnectionReset(
505 "Connection lost while reading streamed body.")
506@@ -1101,7 +1101,7 @@
507
508 def flush(self):
509 if self._buf:
510- self._real_write_func(''.join(self._buf))
511+ self._real_write_func(b''.join(self._buf))
512 del self._buf[:]
513 self._buf_len = 0
514
515@@ -1109,8 +1109,8 @@
516 """Serialise a readv offset list."""
517 txt = []
518 for start, length in offsets:
519- txt.append('%d,%d' % (start, length))
520- return '\n'.join(txt)
521+ txt.append(b'%d,%d' % (start, length))
522+ return b'\n'.join(txt)
523
524 def _write_protocol_version(self):
525 self._write_func(MESSAGE_VERSION_THREE)
526@@ -1124,7 +1124,7 @@
527 self._write_prefixed_bencode(headers)
528
529 def _write_structure(self, args):
530- self._write_func('s')
531+ self._write_func(b's')
532 utf8_args = []
533 for arg in args:
534 if isinstance(arg, text_type):
535@@ -1134,22 +1134,22 @@
536 self._write_prefixed_bencode(utf8_args)
537
538 def _write_end(self):
539- self._write_func('e')
540+ self._write_func(b'e')
541 self.flush()
542
543 def _write_prefixed_body(self, bytes):
544- self._write_func('b')
545+ self._write_func(b'b')
546 self._write_func(struct.pack('!L', len(bytes)))
547 self._write_func(bytes)
548
549 def _write_chunked_body_start(self):
550- self._write_func('oC')
551+ self._write_func(b'oC')
552
553 def _write_error_status(self):
554- self._write_func('oE')
555+ self._write_func(b'oE')
556
557 def _write_success_status(self):
558- self._write_func('oS')
559+ self._write_func(b'oS')
560
561
562 class ProtocolThreeResponder(_ProtocolThreeEncoder):
563
564=== modified file 'breezy/bzr/smart/repository.py'
565--- breezy/bzr/smart/repository.py 2018-02-24 15:50:23 +0000
566+++ breezy/bzr/smart/repository.py 2018-03-25 11:39:57 +0000
567@@ -834,16 +834,13 @@
568 return tmp_dirname, tmp_repo
569
570 def _tarfile_response(self, tmp_dirname, compression):
571- temp = tempfile.NamedTemporaryFile()
572- try:
573+ with tempfile.NamedTemporaryFile() as temp:
574 self._tarball_of_dir(tmp_dirname, compression, temp.file)
575 # all finished; write the tempfile out to the network
576 temp.seek(0)
577 return SuccessfulSmartServerResponse(('ok',), temp.read())
578 # FIXME: Don't read the whole thing into memory here; rather stream
579 # it out from the file onto the network. mbp 20070411
580- finally:
581- temp.close()
582
583 def _tarball_of_dir(self, dirname, compression, ofile):
584 import tarfile
585
586=== modified file 'breezy/bzr/smart/vfs.py'
587--- breezy/bzr/smart/vfs.py 2017-07-21 13:51:15 +0000
588+++ breezy/bzr/smart/vfs.py 2018-03-25 11:39:57 +0000
589@@ -187,17 +187,17 @@
590 def do_body(self, body_bytes):
591 """accept offsets for a readv request."""
592 offsets = self._deserialise_offsets(body_bytes)
593- backing_bytes = ''.join(bytes for offset, bytes in
594+ backing_bytes = b''.join(bytes for offset, bytes in
595 self._backing_transport.readv(self._relpath, offsets))
596- return request.SuccessfulSmartServerResponse(('readv',), backing_bytes)
597+ return request.SuccessfulSmartServerResponse((b'readv',), backing_bytes)
598
599 def _deserialise_offsets(self, text):
600 # XXX: FIXME this should be on the protocol object.
601 offsets = []
602- for line in text.split('\n'):
603+ for line in text.split(b'\n'):
604 if not line:
605 continue
606- start, length = line.split(',')
607+ start, length = line.split(b',')
608 offsets.append((int(start), int(length)))
609 return offsets
610
611
612=== modified file 'breezy/bzr/versionedfile.py'
613--- breezy/bzr/versionedfile.py 2018-03-02 00:38:34 +0000
614+++ breezy/bzr/versionedfile.py 2018-03-25 11:39:57 +0000
615@@ -470,7 +470,7 @@
616 def _check_lines_are_lines(self, lines):
617 """Check that the lines really are full lines without inline EOL."""
618 for line in lines:
619- if '\n' in line[:-1]:
620+ if b'\n' in line[:-1]:
621 raise errors.BzrBadParameterContainsNewline("lines")
622
623 def get_format_signature(self):
624
625=== modified file 'breezy/bzr/weavefile.py'
626--- breezy/bzr/weavefile.py 2018-02-17 02:02:38 +0000
627+++ breezy/bzr/weavefile.py 2018-03-25 11:39:57 +0000
628@@ -65,20 +65,20 @@
629 f.write(b'i\n')
630 f.write(b'1 ' + weave._sha1s[version] + b'\n')
631 f.write(b'n ' + weave._names[version] + b'\n')
632- f.write('\n')
633+ f.write(b'\n')
634
635 f.write(b'w\n')
636
637 for l in weave._weave:
638 if isinstance(l, tuple):
639- if l[0] == '}':
640+ if l[0] == b'}':
641 f.write(b'}\n')
642 else:
643- f.write(b'%s %d\n' % l)
644+ f.write(l[0] + b' %d\n' % l[1])
645 else: # text line
646 if not l:
647 f.write(b', \n')
648- elif l[-1] == '\n':
649+ elif l[-1] == b'\n':
650 f.write(b'. ' + l)
651 else:
652 f.write(b', ' + l + b'\n')
653
654=== modified file 'breezy/bzr/workingtree.py'
655--- breezy/bzr/workingtree.py 2018-03-25 02:13:54 +0000
656+++ breezy/bzr/workingtree.py 2018-03-25 11:39:57 +0000
657@@ -276,11 +276,8 @@
658 def _reset_data(self):
659 """Reset transient data that cannot be revalidated."""
660 self._inventory_is_modified = False
661- f = self._transport.get('inventory')
662- try:
663+ with self._transport.get('inventory') as f:
664 result = self._deserialize(f)
665- finally:
666- f.close()
667 self._set_inventory(result, dirty=False)
668
669 def store_uncommitted(self):
670@@ -570,11 +567,8 @@
671 ignore_globs.update(ignores.get_runtime_ignores())
672 ignore_globs.update(ignores.get_user_ignores())
673 if self.has_filename(self._format.ignore_filename):
674- f = self.get_file(self._format.ignore_filename)
675- try:
676+ with self.get_file(self._format.ignore_filename) as f:
677 ignore_globs.update(ignores.parse_ignore_file(f))
678- finally:
679- f.close()
680 self._ignoreset = ignore_globs
681 return ignore_globs
682
683@@ -619,11 +613,8 @@
684 with self.lock_read():
685 if self._inventory_is_modified:
686 raise errors.InventoryModified(self)
687- f = self._transport.get('inventory')
688- try:
689+ with self._transport.get('inventory') as f:
690 result = self._deserialize(f)
691- finally:
692- f.close()
693 self._set_inventory(result, dirty=False)
694 return result
695
696
697=== modified file 'breezy/bzr/workingtree_4.py'
698--- breezy/bzr/workingtree_4.py 2018-03-25 02:13:54 +0000
699+++ breezy/bzr/workingtree_4.py 2018-03-25 11:39:57 +0000
700@@ -1379,14 +1379,11 @@
701 """See dirstate.SHA1Provider.stat_and_sha1()."""
702 filters = self.tree._content_filter_stack(
703 self.tree.relpath(osutils.safe_unicode(abspath)))
704- file_obj = file(abspath, 'rb', 65000)
705- try:
706+ with file(abspath, 'rb', 65000) as file_obj:
707 statvalue = os.fstat(file_obj.fileno())
708 if filters:
709 file_obj = _mod_filters.filtered_input_file(file_obj, filters)
710 sha1 = osutils.size_sha_file(file_obj)[1]
711- finally:
712- file_obj.close()
713 return statvalue, sha1
714
715
716
717=== modified file 'breezy/bzr/xml_serializer.py'
718--- breezy/bzr/xml_serializer.py 2018-02-17 02:02:38 +0000
719+++ breezy/bzr/xml_serializer.py 2018-03-25 11:39:57 +0000
720@@ -47,7 +47,7 @@
721 errors,
722 lazy_regex,
723 )
724-from ..sixish import text_type
725+from ..sixish import text_type, bytesintern
726 from . import (
727 inventory,
728 serializer,
729@@ -151,7 +151,7 @@
730 if a_str.__class__ is text_type:
731 return _encode_utf8(a_str)
732 else:
733- return intern(a_str)
734+ return bytesintern(a_str)
735
736
737 _utf8_re = lazy_regex.lazy_compile(b'[&<>\'\"]|[\x80-\xff]+')
738
739=== modified file 'breezy/cmd_test_script.py'
740--- breezy/cmd_test_script.py 2017-05-22 00:56:52 +0000
741+++ breezy/cmd_test_script.py 2018-03-25 11:39:57 +0000
742@@ -46,11 +46,8 @@
743 from breezy import tests
744 from breezy.tests.script import TestCaseWithTransportAndScript
745
746- f = open(infile)
747- try:
748+ with open(infile) as f:
749 script = f.read()
750- finally:
751- f.close()
752
753 class Test(TestCaseWithTransportAndScript):
754
755
756=== modified file 'breezy/diff.py'
757--- breezy/diff.py 2017-11-13 22:07:48 +0000
758+++ breezy/diff.py 2018-03-25 11:39:57 +0000
759@@ -816,11 +816,8 @@
760 raise
761 source = tree.get_file(relpath, file_id)
762 try:
763- target = open(full_path, 'wb')
764- try:
765+ with open(full_path, 'wb') as target:
766 osutils.pumpfile(source, target)
767- finally:
768- target.close()
769 finally:
770 source.close()
771 try:
772@@ -871,11 +868,8 @@
773 file_id=file_id)
774 command = self._get_command(old_abs_path, new_abs_path)
775 subprocess.call(command, cwd=self._root)
776- new_file = open(new_abs_path, 'rb')
777- try:
778+ with open(new_abs_path, 'rb') as new_file:
779 return new_file.read()
780- finally:
781- new_file.close()
782
783
784 class DiffTree(object):
785
786=== modified file 'breezy/doc_generate/autodoc_rstx.py'
787--- breezy/doc_generate/autodoc_rstx.py 2017-12-21 16:44:19 +0000
788+++ breezy/doc_generate/autodoc_rstx.py 2018-03-25 11:39:57 +0000
789@@ -130,9 +130,8 @@
790 """Dump text for a topic to a file."""
791 topic_id = "%s-%s" % (topic, "help")
792 filename = breezy.osutils.pathjoin(output_dir, topic_id + ".txt")
793- f = open(filename, "w")
794- f.write(text.encode('utf-8'))
795- f.close()
796+ with open(filename, "w") as f:
797+ f.write(text.encode('utf-8'))
798 return topic_id
799
800
801
802=== modified file 'breezy/export/dir_exporter.py'
803--- breezy/export/dir_exporter.py 2018-03-04 15:59:37 +0000
804+++ breezy/export/dir_exporter.py 2018-03-25 11:39:57 +0000
805@@ -82,11 +82,8 @@
806 mode = 0o666
807 if tree.is_executable(treepath, file_id):
808 mode = 0o777
809- out = os.fdopen(os.open(fullpath, flags, mode), 'wb')
810- try:
811+ with os.fdopen(os.open(fullpath, flags, mode), 'wb') as out:
812 out.writelines(chunks)
813- finally:
814- out.close()
815 if force_mtime is not None:
816 mtime = force_mtime
817 else:
818
819=== modified file 'breezy/generate_ids.py'
820--- breezy/generate_ids.py 2017-07-21 13:20:17 +0000
821+++ breezy/generate_ids.py 2018-03-25 11:39:57 +0000
822@@ -35,8 +35,8 @@
823
824 # the regex removes any weird characters; we don't escape them
825 # but rather just pull them out
826-_file_id_chars_re = lazy_regex.lazy_compile(r'[^\w.]')
827-_rev_id_chars_re = lazy_regex.lazy_compile(r'[^-\w.+@]')
828+_file_id_chars_re = lazy_regex.lazy_compile('[^\\w.]')
829+_rev_id_chars_re = lazy_regex.lazy_compile('[^-\\w.+@]')
830 _gen_file_id_suffix = None
831 _gen_file_id_serial = 0
832
833
834=== modified file 'breezy/iterablefile.py'
835--- breezy/iterablefile.py 2017-06-10 01:57:00 +0000
836+++ breezy/iterablefile.py 2018-03-25 11:39:57 +0000
837@@ -132,6 +132,18 @@
838
839 closed = property(lambda x: x._closed)
840
841+ def __enter__(self):
842+ return self
843+
844+ def __exit__(self, exc_type, exc_val, exc_tb):
845+ # If there was an error raised, prefer the original one
846+ try:
847+ self.close()
848+ except:
849+ if exc_type is None:
850+ raise
851+ return False
852+
853 def flush(self):
854 """No-op for standard compliance.
855 >>> f = IterableFile([])
856
857=== modified file 'breezy/mutabletree.py'
858--- breezy/mutabletree.py 2018-02-08 22:08:05 +0000
859+++ breezy/mutabletree.py 2018-03-25 11:39:57 +0000
860@@ -104,7 +104,7 @@
861 if isinstance(files, (str, text_type)):
862 # XXX: Passing a single string is inconsistent and should be
863 # deprecated.
864- if not (ids is None or isinstance(ids, (str, text_type))):
865+ if not (ids is None or isinstance(ids, bytes)):
866 raise AssertionError()
867 if not (kinds is None or isinstance(kinds, (str, text_type))):
868 raise AssertionError()
869
870=== modified file 'breezy/plugins/commitfromnews/tests/test_committemplate.py'
871--- breezy/plugins/commitfromnews/tests/test_committemplate.py 2017-11-16 00:39:04 +0000
872+++ breezy/plugins/commitfromnews/tests/test_committemplate.py 2018-03-25 11:39:57 +0000
873@@ -67,10 +67,10 @@
874 builder.start_series()
875 builder.build_snapshot(None,
876 [('add', ('', None, 'directory', None)),
877- ('add', ('foo', 'foo-id', 'file', 'a\nb\nc\nd\ne\n')),
878+ ('add', ('foo', b'foo-id', 'file', 'a\nb\nc\nd\ne\n')),
879 ],
880 message_callback=msgeditor.generate_commit_message_template,
881- revision_id='BASE-id')
882+ revision_id=b'BASE-id')
883 builder.finish_series()
884 self.assertEqual([None], self.messages)
885
886@@ -82,10 +82,10 @@
887 content = INITIAL_NEWS_CONTENT
888 builder.build_snapshot(None,
889 [('add', ('', None, 'directory', None)),
890- ('add', ('NEWS', 'foo-id', 'file', content)),
891+ ('add', ('NEWS', b'foo-id', 'file', content)),
892 ],
893 message_callback=msgeditor.generate_commit_message_template,
894- revision_id='BASE-id')
895+ revision_id=b'BASE-id')
896 builder.finish_series()
897 self.assertEqual([content], self.messages)
898
899@@ -115,10 +115,10 @@
900 """
901 builder.build_snapshot(None,
902 [('add', ('', None, 'directory', None)),
903- ('add', ('NEWS', 'foo-id', 'file', orig_content)),
904- ], revision_id='BASE-id')
905+ ('add', ('NEWS', b'foo-id', 'file', orig_content)),
906+ ], revision_id=b'BASE-id')
907 builder.build_snapshot(None,
908- [('modify', ('foo-id', mod_content)),
909+ [('modify', (b'foo-id', mod_content)),
910 ],
911 message_callback=msgeditor.generate_commit_message_template)
912 builder.finish_series()
913@@ -152,10 +152,10 @@
914 """
915 builder.build_snapshot(None,
916 [('add', ('', None, 'directory', None)),
917- ('add', ('NEWS', 'foo-id', 'file', orig_content)),
918- ], revision_id='BASE-id')
919+ ('add', ('NEWS', b'foo-id', 'file', orig_content)),
920+ ], revision_id=b'BASE-id')
921 builder.build_snapshot(None,
922- [('modify', ('foo-id', mod_content)),
923+ [('modify', (b'foo-id', mod_content)),
924 ],
925 message_callback=msgeditor.generate_commit_message_template)
926 builder.finish_series()
927
928=== modified file 'breezy/plugins/email/tests/testemail.py'
929--- breezy/plugins/email/tests/testemail.py 2017-06-10 16:40:42 +0000
930+++ breezy/plugins/email/tests/testemail.py 2018-03-25 11:39:57 +0000
931@@ -176,7 +176,7 @@
932 my_config = config.MemoryStack(text)
933 self.branch = BzrDir.create_branch_convenience('.')
934 tree = self.branch.controldir.open_workingtree()
935- tree.commit('foo bar baz\nfuzzy\nwuzzy', rev_id='A',
936+ tree.commit('foo bar baz\nfuzzy\nwuzzy', rev_id=b'A',
937 allow_pointless=True,
938 timestamp=1,
939 timezone=0,
940
941=== modified file 'breezy/plugins/fastimport/revision_store.py'
942--- breezy/plugins/fastimport/revision_store.py 2018-03-24 23:36:29 +0000
943+++ breezy/plugins/fastimport/revision_store.py 2018-03-25 11:39:57 +0000
944@@ -17,7 +17,7 @@
945
946 from __future__ import absolute_import
947
948-from ...sixish import StringIO
949+from io import BytesIO
950
951 from ... import (
952 errors,
953@@ -68,7 +68,7 @@
954
955 def get_file_with_stat(self, path, file_id=None):
956 content = self.get_file_text(path, file_id)
957- sio = StringIO(content)
958+ sio = BytesIO(content)
959 return sio, None
960
961 def get_file_text(self, path, file_id=None):
962
963=== modified file 'breezy/plugins/fastimport/tests/test_commands.py'
964--- breezy/plugins/fastimport/tests/test_commands.py 2017-05-23 23:37:18 +0000
965+++ breezy/plugins/fastimport/tests/test_commands.py 2018-03-25 11:39:57 +0000
966@@ -188,7 +188,7 @@
967 data2 = self.run_bzr("fast-export bl")[0]
968 self.assertEquals(data1, data2)
969
970-simple_fast_import_stream = """commit refs/heads/master
971+simple_fast_import_stream = b"""commit refs/heads/master
972 mark :1
973 committer Jelmer Vernooij <jelmer@samba.org> 1299718135 +0100
974 data 7
975@@ -236,7 +236,7 @@
976 _test_needs_features = [FastimportFeature]
977
978 def test_empty(self):
979- self.build_tree_contents([('empty.fi', "")])
980+ self.build_tree_contents([('empty.fi', b"")])
981 self.make_branch_and_tree("br")
982 self.assertEquals("", self.run_bzr("fast-import empty.fi br")[0])
983
984@@ -247,7 +247,7 @@
985 self.assertEquals(1, tree.branch.revno())
986
987 def test_missing_bytes(self):
988- self.build_tree_contents([('empty.fi', """
989+ self.build_tree_contents([('empty.fi', b"""
990 commit refs/heads/master
991 mark :1
992 committer
993@@ -262,11 +262,11 @@
994 _test_needs_features = [FastimportFeature]
995
996 def test_empty(self):
997- self.build_tree_contents([('empty.fi', "")])
998+ self.build_tree_contents([('empty.fi', b"")])
999 self.make_branch_and_tree("br")
1000 self.assertEquals("", self.run_bzr("fast-import-filter -")[0])
1001
1002 def test_default_stdin(self):
1003- self.build_tree_contents([('empty.fi', "")])
1004+ self.build_tree_contents([('empty.fi', b"")])
1005 self.make_branch_and_tree("br")
1006 self.assertEquals("", self.run_bzr("fast-import-filter")[0])
1007
1008=== modified file 'breezy/plugins/fastimport/tests/test_revision_store.py'
1009--- breezy/plugins/fastimport/tests/test_revision_store.py 2017-11-13 12:09:54 +0000
1010+++ breezy/plugins/fastimport/tests/test_revision_store.py 2018-03-25 11:39:57 +0000
1011@@ -49,42 +49,42 @@
1012 inv.add(inventory.make_entry(kind, basename, parent_id, file_id))
1013
1014 def make_trivial_basis_inv(self):
1015- basis_inv = inventory.Inventory('TREE_ROOT')
1016- self.invAddEntry(basis_inv, 'foo', 'foo-id')
1017- self.invAddEntry(basis_inv, 'bar/', 'bar-id')
1018- self.invAddEntry(basis_inv, 'bar/baz', 'baz-id')
1019+ basis_inv = inventory.Inventory(b'TREE_ROOT')
1020+ self.invAddEntry(basis_inv, 'foo', b'foo-id')
1021+ self.invAddEntry(basis_inv, 'bar/', b'bar-id')
1022+ self.invAddEntry(basis_inv, 'bar/baz', b'baz-id')
1023 return basis_inv
1024
1025 def test_id2path_no_delta(self):
1026 basis_inv = self.make_trivial_basis_inv()
1027 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1028 inv_delta=[], content_provider=None)
1029- self.assertEqual('', shim.id2path('TREE_ROOT'))
1030- self.assertEqual('foo', shim.id2path('foo-id'))
1031- self.assertEqual('bar', shim.id2path('bar-id'))
1032- self.assertEqual('bar/baz', shim.id2path('baz-id'))
1033- self.assertRaises(errors.NoSuchId, shim.id2path, 'qux-id')
1034+ self.assertEqual('', shim.id2path(b'TREE_ROOT'))
1035+ self.assertEqual('foo', shim.id2path(b'foo-id'))
1036+ self.assertEqual('bar', shim.id2path(b'bar-id'))
1037+ self.assertEqual('bar/baz', shim.id2path(b'baz-id'))
1038+ self.assertRaises(errors.NoSuchId, shim.id2path, b'qux-id')
1039
1040 def test_id2path_with_delta(self):
1041 basis_inv = self.make_trivial_basis_inv()
1042- foo_entry = inventory.make_entry('file', 'foo2', 'TREE_ROOT', 'foo-id')
1043- inv_delta = [('foo', 'foo2', 'foo-id', foo_entry),
1044- ('bar/baz', None, 'baz-id', None),
1045+ foo_entry = inventory.make_entry('file', 'foo2', b'TREE_ROOT', b'foo-id')
1046+ inv_delta = [('foo', 'foo2', b'foo-id', foo_entry),
1047+ ('bar/baz', None, b'baz-id', None),
1048 ]
1049
1050 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1051 inv_delta=inv_delta,
1052 content_provider=None)
1053- self.assertEqual('', shim.id2path('TREE_ROOT'))
1054- self.assertEqual('foo2', shim.id2path('foo-id'))
1055- self.assertEqual('bar', shim.id2path('bar-id'))
1056- self.assertRaises(errors.NoSuchId, shim.id2path, 'baz-id')
1057+ self.assertEqual('', shim.id2path(b'TREE_ROOT'))
1058+ self.assertEqual('foo2', shim.id2path(b'foo-id'))
1059+ self.assertEqual('bar', shim.id2path(b'bar-id'))
1060+ self.assertRaises(errors.NoSuchId, shim.id2path, b'baz-id')
1061
1062 def test_path2id(self):
1063 basis_inv = self.make_trivial_basis_inv()
1064 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1065 inv_delta=[], content_provider=None)
1066- self.assertEqual('TREE_ROOT', shim.path2id(''))
1067+ self.assertEqual(b'TREE_ROOT', shim.path2id(''))
1068 # We don't want to ever give a wrong value, so for now we just raise
1069 # NotImplementedError
1070 self.assertRaises(NotImplementedError, shim.path2id, 'bar')
1071@@ -93,61 +93,61 @@
1072 basis_inv = self.make_trivial_basis_inv()
1073
1074 def content_provider(file_id):
1075- return 'content of\n' + file_id + '\n'
1076+ return b'content of\n' + file_id + b'\n'
1077
1078 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1079 inv_delta=[],
1080 content_provider=content_provider)
1081- f_obj, stat_val = shim.get_file_with_stat('bar/baz', 'baz-id')
1082+ f_obj, stat_val = shim.get_file_with_stat('bar/baz', b'baz-id')
1083 self.assertIs(None, stat_val)
1084- self.assertEqualDiff('content of\nbaz-id\n', f_obj.read())
1085+ self.assertEqualDiff(b'content of\nbaz-id\n', f_obj.read())
1086
1087 # TODO: Test when the content isn't in the stream, and we fall back to the
1088 # repository that was passed in
1089
1090 def test_get_symlink_target(self):
1091 basis_inv = self.make_trivial_basis_inv()
1092- ie = inventory.make_entry('symlink', 'link', 'TREE_ROOT', 'link-id')
1093+ ie = inventory.make_entry('symlink', 'link', b'TREE_ROOT', b'link-id')
1094 ie.symlink_target = u'link-target'
1095 basis_inv.add(ie)
1096 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1097 inv_delta=[], content_provider=None)
1098 self.assertEqual(u'link-target',
1099- shim.get_symlink_target('link', 'link-id'))
1100+ shim.get_symlink_target('link', b'link-id'))
1101
1102 def test_get_symlink_target_from_delta(self):
1103 basis_inv = self.make_trivial_basis_inv()
1104- ie = inventory.make_entry('symlink', 'link', 'TREE_ROOT', 'link-id')
1105+ ie = inventory.make_entry('symlink', 'link', 'TREE_ROOT', b'link-id')
1106 ie.symlink_target = u'link-target'
1107- inv_delta = [(None, 'link', 'link-id', ie)]
1108+ inv_delta = [(None, 'link', b'link-id', ie)]
1109 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1110 inv_delta=inv_delta,
1111 content_provider=None)
1112 self.assertEqual(u'link-target',
1113- shim.get_symlink_target('link', 'link-id'))
1114+ shim.get_symlink_target('link', b'link-id'))
1115
1116 def test__delta_to_iter_changes(self):
1117 basis_inv = self.make_trivial_basis_inv()
1118- foo_entry = inventory.make_entry('file', 'foo2', 'bar-id', 'foo-id')
1119- link_entry = inventory.make_entry('symlink', 'link', 'TREE_ROOT',
1120- 'link-id')
1121+ foo_entry = inventory.make_entry('file', 'foo2', b'bar-id', b'foo-id')
1122+ link_entry = inventory.make_entry('symlink', 'link', b'TREE_ROOT',
1123+ b'link-id')
1124 link_entry.symlink_target = u'link-target'
1125- inv_delta = [('foo', 'bar/foo2', 'foo-id', foo_entry),
1126- ('bar/baz', None, 'baz-id', None),
1127- (None, 'link', 'link-id', link_entry),
1128+ inv_delta = [('foo', 'bar/foo2', b'foo-id', foo_entry),
1129+ ('bar/baz', None, b'baz-id', None),
1130+ (None, 'link', b'link-id', link_entry),
1131 ]
1132 shim = revision_store._TreeShim(repo=None, basis_inv=basis_inv,
1133 inv_delta=inv_delta,
1134 content_provider=None)
1135 changes = list(shim._delta_to_iter_changes())
1136- expected = [('foo-id', ('foo', 'bar/foo2'), False, (True, True),
1137- ('TREE_ROOT', 'bar-id'), ('foo', 'foo2'),
1138+ expected = [(b'foo-id', ('foo', 'bar/foo2'), False, (True, True),
1139+ (b'TREE_ROOT', b'bar-id'), ('foo', 'foo2'),
1140 ('file', 'file'), (False, False)),
1141- ('baz-id', ('bar/baz', None), True, (True, False),
1142- ('bar-id', None), ('baz', None),
1143+ (b'baz-id', ('bar/baz', None), True, (True, False),
1144+ (b'bar-id', None), ('baz', None),
1145 ('file', None), (False, None)),
1146- ('link-id', (None, 'link'), True, (False, True),
1147- (None, 'TREE_ROOT'), (None, 'link'),
1148+ (b'link-id', (None, 'link'), True, (False, True),
1149+ (None, b'TREE_ROOT'), (None, 'link'),
1150 (None, 'symlink'), (None, False)),
1151 ]
1152 # from pprint import pformat
1153
1154=== modified file 'breezy/plugins/grep/test_grep.py'
1155--- breezy/plugins/grep/test_grep.py 2017-10-27 00:18:42 +0000
1156+++ breezy/plugins/grep/test_grep.py 2018-03-25 11:39:57 +0000
1157@@ -2155,8 +2155,8 @@
1158 def make_example_branch(self):
1159 tree = self.make_branch_and_tree('.')
1160 self.build_tree_contents([
1161- ('hello', 'foo\n'),
1162- ('goodbye', 'baz\n')])
1163+ ('hello', b'foo\n'),
1164+ ('goodbye', b'baz\n')])
1165 tree.add(['hello'])
1166 tree.commit('setup')
1167 tree.add(['goodbye'])
1168@@ -2166,7 +2166,7 @@
1169 def test_grep_diff_basic(self):
1170 """grep -p basic test."""
1171 tree = self.make_example_branch()
1172- self.build_tree_contents([('hello', 'hello world!\n')])
1173+ self.build_tree_contents([('hello', b'hello world!\n')])
1174 tree.commit('updated hello')
1175 out, err = self.run_bzr(['grep', '-p', 'hello'])
1176 self.assertEqual(err, '')
1177@@ -2185,7 +2185,7 @@
1178 def test_grep_diff_revision(self):
1179 """grep -p specific revision."""
1180 tree = self.make_example_branch()
1181- self.build_tree_contents([('hello', 'hello world!\n')])
1182+ self.build_tree_contents([('hello', b'hello world!\n')])
1183 tree.commit('updated hello')
1184 out, err = self.run_bzr(['grep', '-p', '-r', '3', 'hello'])
1185 self.assertEqual(err, '')
1186@@ -2200,9 +2200,9 @@
1187 def test_grep_diff_revision_range(self):
1188 """grep -p revision range."""
1189 tree = self.make_example_branch()
1190- self.build_tree_contents([('hello', 'hello world!1\n')]) # rev 3
1191+ self.build_tree_contents([('hello', b'hello world!1\n')]) # rev 3
1192 tree.commit('rev3')
1193- self.build_tree_contents([('blah', 'hello world!2\n')]) # rev 4
1194+ self.build_tree_contents([('blah', b'hello world!2\n')]) # rev 4
1195 tree.add('blah')
1196 tree.commit('rev4')
1197 open('hello', 'a').write('hello world!3\n')
1198@@ -2229,7 +2229,7 @@
1199 def test_grep_diff_color(self):
1200 """grep -p color test."""
1201 tree = self.make_example_branch()
1202- self.build_tree_contents([('hello', 'hello world!\n')])
1203+ self.build_tree_contents([('hello', b'hello world!\n')])
1204 tree.commit('updated hello')
1205 out, err = self.run_bzr(['grep', '--diff', '-r', '3',
1206 '--color', 'always', 'hello'])
1207
1208=== modified file 'breezy/plugins/launchpad/test_lp_api_lite.py'
1209--- breezy/plugins/launchpad/test_lp_api_lite.py 2017-11-16 00:39:04 +0000
1210+++ breezy/plugins/launchpad/test_lp_api_lite.py 2018-03-25 11:39:57 +0000
1211@@ -354,9 +354,9 @@
1212 builder = self.make_branch_builder('tip')
1213 builder.build_snapshot([], [
1214 ('add', ('', 'root-id', 'directory', None))],
1215- revision_id='A')
1216+ revision_id=b'A')
1217 b = builder.get_branch()
1218- b.tags.set_tag('tip-1.0', 'A')
1219+ b.tags.set_tag('tip-1.0', b'A')
1220 return builder, b, b.tags.get_tag_dict()
1221
1222 def test_get_most_recent_tag_tip(self):
1223@@ -366,7 +366,7 @@
1224
1225 def test_get_most_recent_tag_older(self):
1226 builder, b, tag_dict = self.make_simple_builder()
1227- builder.build_snapshot(['A'], [], revision_id='B')
1228+ builder.build_snapshot(['A'], [], revision_id=b'B')
1229 self.assertEqual('B', b.last_revision())
1230 self.assertEqual('tip-1.0',
1231 lp_api_lite.get_most_recent_tag(tag_dict, b))
1232@@ -392,8 +392,8 @@
1233 super(TestReportFreshness, self).setUp()
1234 builder = self.make_branch_builder('tip')
1235 builder.build_snapshot([], [
1236- ('add', ('', 'root-id', 'directory', None))],
1237- revision_id='A')
1238+ ('add', ('', b'root-id', 'directory', None))],
1239+ revision_id=b'A')
1240 self.branch = builder.get_branch()
1241
1242 def assertFreshnessReports(self, verbosity, latest_version, content):
1243@@ -454,8 +454,8 @@
1244 super(Test_GetNewestVersions, self).setUp()
1245 builder = self.make_branch_builder('tip')
1246 builder.build_snapshot([], [
1247- ('add', ('', 'root-id', 'directory', None))],
1248- revision_id='A')
1249+ ('add', ('', b'root-id', 'directory', None))],
1250+ revision_id=b'A')
1251 self.branch = builder.get_branch()
1252
1253 def assertLatestVersions(self, latest_branch_version, pub_version):
1254
1255=== modified file 'breezy/plugins/po_merge/tests/test_po_merge.py'
1256--- breezy/plugins/po_merge/tests/test_po_merge.py 2017-11-16 00:39:04 +0000
1257+++ breezy/plugins/po_merge/tests/test_po_merge.py 2018-03-25 11:39:57 +0000
1258@@ -93,26 +93,26 @@
1259 builder = test.make_branch_builder(relpath)
1260 builder.start_series()
1261 builder.build_snapshot(None,
1262- [('add', ('', 'root-id', 'directory', '')),
1263+ [('add', ('', b'root-id', 'directory', '')),
1264 # Create empty files
1265- ('add', ('po', 'dir-id', 'directory', None),),
1266- ('add', ('po/adduser.pot', 'pot-id', 'file',
1267+ ('add', ('po', b'dir-id', 'directory', None),),
1268+ ('add', ('po/adduser.pot', b'pot-id', 'file',
1269 _Adduser['base_pot'])),
1270- ('add', ('po/fr.po', 'po-id', 'file',
1271+ ('add', ('po/fr.po', b'po-id', 'file',
1272 _Adduser['base_po'])),
1273- ], revision_id='base')
1274+ ], revision_id=b'base')
1275 # The 'other' branch
1276 builder.build_snapshot(['base'],
1277- [('modify', ('pot-id',
1278+ [('modify', (b'pot-id',
1279 _Adduser['other_pot'])),
1280- ('modify', ('po-id',
1281+ ('modify', (b'po-id',
1282 _Adduser['other_po'])),
1283- ], revision_id='other')
1284+ ], revision_id=b'other')
1285 # The 'this' branch
1286 builder.build_snapshot(['base'],
1287- [('modify', ('pot-id', _Adduser['this_pot'])),
1288- ('modify', ('po-id', _Adduser['this_po'])),
1289- ], revision_id='this')
1290+ [('modify', (b'pot-id', _Adduser['this_pot'])),
1291+ ('modify', (b'po-id', _Adduser['this_po'])),
1292+ ], revision_id=b'this')
1293 # builder.get_branch() tip is now 'this'
1294 builder.finish_series()
1295 return builder
1296
1297=== modified file 'breezy/plugins/stats/test_stats.py'
1298--- breezy/plugins/stats/test_stats.py 2018-03-24 00:31:49 +0000
1299+++ breezy/plugins/stats/test_stats.py 2018-03-25 11:39:57 +0000
1300@@ -9,12 +9,12 @@
1301
1302 def test_simple(self):
1303 wt = self.make_branch_and_tree('.')
1304- wt.commit(message='1', committer='Fero <fero@example.com>', rev_id='1')
1305- wt.commit(message='2', committer='Fero <fero@example.com>', rev_id='2')
1306- wt.commit(message='3', committer='Jano <jano@example.com>', rev_id='3')
1307+ wt.commit(message='1', committer='Fero <fero@example.com>', rev_id=b'1')
1308+ wt.commit(message='2', committer='Fero <fero@example.com>', rev_id=b'2')
1309+ wt.commit(message='3', committer='Jano <jano@example.com>', rev_id=b'3')
1310 wt.commit(message='4', committer='Jano <jano@example.com>',
1311- authors=['Vinco <vinco@example.com>'], rev_id='4')
1312- wt.commit(message='5', committer='Ferko <fero@example.com>', rev_id='5')
1313+ authors=['Vinco <vinco@example.com>'], rev_id=b'4')
1314+ wt.commit(message='5', committer='Ferko <fero@example.com>', rev_id=b'5')
1315 revs, committers = get_revisions_and_committers(wt.branch.repository,
1316 ['1', '2', '3', '4', '5'])
1317 fero = ('Fero', 'fero@example.com')
1318@@ -26,9 +26,9 @@
1319
1320 def test_empty_email(self):
1321 wt = self.make_branch_and_tree('.')
1322- wt.commit(message='1', committer='Fero', rev_id='1')
1323- wt.commit(message='2', committer='Fero', rev_id='2')
1324- wt.commit(message='3', committer='Jano', rev_id='3')
1325+ wt.commit(message='1', committer='Fero', rev_id=b'1')
1326+ wt.commit(message='2', committer='Fero', rev_id=b'2')
1327+ wt.commit(message='3', committer='Jano', rev_id=b'3')
1328 revs, committers = get_revisions_and_committers(wt.branch.repository,
1329 ['1', '2', '3'])
1330 self.assertEqual({('Fero', ''): ('Fero', ''),
1331@@ -37,9 +37,9 @@
1332
1333 def test_different_case(self):
1334 wt = self.make_branch_and_tree('.')
1335- wt.commit(message='1', committer='Fero', rev_id='1')
1336- wt.commit(message='2', committer='Fero', rev_id='2')
1337- wt.commit(message='3', committer='FERO', rev_id='3')
1338+ wt.commit(message='1', committer='Fero', rev_id=b'1')
1339+ wt.commit(message='2', committer='Fero', rev_id=b'2')
1340+ wt.commit(message='3', committer='FERO', rev_id=b'3')
1341 revs, committers = get_revisions_and_committers(wt.branch.repository,
1342 ['1', '2', '3'])
1343 self.assertEqual({('Fero', ''): ('Fero', ''),
1344
1345=== modified file 'breezy/plugins/upload/tests/test_upload.py'
1346--- breezy/plugins/upload/tests/test_upload.py 2017-11-12 19:40:53 +0000
1347+++ breezy/plugins/upload/tests/test_upload.py 2018-03-25 11:39:57 +0000
1348@@ -825,11 +825,11 @@
1349
1350 def make_diverged_tree_and_upload_location(self):
1351 tree_a = self.make_branch_and_tree('tree_a')
1352- tree_a.commit('message 1', rev_id='rev1')
1353- tree_a.commit('message 2', rev_id='rev2a')
1354+ tree_a.commit('message 1', rev_id=b'rev1')
1355+ tree_a.commit('message 2', rev_id=b'rev2a')
1356 tree_b = tree_a.controldir.sprout('tree_b').open_workingtree()
1357 uncommit.uncommit(tree_b.branch, tree=tree_b)
1358- tree_b.commit('message 2', rev_id='rev2b')
1359+ tree_b.commit('message 2', rev_id=b'rev2b')
1360 # upload tree a
1361 self.do_full_upload(directory=tree_a.basedir)
1362 return tree_b
1363@@ -843,12 +843,12 @@
1364 self.assertRaises(cmds.DivergedUploadedTree,
1365 self.do_incremental_upload,
1366 directory=self.diverged_tree.basedir)
1367- self.assertRevidUploaded('rev2a')
1368+ self.assertRevidUploaded(b'rev2a')
1369
1370 def test_upload_diverged_with_overwrite(self):
1371 self.do_incremental_upload(directory=self.diverged_tree.basedir,
1372 overwrite=True)
1373- self.assertRevidUploaded('rev2b')
1374+ self.assertRevidUploaded(b'rev2b')
1375
1376
1377 class TestUploadBadRemoteReivd(tests.TestCaseWithTransport, UploadUtilsMixin):
1378
1379=== modified file 'breezy/plugins/weave_fmt/repository.py'
1380--- breezy/plugins/weave_fmt/repository.py 2018-03-24 17:48:04 +0000
1381+++ breezy/plugins/weave_fmt/repository.py 2018-03-25 11:39:57 +0000
1382@@ -796,7 +796,7 @@
1383 # weave specific optimised path:
1384 try:
1385 self.target.set_make_working_trees(self.source.make_working_trees())
1386- except (errors.RepositoryUpgradeRequired, NotImplemented):
1387+ except (errors.RepositoryUpgradeRequired, NotImplementedError):
1388 pass
1389 # FIXME do not peek!
1390 if self.source._transport.listable():
1391
1392=== modified file 'breezy/plugins/weave_fmt/test_bzrdir.py'
1393--- breezy/plugins/weave_fmt/test_bzrdir.py 2017-11-12 17:53:47 +0000
1394+++ breezy/plugins/weave_fmt/test_bzrdir.py 2018-03-25 11:39:57 +0000
1395@@ -130,162 +130,162 @@
1396
1397 _upgrade1_template = \
1398 [
1399- ('foo', 'new contents\n'),
1400+ ('foo', b'new contents\n'),
1401 ('.bzr/',),
1402 ('.bzr/README',
1403- 'This is a Bazaar control directory.\n'
1404- 'Do not change any files in this directory.\n'
1405- 'See http://bazaar.canonical.com/ for more information about Bazaar.\n'),
1406- ('.bzr/branch-format', 'Bazaar-NG branch, format 0.0.4\n'),
1407+ b'This is a Bazaar control directory.\n'
1408+ b'Do not change any files in this directory.\n'
1409+ b'See http://bazaar.canonical.com/ for more information about Bazaar.\n'),
1410+ ('.bzr/branch-format', b'Bazaar-NG branch, format 0.0.4\n'),
1411 ('.bzr/revision-history',
1412- 'mbp@sourcefrog.net-20051004035611-176b16534b086b3c\n'
1413- 'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd\n'),
1414- ('.bzr/merged-patches', ''),
1415- ('.bzr/pending-merged-patches', ''),
1416- ('.bzr/branch-name', ''),
1417- ('.bzr/branch-lock', ''),
1418- ('.bzr/pending-merges', ''),
1419+ b'mbp@sourcefrog.net-20051004035611-176b16534b086b3c\n'
1420+ b'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd\n'),
1421+ ('.bzr/merged-patches', b''),
1422+ ('.bzr/pending-merged-patches', b''),
1423+ ('.bzr/branch-name', b''),
1424+ ('.bzr/branch-lock', b''),
1425+ ('.bzr/pending-merges', b''),
1426 ('.bzr/inventory',
1427- '<inventory>\n'
1428- '<entry file_id="foo-20051004035605-91e788d1875603ae" kind="file" name="foo" />\n'
1429- '</inventory>\n'),
1430+ b'<inventory>\n'
1431+ b'<entry file_id="foo-20051004035605-91e788d1875603ae" kind="file" name="foo" />\n'
1432+ b'</inventory>\n'),
1433 ('.bzr/stat-cache',
1434- '### bzr hashcache v5\n'
1435- 'foo// be9f309239729f69a6309e970ef24941d31e042c 13 1128398176 1128398176 303464 770\n'),
1436+ b'### bzr hashcache v5\n'
1437+ b'foo// be9f309239729f69a6309e970ef24941d31e042c 13 1128398176 1128398176 303464 770\n'),
1438 ('.bzr/text-store/',),
1439 ('.bzr/text-store/foo-20051004035611-1591048e9dc7c2d4.gz',
1440- '\x1f\x8b\x08\x00[\xfdAC\x02\xff\xcb\xcc\xcb,\xc9L\xccQH\xce\xcf+I\xcd+)\xe6\x02\x00\xdd\xcc\xf90\x11\x00\x00\x00'),
1441+ b'\x1f\x8b\x08\x00[\xfdAC\x02\xff\xcb\xcc\xcb,\xc9L\xccQH\xce\xcf+I\xcd+)\xe6\x02\x00\xdd\xcc\xf90\x11\x00\x00\x00'),
1442 ('.bzr/text-store/foo-20051004035756-4081373d897c3453.gz',
1443- '\x1f\x8b\x08\x00\xc4\xfdAC\x02\xff\xcbK-WH\xce\xcf+I\xcd+)\xe6\x02\x00g\xc3\xdf\xc9\r\x00\x00\x00'),
1444+ b'\x1f\x8b\x08\x00\xc4\xfdAC\x02\xff\xcbK-WH\xce\xcf+I\xcd+)\xe6\x02\x00g\xc3\xdf\xc9\r\x00\x00\x00'),
1445 ('.bzr/inventory-store/',),
1446 ('.bzr/inventory-store/mbp@sourcefrog.net-20051004035611-176b16534b086b3c.gz',
1447- '\x1f\x8b\x08\x00[\xfdAC\x02\xffm\x8f\xcd\n\xc20\x10\x84\xef>E\xc8\xbdt7?M\x02\xad\xaf"\xa1\x99`P[\xa8E\xacOo\x14\x05\x0f\xdef\xe1\xfbv\x98\xbeL7L\xeb\xbcl\xfb]_\xc3\xb2\x89\\\xce8\x944\xc8<\xcf\x8d"\xb2LdH\xdb\x8el\x13\x18\xce\xfb\xc4\xde\xd5SGHq*\xd3\x0b\xad\x8e\x14S\xbc\xe0\xadI\xb1\xe2\xbe\xfe}\xc2\xdc\xb0\rL\xc6#\xa4\xd1\x8d*\x99\x0f}=F\x1e$8G\x9d\xa0\x02\xa1rP9\x01c`FV\xda1qg\x98"\x02}\xa5\xf2\xa8\x95\xec\xa4h\xeb\x80\xf6g\xcd\x13\xb3\x01\xcc\x98\xda\x00\x00\x00'),
1448+ b'\x1f\x8b\x08\x00[\xfdAC\x02\xffm\x8f\xcd\n\xc20\x10\x84\xef>E\xc8\xbdt7?M\x02\xad\xaf"\xa1\x99`P[\xa8E\xacOo\x14\x05\x0f\xdef\xe1\xfbv\x98\xbeL7L\xeb\xbcl\xfb]_\xc3\xb2\x89\\\xce8\x944\xc8<\xcf\x8d"\xb2LdH\xdb\x8el\x13\x18\xce\xfb\xc4\xde\xd5SGHq*\xd3\x0b\xad\x8e\x14S\xbc\xe0\xadI\xb1\xe2\xbe\xfe}\xc2\xdc\xb0\rL\xc6#\xa4\xd1\x8d*\x99\x0f}=F\x1e$8G\x9d\xa0\x02\xa1rP9\x01c`FV\xda1qg\x98"\x02}\xa5\xf2\xa8\x95\xec\xa4h\xeb\x80\xf6g\xcd\x13\xb3\x01\xcc\x98\xda\x00\x00\x00'),
1449 ('.bzr/inventory-store/mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd.gz',
1450- '\x1f\x8b\x08\x00\xc4\xfdAC\x02\xffm\x8f\xc1\n\xc20\x10D\xef~E\xc8\xbd\xb8\x9bM\x9a,\xb4\xfe\x8a\xc4f\x83Am\xa1\x16\xb1~\xbdQ\x14<x\x9b\x81y3LW\xc6\x9b\x8c\xcb4\xaf\xbbMW\xc5\xbc\xaa\\\xce\xb2/\xa9\xd7y\x9a\x1a\x03\xe0\x10\xc0\x02\xb9\x16\\\xc3(>\x84\x84\xc1WKQ\xb4:\x95\xf1\x15\xad\x8cVc\xbc\xc8\x1b\xd3j\x91\xfb\xf2\xaf\xa4r\x8d\x85\x80\xe4)\x05\xf6\x03YG\x9f\xf4\xf5\x18\xb1\xd7\x07\xe1L\xc0\x86\xd8\x1b\xce-\xc7\xb6:a\x0f\x92\x8de\x8b\x89P\xc0\x9a\xe1\x0b\x95G\x9d\xc4\xda\xb1\xad\x07\xb6?o\x9e\xb5\xff\xf0\xf9\xda\x00\x00\x00'),
1451+ b'\x1f\x8b\x08\x00\xc4\xfdAC\x02\xffm\x8f\xc1\n\xc20\x10D\xef~E\xc8\xbd\xb8\x9bM\x9a,\xb4\xfe\x8a\xc4f\x83Am\xa1\x16\xb1~\xbdQ\x14<x\x9b\x81y3LW\xc6\x9b\x8c\xcb4\xaf\xbbMW\xc5\xbc\xaa\\\xce\xb2/\xa9\xd7y\x9a\x1a\x03\xe0\x10\xc0\x02\xb9\x16\\\xc3(>\x84\x84\xc1WKQ\xb4:\x95\xf1\x15\xad\x8cVc\xbc\xc8\x1b\xd3j\x91\xfb\xf2\xaf\xa4r\x8d\x85\x80\xe4)\x05\xf6\x03YG\x9f\xf4\xf5\x18\xb1\xd7\x07\xe1L\xc0\x86\xd8\x1b\xce-\xc7\xb6:a\x0f\x92\x8de\x8b\x89P\xc0\x9a\xe1\x0b\x95G\x9d\xc4\xda\xb1\xad\x07\xb6?o\x9e\xb5\xff\xf0\xf9\xda\x00\x00\x00'),
1452 ('.bzr/revision-store/',),
1453 ('.bzr/revision-store/mbp@sourcefrog.net-20051004035611-176b16534b086b3c.gz',
1454- '\x1f\x8b\x08\x00[\xfdAC\x02\xff\x9d\x8eKj\xc30\x14E\xe7^\x85\xd0 \xb3$\xefI\xd1\x8f\xd8\xa6\x1b(t\x07E?\xbb\x82H\n\xb2\x1ahW\xdfB1\x14:\xeb\xf4r\xee\xbdgl\xf1\x91\xb6T\x0b\xf15\xe7\xd4{l\x13}\xb6\xad\xa7B^j\xbd\x91\xc3\xad_\xb3\xbb?m\xf5\xbd\xf9\xb8\xb4\xba\x9eJ\xec\x87\xb5_)I\xe5\x11K\xaf\xed\xe35\x85\x89\xfe\xa5\x8e\x0c@ \xc0\x05\xb8\x90\x88GT\xd2\xa1\x14\xfc\xe2@K\xc7\xfd\xef\x85\xed\xcd\xe2D\x95\x8d\x1a\xa47<\x02c2\xb0 \xbc\xd0\x8ay\xa3\xbcp\x8a\x83\x12A3\xb7XJv\xef\x7f_\xf7\x94\xe3\xd6m\xbeO\x14\x91in4*<\x812\x88\xc60\xfc\x01>k\x89\x13\xe5\x12\x00\xe8<\x8c\xdf\x8d\xcd\xaeq\xb6!\x90\xa5\xd6\xf1\xbc\x07\xc3x\xde\x85\xe6\xe1\x0b\xc8\x8a\x98\x03T\x01\x00\x00'),
1455+ b'\x1f\x8b\x08\x00[\xfdAC\x02\xff\x9d\x8eKj\xc30\x14E\xe7^\x85\xd0 \xb3$\xefI\xd1\x8f\xd8\xa6\x1b(t\x07E?\xbb\x82H\n\xb2\x1ahW\xdfB1\x14:\xeb\xf4r\xee\xbdgl\xf1\x91\xb6T\x0b\xf15\xe7\xd4{l\x13}\xb6\xad\xa7B^j\xbd\x91\xc3\xad_\xb3\xbb?m\xf5\xbd\xf9\xb8\xb4\xba\x9eJ\xec\x87\xb5_)I\xe5\x11K\xaf\xed\xe35\x85\x89\xfe\xa5\x8e\x0c@ \xc0\x05\xb8\x90\x88GT\xd2\xa1\x14\xfc\xe2@K\xc7\xfd\xef\x85\xed\xcd\xe2D\x95\x8d\x1a\xa47<\x02c2\xb0 \xbc\xd0\x8ay\xa3\xbcp\x8a\x83\x12A3\xb7XJv\xef\x7f_\xf7\x94\xe3\xd6m\xbeO\x14\x91in4*<\x812\x88\xc60\xfc\x01>k\x89\x13\xe5\x12\x00\xe8<\x8c\xdf\x8d\xcd\xaeq\xb6!\x90\xa5\xd6\xf1\xbc\x07\xc3x\xde\x85\xe6\xe1\x0b\xc8\x8a\x98\x03T\x01\x00\x00'),
1456 ('.bzr/revision-store/mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd.gz',
1457- '\x1f\x8b\x08\x00\xc4\xfdAC\x02\xff\x9d\x90Kj\x031\x0c\x86\xf79\xc5\xe0Ev\xe9\xc8o\x9b\xcc\x84^\xa0\xd0\x1b\x14\xbf&5d\xec`\xbb\x81\xf6\xf45\x84\xa4\x81\xaeZ\xa1\x85\x84^\xdf\xaf\xa9\x84K\xac1\xa7\xc1\xe5u\x8d\xad\x852\xa3\x17SZL\xc3k\xce\xa7a{j\xfb\xd5\x9e\x9fk\xfe(.,%\x1f\x9fRh\xdbc\xdb\xa3!\xa6KH-\x97\xcf\xb7\xe8g\xf4\xbbkG\x008\x06`@\xb9\xe4bG(_\x88\x95\xde\xf9n\xca\xfb\xc7\r\xf5\xdd\xe0\x19\xa9\x85)\x81\xf5"\xbd\x04j\xb8\x02b\xa8W\\\x0b\xc9\x14\xf4\xbc\xbb\xd7\xd6H4\xdc\xb8\xff}\xba\xc55\xd4f\xd6\xf3\x8c0&\x8ajE\xa4x\xe2@\xa5\xa6\x9a\xf3k\xc3WNaFT\x00\x00:l\xa6>Q\xcd1\x1cjp9\xf9;\xc34\xde\n\x9b\xe9lJWT{t\',a\xf9\x0b\xae\xc0x\x87\xa5\xb0Xp\xca,(a\xa9{\xd0{}\xd4\x12\x04(\xc5\xbb$\xc5$V\xceaI\x19\x01\xa2\x1dh\xed\x82d\x8c.\xccr@\xc3\xd8Q\xc6\x1f\xaa\xf1\xb6\xe8\xb0\xf9\x06QR\r\xf9\xfc\x01\x00\x00')]
1458+ b'\x1f\x8b\x08\x00\xc4\xfdAC\x02\xff\x9d\x90Kj\x031\x0c\x86\xf79\xc5\xe0Ev\xe9\xc8o\x9b\xcc\x84^\xa0\xd0\x1b\x14\xbf&5d\xec`\xbb\x81\xf6\xf45\x84\xa4\x81\xaeZ\xa1\x85\x84^\xdf\xaf\xa9\x84K\xac1\xa7\xc1\xe5u\x8d\xad\x852\xa3\x17SZL\xc3k\xce\xa7a{j\xfb\xd5\x9e\x9fk\xfe(.,%\x1f\x9fRh\xdbc\xdb\xa3!\xa6KH-\x97\xcf\xb7\xe8g\xf4\xbbkG\x008\x06`@\xb9\xe4bG(_\x88\x95\xde\xf9n\xca\xfb\xc7\r\xf5\xdd\xe0\x19\xa9\x85)\x81\xf5"\xbd\x04j\xb8\x02b\xa8W\\\x0b\xc9\x14\xf4\xbc\xbb\xd7\xd6H4\xdc\xb8\xff}\xba\xc55\xd4f\xd6\xf3\x8c0&\x8ajE\xa4x\xe2@\xa5\xa6\x9a\xf3k\xc3WNaFT\x00\x00:l\xa6>Q\xcd1\x1cjp9\xf9;\xc34\xde\n\x9b\xe9lJWT{t\',a\xf9\x0b\xae\xc0x\x87\xa5\xb0Xp\xca,(a\xa9{\xd0{}\xd4\x12\x04(\xc5\xbb$\xc5$V\xceaI\x19\x01\xa2\x1dh\xed\x82d\x8c.\xccr@\xc3\xd8Q\xc6\x1f\xaa\xf1\xb6\xe8\xb0\xf9\x06QR\r\xf9\xfc\x01\x00\x00')]
1459
1460
1461 _ghost_template = [
1462 ( './foo',
1463- 'hello\n'
1464+ b'hello\n'
1465 ),
1466 ( './.bzr/', ),
1467 ( './.bzr/README',
1468- 'This is a Bazaar control directory.\n'
1469- 'Do not change any files in this directory.\n'
1470- 'See http://bazaar.canonical.com/ for more information about Bazaar.\n'
1471+ b'This is a Bazaar control directory.\n'
1472+ b'Do not change any files in this directory.\n'
1473+ b'See http://bazaar.canonical.com/ for more information about Bazaar.\n'
1474 ),
1475 ( './.bzr/branch-format',
1476- 'Bazaar-NG branch, format 0.0.4\n'
1477+ b'Bazaar-NG branch, format 0.0.4\n'
1478 ),
1479 ( './.bzr/branch-lock',
1480- ''
1481+ b''
1482 ),
1483 ( './.bzr/branch-name',
1484- ''
1485+ b''
1486 ),
1487 ( './.bzr/inventory',
1488- '<inventory>\n'
1489- '<entry file_id="foo-20051004104918-0379cb7c76354cde" kind="file" name="foo" />\n'
1490- '</inventory>\n'
1491+ b'<inventory>\n'
1492+ b'<entry file_id="foo-20051004104918-0379cb7c76354cde" kind="file" name="foo" />\n'
1493+ b'</inventory>\n'
1494 ),
1495 ( './.bzr/merged-patches',
1496- ''
1497+ b''
1498 ),
1499 ( './.bzr/pending-merged-patches',
1500- ''
1501+ b''
1502 ),
1503 ( './.bzr/pending-merges',
1504- ''
1505+ b''
1506 ),
1507 ( './.bzr/revision-history',
1508- 'mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b\n'
1509- 'mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d\n'
1510+ b'mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b\n'
1511+ b'mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d\n'
1512 ),
1513 ( './.bzr/stat-cache',
1514- '### bzr hashcache v5\n'
1515- 'foo// f572d396fae9206628714fb2ce00f72e94f2258f 6 1128422956 1128422956 306900 770\n'
1516+ b'### bzr hashcache v5\n'
1517+ b'foo// f572d396fae9206628714fb2ce00f72e94f2258f 6 1128422956 1128422956 306900 770\n'
1518 ),
1519 ( './.bzr/text-store/', ),
1520 ( './.bzr/text-store/foo-20051004104921-8de8118a71be45ba.gz',
1521- '\x1f\x8b\x08\x081^BC\x00\x03foo-20051004104921-8de8118a71be45ba\x00\xcbH\xcd\xc9\xc9\xe7\x02\x00 0:6\x06\x00\x00\x00'
1522+ b'\x1f\x8b\x08\x081^BC\x00\x03foo-20051004104921-8de8118a71be45ba\x00\xcbH\xcd\xc9\xc9\xe7\x02\x00 0:6\x06\x00\x00\x00'
1523 ),
1524 ( './.bzr/inventory-store/', ),
1525 ( './.bzr/inventory-store/mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b.gz',
1526- '\x1f\x8b\x08\x081^BC\x00\x03mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b\x00m\x8f\xcb\n'
1527- '\xc20\x10E\xf7~E\xc8\xbe83\xcd\x13\xaa\xbf"yL0\xa8-\xd4"\xd6\xaf7\x8a\x82\x0bw\xb38\xe7\xde;C\x1do<.\xd3\xbc\xee7C;\xe6U\x94z\xe6C\xcd;Y\xa6\xa9#\x00\x8d\x00\n'
1528- 'Ayt\x1d\xf4\xd6\xa7h\x935\xbdV)\xb3\x14\xa7:\xbe\xd0\xe6H1\x86\x0b\xbf5)\x16\xbe/\x7fC\x08;\x97\xd9!\xba`1\xb2\xd21|\xe8\xeb1`\xe3\xb5\xa5\xdc{S\x02{\x02c\xc8YT%Rb\x80b\x89\xbd*D\xda\x95\xafT\x1f\xad\xd2H\xb1m\xfb\xb7?\xcf<\x01W}\xb5\x8b\xd9\x00\x00\x00'
1529+ b'\x1f\x8b\x08\x081^BC\x00\x03mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b\x00m\x8f\xcb\n'
1530+ b'\xc20\x10E\xf7~E\xc8\xbe83\xcd\x13\xaa\xbf"yL0\xa8-\xd4"\xd6\xaf7\x8a\x82\x0bw\xb38\xe7\xde;C\x1do<.\xd3\xbc\xee7C;\xe6U\x94z\xe6C\xcd;Y\xa6\xa9#\x00\x8d\x00\n'
1531+ b'Ayt\x1d\xf4\xd6\xa7h\x935\xbdV)\xb3\x14\xa7:\xbe\xd0\xe6H1\x86\x0b\xbf5)\x16\xbe/\x7fC\x08;\x97\xd9!\xba`1\xb2\xd21|\xe8\xeb1`\xe3\xb5\xa5\xdc{S\x02{\x02c\xc8YT%Rb\x80b\x89\xbd*D\xda\x95\xafT\x1f\xad\xd2H\xb1m\xfb\xb7?\xcf<\x01W}\xb5\x8b\xd9\x00\x00\x00'
1532 ),
1533 ( './.bzr/inventory-store/mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d.gz',
1534- '\x1f\x8b\x08\x08A^BC\x00\x03mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d\x00m\x8f\xcb\n'
1535- '\xc20\x10E\xf7~E\xc8\xbe83\xcd\x13\xaa\xbf"yL0\xa8-\xd4"\xd6\xaf7\x8a\x82\x0bw\xb38\xe7\xde;C\x1do<.\xd3\xbc\xee7C;\xe6U\x94z\xe6C\xcd;Y\xa6\xa9#\x00\x8d\x00\n'
1536- 'Ayt\x1d\xf4\xd6\xa7h\x935\xbdV)\xb3\x14\xa7:\xbe\xd0\xe6H1\x86\x0b\xbf5)\x16\xbe/\x7fC\x08;\x97\xd9!\xba`1\xb2\xd21|\xe8\xeb1`\xe3\xb5\xa5\xdc{S\x02{\x02c\xc8YT%Rb\x80b\x89\xbd*D\xda\x95\xafT\x1f\xad\xd2H\xb1m\xfb\xb7?\xcf<\x01W}\xb5\x8b\xd9\x00\x00\x00'
1537+ b'\x1f\x8b\x08\x08A^BC\x00\x03mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d\x00m\x8f\xcb\n'
1538+ b'\xc20\x10E\xf7~E\xc8\xbe83\xcd\x13\xaa\xbf"yL0\xa8-\xd4"\xd6\xaf7\x8a\x82\x0bw\xb38\xe7\xde;C\x1do<.\xd3\xbc\xee7C;\xe6U\x94z\xe6C\xcd;Y\xa6\xa9#\x00\x8d\x00\n'
1539+ b'Ayt\x1d\xf4\xd6\xa7h\x935\xbdV)\xb3\x14\xa7:\xbe\xd0\xe6H1\x86\x0b\xbf5)\x16\xbe/\x7fC\x08;\x97\xd9!\xba`1\xb2\xd21|\xe8\xeb1`\xe3\xb5\xa5\xdc{S\x02{\x02c\xc8YT%Rb\x80b\x89\xbd*D\xda\x95\xafT\x1f\xad\xd2H\xb1m\xfb\xb7?\xcf<\x01W}\xb5\x8b\xd9\x00\x00\x00'
1540 ),
1541 ( './.bzr/revision-store/', ),
1542 ( './.bzr/revision-store/mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b.gz',
1543- '\x1f\x8b\x08\x081^BC\x00\x03mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b\x00\x9d\x8eMj\xc30\x14\x84\xf7>\x85\xd0"\xbb$\xef\xc9\xb6,\x11\xdb\xf4\x02\x85\xde\xa0\xe8\xe7\xd9\x11\xc4R\x90\xd4@{\xfa\x06\x8a\xa1\xd0]\x97\x03\xdf\xcc|c\xa6G(!E\xe6\xd2\xb6\x85Z)O\xfc\xd5\xe4\x1a"{K\xe9\xc6\x0e\xb7z\xd9\xec\xfd\xa5\xa4\x8f\xech\xc9i=E\xaa\x87\xb5^8\x0b\xf1A\xb1\xa6\xfc\xf9\x1e\xfc\xc4\xffRG\x01\xd0#@\x87\xd0i\x81G\xa3\x95%!\x06\xe5}\x0bv\xb0\xbf\x17\xca\xd5\xe0\xc4-\xa0\xb1\x8b\xb6`\xc0I\xa4\xc5\xf4\x9el\xef\x95v [\x94\xcf\x8e\xd5\xcay\xe4l\xf7\xfe\xf7u\r'
1544- '\x1b\x95j\xb6\xfb\xc4\x11\x85\xea\x84\xd0\x12O\x03t\x83D\xad\xc4\x0f\xf0\x95"M\xbc\x95\x00\xc0\xe7f|6\x8aYi^B.u<\xef\xb1\x19\xcf\xbb\xce\xdc|\x038=\xc7\xe6R\x01\x00\x00'
1545+ b'\x1f\x8b\x08\x081^BC\x00\x03mbp@sourcefrog.net-20051004104921-a98be2278dd30b7b\x00\x9d\x8eMj\xc30\x14\x84\xf7>\x85\xd0"\xbb$\xef\xc9\xb6,\x11\xdb\xf4\x02\x85\xde\xa0\xe8\xe7\xd9\x11\xc4R\x90\xd4@{\xfa\x06\x8a\xa1\xd0]\x97\x03\xdf\xcc|c\xa6G(!E\xe6\xd2\xb6\x85Z)O\xfc\xd5\xe4\x1a"{K\xe9\xc6\x0e\xb7z\xd9\xec\xfd\xa5\xa4\x8f\xech\xc9i=E\xaa\x87\xb5^8\x0b\xf1A\xb1\xa6\xfc\xf9\x1e\xfc\xc4\xffRG\x01\xd0#@\x87\xd0i\x81G\xa3\x95%!\x06\xe5}\x0bv\xb0\xbf\x17\xca\xd5\xe0\xc4-\xa0\xb1\x8b\xb6`\xc0I\xa4\xc5\xf4\x9el\xef\x95v [\x94\xcf\x8e\xd5\xcay\xe4l\xf7\xfe\xf7u\r'
1546+ b'\x1b\x95j\xb6\xfb\xc4\x11\x85\xea\x84\xd0\x12O\x03t\x83D\xad\xc4\x0f\xf0\x95"M\xbc\x95\x00\xc0\xe7f|6\x8aYi^B.u<\xef\xb1\x19\xcf\xbb\xce\xdc|\x038=\xc7\xe6R\x01\x00\x00'
1547 ),
1548 ( './.bzr/revision-store/mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d.gz',
1549- '\x1f\x8b\x08\x08A^BC\x00\x03mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d\x00\x9d\x90\xc1j\xc30\x0c\x86\xef}\n'
1550- "\xe3Coie'\xb1c\x9a\x94\xbe\xc0`o0,[N\x03M\\\x1c\xafe{\xfae\x94n\x85\xc1`;Y\x88O\xd2\xff\xb9Mt\x19\xe6!N\xcc\xc5q\x1cr\xa6\xd4\xf1'\x9b\xf20\xb1\xe7\x18Ol}\xca\xbb\x11\xcf\x879\xbe&G!\xc5~3Q^\xf7y\xc7\xd90]h\xca1\xbd\xbd\x0c\xbe\xe3?\xa9B\x02\xd4\x02\xa0\x12P\x99R\x17\xce\xa0\xb6\x1a\x83s\x80(\xa5\x7f\xdc0\x1f\xad\xe88\x82\xb0\x18\x0c\x82\x05\xa7\x04\x05[{\xc2\xda7\xc6\x81*\x85B\x8dh\x1a\xe7\x05g\xf7\xdc\xff>\x9d\x87\x91\xe6l\xc7s\xc7\x85\x90M%\xa5\xd1z#\x85\xa8\x9b\x1a\xaa\xfa\x06\xbc\xc7\x89:^*\x00\xe0\xfbU\xbbL\xcc\xb6\xa7\xfdH\xa9'\x16\x03\xeb\x8fq\xce\xed\xf6\xde_\xb5g\x9b\x16\xa1y\xa9\xbe\x02&\n"
1551- '\x7fJ+EaM\x83$\xa5n\xbc/a\x91~\xd0\xbd\xfd\x135\n'
1552- '\xd0\x9a`\x0c*W\x1aR\xc1\x94du\x08(\t\xb0\x91\xdeZ\xa3\x9cU\x9cm\x7f\x8dr\x1d\x10Ot\xb8\xc6\xcf\xa7\x907|\xfb-\xb1\xbd\xd3\xfb\xd5\x07\xeeD\xee\x08*\x02\x00\x00'
1553+ b'\x1f\x8b\x08\x08A^BC\x00\x03mbp@sourcefrog.net-20051004104937-c9b7a7bfcc0bb22d\x00\x9d\x90\xc1j\xc30\x0c\x86\xef}\n'
1554+ b"\xe3Coie'\xb1c\x9a\x94\xbe\xc0`o0,[N\x03M\\\x1c\xafe{\xfae\x94n\x85\xc1`;Y\x88O\xd2\xff\xb9Mt\x19\xe6!N\xcc\xc5q\x1cr\xa6\xd4\xf1'\x9b\xf20\xb1\xe7\x18Ol}\xca\xbb\x11\xcf\x879\xbe&G!\xc5~3Q^\xf7y\xc7\xd90]h\xca1\xbd\xbd\x0c\xbe\xe3?\xa9B\x02\xd4\x02\xa0\x12P\x99R\x17\xce\xa0\xb6\x1a\x83s\x80(\xa5\x7f\xdc0\x1f\xad\xe88\x82\xb0\x18\x0c\x82\x05\xa7\x04\x05[{\xc2\xda7\xc6\x81*\x85B\x8dh\x1a\xe7\x05g\xf7\xdc\xff>\x9d\x87\x91\xe6l\xc7s\xc7\x85\x90M%\xa5\xd1z#\x85\xa8\x9b\x1a\xaa\xfa\x06\xbc\xc7\x89:^*\x00\xe0\xfbU\xbbL\xcc\xb6\xa7\xfdH\xa9'\x16\x03\xeb\x8fq\xce\xed\xf6\xde_\xb5g\x9b\x16\xa1y\xa9\xbe\x02&\n"
1555+ b'\x7fJ+EaM\x83$\xa5n\xbc/a\x91~\xd0\xbd\xfd\x135\n'
1556+ b'\xd0\x9a`\x0c*W\x1aR\xc1\x94du\x08(\t\xb0\x91\xdeZ\xa3\x9cU\x9cm\x7f\x8dr\x1d\x10Ot\xb8\xc6\xcf\xa7\x907|\xfb-\xb1\xbd\xd3\xfb\xd5\x07\xeeD\xee\x08*\x02\x00\x00'
1557 ),
1558 ]
1559
1560 _upgrade_dir_template = [
1561 ( './.bzr/', ),
1562 ( './.bzr/README',
1563- 'This is a Bazaar control directory.\n'
1564- 'Do not change any files in this directory.\n'
1565- 'See http://bazaar.canonical.com/ for more information about Bazaar.\n'
1566+ b'This is a Bazaar control directory.\n'
1567+ b'Do not change any files in this directory.\n'
1568+ b'See http://bazaar.canonical.com/ for more information about Bazaar.\n'
1569 ),
1570 ( './.bzr/branch-format',
1571- 'Bazaar-NG branch, format 0.0.4\n'
1572+ b'Bazaar-NG branch, format 0.0.4\n'
1573 ),
1574 ( './.bzr/branch-lock',
1575- ''
1576+ b''
1577 ),
1578 ( './.bzr/branch-name',
1579- ''
1580+ b''
1581 ),
1582 ( './.bzr/inventory',
1583- '<inventory>\n'
1584- '<entry file_id="dir-20051005095101-da1441ea3fa6917a" kind="directory" name="dir" />\n'
1585- '</inventory>\n'
1586+ b'<inventory>\n'
1587+ b'<entry file_id="dir-20051005095101-da1441ea3fa6917a" kind="directory" name="dir" />\n'
1588+ b'</inventory>\n'
1589 ),
1590 ( './.bzr/merged-patches',
1591- ''
1592+ b''
1593 ),
1594 ( './.bzr/pending-merged-patches',
1595- ''
1596+ b''
1597 ),
1598 ( './.bzr/pending-merges',
1599- ''
1600+ b''
1601 ),
1602 ( './.bzr/revision-history',
1603- 'robertc@robertcollins.net-20051005095108-6065fbd8e7d8617e\n'
1604+ b'robertc@robertcollins.net-20051005095108-6065fbd8e7d8617e\n'
1605 ),
1606 ( './.bzr/stat-cache',
1607- '### bzr hashcache v5\n'
1608+ b'### bzr hashcache v5\n'
1609 ),
1610 ( './.bzr/text-store/', ),
1611 ( './.bzr/inventory-store/', ),
1612 ( './.bzr/inventory-store/robertc@robertcollins.net-20051005095108-6065fbd8e7d8617e.gz',
1613- '\x1f\x8b\x08\x00\x0c\xa2CC\x02\xff\xb3\xc9\xcc+K\xcd+\xc9/\xaa\xb4\xe3\xb2\x012\x8a*\x15\xd22sR\xe33Sl\x95R2\x8bt\x8d\x0c\x0cL\r'
1614- "\x81\xd8\xc0\x12H\x19\xea\xa6$\x1a\x9a\x98\x18\xa6&\x1a\xa7%\x9aY\x1a\x9a'*)dg\xe6A\x94\xa6&\x83LQR\xc8K\xccM\x05\x0b()\xe8\x03\xcd\xd4G\xb2\x00\x00\xc2<\x94\xb1m\x00\x00\x00"
1615+ b'\x1f\x8b\x08\x00\x0c\xa2CC\x02\xff\xb3\xc9\xcc+K\xcd+\xc9/\xaa\xb4\xe3\xb2\x012\x8a*\x15\xd22sR\xe33Sl\x95R2\x8bt\x8d\x0c\x0cL\r'
1616+ b"\x81\xd8\xc0\x12H\x19\xea\xa6$\x1a\x9a\x98\x18\xa6&\x1a\xa7%\x9aY\x1a\x9a'*)dg\xe6A\x94\xa6&\x83LQR\xc8K\xccM\x05\x0b()\xe8\x03\xcd\xd4G\xb2\x00\x00\xc2<\x94\xb1m\x00\x00\x00"
1617 ),
1618 ( './.bzr/revision-store/', ),
1619 ( './.bzr/revision-store/robertc@robertcollins.net-20051005095108-6065fbd8e7d8617e.gz',
1620- '\x1f\x8b\x08\x00\x0c\xa2CC\x02\xff\xa5OKj\xc30\x14\xdc\xfb\x14B\x8b\xec\x92<I\xd6\xc7\xc42\x85\xde\xa0\x17(\xb6\xf4\x9c\n'
1621- 'l\xa9H"\x90\x9c\xbe\xa6\xa9\xa1\x9b\xae\xbax\x0c\xcc\xe71\xd3g\xbc\x85\x12R$.\xadk\xa8\x15\xb3\xa5oi\xc2\\\xc9kZ\x96\x10\x0b9,\xf5\x92\xbf)\xf7\xf2\x83O\xe5\x14\xb1\x1e\xae\xf5BI\x887\x8c5\xe5\xfb{\xf0\x96\xfei>r\x00\xc9\xb6\x83n\x03sT\xa0\xe4<y\x83\xda\x1b\xc54\xfe~T>Ff\xe9\xcc:\xdd\x8e\xa6E\xc7@\xa2\x82I\xaaNL\xbas\\313)\x00\xb9\xe6\xe0(\xd9\x87\xfc\xb7A\r'
1622- "+\x96:\xae\x9f\x962\xc6\x8d\x04i\x949\x01\x97R\xb7\x1d\x17O\xc3#E\xb4T(\x00\xa0C\xd3o\x892^q\x18\xbd'>\xe4\xfe\xbc\x13M\x7f\xde{\r"
1623- '\xcd\x17\x85\xea\xba\x03l\x01\x00\x00'
1624+ b'\x1f\x8b\x08\x00\x0c\xa2CC\x02\xff\xa5OKj\xc30\x14\xdc\xfb\x14B\x8b\xec\x92<I\xd6\xc7\xc42\x85\xde\xa0\x17(\xb6\xf4\x9c\n'
1625+ b'l\xa9H"\x90\x9c\xbe\xa6\xa9\xa1\x9b\xae\xbax\x0c\xcc\xe71\xd3g\xbc\x85\x12R$.\xadk\xa8\x15\xb3\xa5oi\xc2\\\xc9kZ\x96\x10\x0b9,\xf5\x92\xbf)\xf7\xf2\x83O\xe5\x14\xb1\x1e\xae\xf5BI\x887\x8c5\xe5\xfb{\xf0\x96\xfei>r\x00\xc9\xb6\x83n\x03sT\xa0\xe4<y\x83\xda\x1b\xc54\xfe~T>Ff\xe9\xcc:\xdd\x8e\xa6E\xc7@\xa2\x82I\xaaNL\xbas\\313)\x00\xb9\xe6\xe0(\xd9\x87\xfc\xb7A\r'
1626+ b"+\x96:\xae\x9f\x962\xc6\x8d\x04i\x949\x01\x97R\xb7\x1d\x17O\xc3#E\xb4T(\x00\xa0C\xd3o\x892^q\x18\xbd'>\xe4\xfe\xbc\x13M\x7f\xde{\r"
1627+ b'\xcd\x17\x85\xea\xba\x03l\x01\x00\x00'
1628 ),
1629 ( './dir/', ),
1630 ]
1631
1632=== modified file 'breezy/plugins/weave_fmt/test_repository.py'
1633--- breezy/plugins/weave_fmt/test_repository.py 2018-02-17 02:02:38 +0000
1634+++ breezy/plugins/weave_fmt/test_repository.py 2018-03-25 11:39:57 +0000
1635@@ -142,10 +142,10 @@
1636 # disk.
1637 control.create_branch()
1638 tree = control.create_workingtree()
1639- tree.add(['foo'], ['Foo:Bar'], ['file'])
1640- tree.put_file_bytes_non_atomic('foo', 'content\n', 'Foo:Bar')
1641+ tree.add(['foo'], [b'Foo:Bar'], ['file'])
1642+ tree.put_file_bytes_non_atomic('foo', 'content\n', b'Foo:Bar')
1643 try:
1644- tree.commit('first post', rev_id='first')
1645+ tree.commit('first post', rev_id=b'first')
1646 except IllegalPath:
1647 if sys.platform != 'win32':
1648 raise
1649
1650=== modified file 'breezy/plugins/weave_fmt/test_workingtree.py'
1651--- breezy/plugins/weave_fmt/test_workingtree.py 2017-05-22 00:56:52 +0000
1652+++ breezy/plugins/weave_fmt/test_workingtree.py 2018-03-25 11:39:57 +0000
1653@@ -45,15 +45,19 @@
1654 tree = self.create_format2_tree('.')
1655 self.assertRaises(errors.UnsupportedOperation, tree.set_conflicts,
1656 None)
1657- file('lala.BASE', 'wb').write('labase')
1658+ with open('lala.BASE', 'wb') as f:
1659+ f.write(b'labase')
1660 expected = conflicts.ContentsConflict('lala')
1661 self.assertEqual(list(tree.conflicts()), [expected])
1662- file('lala', 'wb').write('la')
1663- tree.add('lala', 'lala-id')
1664+ with open('lala', 'wb') as f:
1665+ f.write(b'la')
1666+ tree.add('lala', b'lala-id')
1667 expected = conflicts.ContentsConflict('lala', file_id='lala-id')
1668 self.assertEqual(list(tree.conflicts()), [expected])
1669- file('lala.THIS', 'wb').write('lathis')
1670- file('lala.OTHER', 'wb').write('laother')
1671+ with open('lala.THIS', 'wb') as f:
1672+ f.write(b'lathis')
1673+ with open('lala.OTHER', 'wb') as f:
1674+ f.write(b'laother')
1675 # When "text conflict"s happen, stem, THIS and OTHER are text
1676 expected = conflicts.TextConflict('lala', file_id='lala-id')
1677 self.assertEqual(list(tree.conflicts()), [expected])
1678@@ -65,12 +69,12 @@
1679 def test_detect_conflicts(self):
1680 """Conflicts are detected properly"""
1681 tree = self.create_format2_tree('.')
1682- self.build_tree_contents([('hello', 'hello world4'),
1683- ('hello.THIS', 'hello world2'),
1684- ('hello.BASE', 'hello world1'),
1685- ('hello.OTHER', 'hello world3'),
1686- ('hello.sploo.BASE', 'yellowworld'),
1687- ('hello.sploo.OTHER', 'yellowworld2'),
1688+ self.build_tree_contents([('hello', b'hello world4'),
1689+ ('hello.THIS', b'hello world2'),
1690+ ('hello.BASE', b'hello world1'),
1691+ ('hello.OTHER', b'hello world3'),
1692+ ('hello.sploo.BASE', b'yellowworld'),
1693+ ('hello.sploo.OTHER', b'yellowworld2'),
1694 ])
1695 tree.lock_read()
1696 self.assertLength(6, list(tree.list_files()))
1697@@ -82,7 +86,7 @@
1698 conflicts.restore('hello')
1699 conflicts.restore('hello.sploo')
1700 self.assertLength(0, tree.conflicts())
1701- self.assertFileEqual('hello world2', 'hello')
1702+ self.assertFileEqual('hello world2', b'hello')
1703 self.assertFalse(os.path.lexists('hello.sploo'))
1704 self.assertRaises(errors.NotConflicted, conflicts.restore, 'hello')
1705 self.assertRaises(errors.NotConflicted,
1706
1707=== modified file 'breezy/repository.py'
1708--- breezy/repository.py 2018-03-24 17:48:04 +0000
1709+++ breezy/repository.py 2018-03-25 11:39:57 +0000
1710@@ -1177,7 +1177,7 @@
1711 # weave repositories refuse to store revisionids that are non-ascii.
1712 if revision_id is not None:
1713 # weaves require ascii revision ids.
1714- if isinstance(revision_id, unicode):
1715+ if isinstance(revision_id, text_type):
1716 try:
1717 revision_id.encode('ascii')
1718 except UnicodeEncodeError:
1719
1720=== modified file 'breezy/shelf.py'
1721--- breezy/shelf.py 2017-11-13 22:24:02 +0000
1722+++ breezy/shelf.py 2018-03-25 11:39:57 +0000
1723@@ -293,9 +293,9 @@
1724
1725 @staticmethod
1726 def metadata_record(serializer, revision_id, message=None):
1727- metadata = {'revision_id': revision_id}
1728+ metadata = {b'revision_id': revision_id}
1729 if message is not None:
1730- metadata['message'] = message.encode('utf-8')
1731+ metadata[b'message'] = message.encode('utf-8')
1732 return serializer.bytes_record(
1733 bencode.bencode(metadata), (('metadata',),))
1734
1735
1736=== modified file 'breezy/tests/blackbox/test_add.py'
1737--- breezy/tests/blackbox/test_add.py 2017-06-10 00:17:06 +0000
1738+++ breezy/tests/blackbox/test_add.py 2018-03-25 11:39:57 +0000
1739@@ -48,7 +48,7 @@
1740 """add command prints the names of added files."""
1741 tree = self.make_branch_and_tree('.')
1742 self.build_tree(['top.txt', 'dir/', 'dir/sub.txt', 'CVS'])
1743- self.build_tree_contents([('.bzrignore', 'CVS\n')])
1744+ self.build_tree_contents([('.bzrignore', b'CVS\n')])
1745 out = self.run_bzr('add')[0]
1746 # the ordering is not defined at the moment
1747 results = sorted(out.rstrip('\n').split('\n'))
1748@@ -249,9 +249,9 @@
1749 """Test skipping files larger than add.maximum_file_size"""
1750 tree = self.make_branch_and_tree('.')
1751 self.build_tree(['small.txt', 'big.txt', 'big2.txt'])
1752- self.build_tree_contents([('small.txt', '0\n')])
1753- self.build_tree_contents([('big.txt', '01234567890123456789\n')])
1754- self.build_tree_contents([('big2.txt', '01234567890123456789\n')])
1755+ self.build_tree_contents([('small.txt', b'0\n')])
1756+ self.build_tree_contents([('big.txt', b'01234567890123456789\n')])
1757+ self.build_tree_contents([('big2.txt', b'01234567890123456789\n')])
1758 tree.branch.get_config_stack().set('add.maximum_file_size', 5)
1759 out = self.run_bzr('add')[0]
1760 results = sorted(out.rstrip('\n').split('\n'))
1761
1762=== modified file 'breezy/tests/blackbox/test_added.py'
1763--- breezy/tests/blackbox/test_added.py 2017-05-21 18:10:28 +0000
1764+++ breezy/tests/blackbox/test_added.py 2018-03-25 11:39:57 +0000
1765@@ -55,7 +55,7 @@
1766 check_added('')
1767
1768 # with unknown file, still nothing added
1769- self.build_tree_contents([(name, 'contents of %s\n' % (name))])
1770+ self.build_tree_contents([(name, b'contents of %s\n' % (name))])
1771 check_added('')
1772
1773 # after add, shows up in list
1774
1775=== modified file 'breezy/tests/blackbox/test_ancestry.py'
1776--- breezy/tests/blackbox/test_ancestry.py 2017-11-12 13:53:51 +0000
1777+++ breezy/tests/blackbox/test_ancestry.py 2018-03-25 11:39:57 +0000
1778@@ -22,20 +22,20 @@
1779
1780 def _build_branches(self):
1781 a_wt = self.make_branch_and_tree('A')
1782- self.build_tree_contents([('A/foo', '1111\n')])
1783+ self.build_tree_contents([('A/foo', b'1111\n')])
1784 a_wt.add('foo')
1785- a_wt.commit('added foo', rev_id='A1')
1786+ a_wt.commit('added foo', rev_id=b'A1')
1787
1788 b_wt = a_wt.controldir.sprout('B').open_workingtree()
1789- self.build_tree_contents([('B/foo', '1111\n22\n')])
1790- b_wt.commit('modified B/foo', rev_id='B1')
1791+ self.build_tree_contents([('B/foo', b'1111\n22\n')])
1792+ b_wt.commit('modified B/foo', rev_id=b'B1')
1793
1794- self.build_tree_contents([('A/foo', '000\n1111\n')])
1795- a_wt.commit('modified A/foo', rev_id='A2')
1796+ self.build_tree_contents([('A/foo', b'000\n1111\n')])
1797+ a_wt.commit('modified A/foo', rev_id=b'A2')
1798
1799 a_wt.merge_from_branch(b_wt.branch, b_wt.last_revision(),
1800 b_wt.branch.get_rev_id(1))
1801- a_wt.commit('merged B into A', rev_id='A3')
1802+ a_wt.commit('merged B into A', rev_id=b'A3')
1803 return a_wt, b_wt
1804
1805 def _check_ancestry(self, location='', result=None):
1806
1807=== modified file 'breezy/tests/blackbox/test_annotate.py'
1808--- breezy/tests/blackbox/test_annotate.py 2017-06-10 00:17:06 +0000
1809+++ breezy/tests/blackbox/test_annotate.py 2018-03-25 11:39:57 +0000
1810@@ -39,8 +39,8 @@
1811 super(TestAnnotate, self).setUp()
1812 wt = self.make_branch_and_tree('.')
1813 b = wt.branch
1814- self.build_tree_contents([('hello.txt', 'my helicopter\n'),
1815- ('nomail.txt', 'nomail\n')])
1816+ self.build_tree_contents([('hello.txt', b'my helicopter\n'),
1817+ ('nomail.txt', b'nomail\n')])
1818 wt.add(['hello.txt'])
1819 self.revision_id_1 = wt.commit('add hello',
1820 committer='test@user',
1821@@ -49,15 +49,15 @@
1822 self.revision_id_2 = wt.commit('add nomail',
1823 committer='no mail',
1824 timestamp=1165970000.00, timezone=0)
1825- self.build_tree_contents([('hello.txt', 'my helicopter\n'
1826- 'your helicopter\n')])
1827+ self.build_tree_contents([('hello.txt', b'my helicopter\n'
1828+ b'your helicopter\n')])
1829 self.revision_id_3 = wt.commit('mod hello',
1830 committer='user@test',
1831 timestamp=1166040000.00, timezone=0)
1832- self.build_tree_contents([('hello.txt', 'my helicopter\n'
1833- 'your helicopter\n'
1834- 'all of\n'
1835- 'our helicopters\n'
1836+ self.build_tree_contents([('hello.txt', b'my helicopter\n'
1837+ b'your helicopter\n'
1838+ b'all of\n'
1839+ b'our helicopters\n'
1840 )])
1841 self.revision_id_4 = wt.commit('mod hello',
1842 committer='user@test',
1843@@ -159,10 +159,10 @@
1844 """Create a tree with a locally edited file."""
1845 tree = self.make_branch_and_tree(relpath)
1846 file_relpath = joinpath(relpath, 'file')
1847- self.build_tree_contents([(file_relpath, 'foo\ngam\n')])
1848+ self.build_tree_contents([(file_relpath, b'foo\ngam\n')])
1849 tree.add('file')
1850 tree.commit('add file', committer="test@host", rev_id="rev1")
1851- self.build_tree_contents([(file_relpath, 'foo\nbar\ngam\n')])
1852+ self.build_tree_contents([(file_relpath, b'foo\nbar\ngam\n')])
1853 return tree
1854
1855 def test_annotate_cmd_revspec_branch(self):
1856@@ -214,20 +214,20 @@
1857 def _create_merged_file(self):
1858 """Create a file with a pending merge and local edit."""
1859 tree = self.make_branch_and_tree('.')
1860- self.build_tree_contents([('file', 'foo\ngam\n')])
1861+ self.build_tree_contents([('file', b'foo\ngam\n')])
1862 tree.add('file')
1863 tree.commit('add file', rev_id="rev1", committer="test@host")
1864 # right side
1865- self.build_tree_contents([('file', 'foo\nbar\ngam\n')])
1866+ self.build_tree_contents([('file', b'foo\nbar\ngam\n')])
1867 tree.commit("right", rev_id="rev1.1.1", committer="test@host")
1868 tree.pull(tree.branch, True, "rev1")
1869 # left side
1870- self.build_tree_contents([('file', 'foo\nbaz\ngam\n')])
1871+ self.build_tree_contents([('file', b'foo\nbaz\ngam\n')])
1872 tree.commit("left", rev_id="rev2", committer="test@host")
1873 # merge
1874 tree.merge_from_branch(tree.branch, "rev1.1.1")
1875 # edit the file to be 'resolved' and have a further local edit
1876- self.build_tree_contents([('file', 'local\nfoo\nbar\nbaz\ngam\n')])
1877+ self.build_tree_contents([('file', b'local\nfoo\nbar\nbaz\ngam\n')])
1878 return tree
1879
1880 def test_annotated_edited_merged_file_revnos(self):
1881@@ -256,7 +256,7 @@
1882
1883 def test_annotate_empty_file(self):
1884 tree = self.make_branch_and_tree('.')
1885- self.build_tree_contents([('empty', '')])
1886+ self.build_tree_contents([('empty', b'')])
1887 tree.add('empty')
1888 tree.commit('add empty file')
1889 out, err = self.run_bzr(['annotate', 'empty'])
1890@@ -264,7 +264,7 @@
1891
1892 def test_annotate_removed_file(self):
1893 tree = self.make_branch_and_tree('.')
1894- self.build_tree_contents([('empty', '')])
1895+ self.build_tree_contents([('empty', b'')])
1896 tree.add('empty')
1897 tree.commit('add empty file')
1898 # delete the file.
1899@@ -275,7 +275,7 @@
1900
1901 def test_annotate_empty_file_show_ids(self):
1902 tree = self.make_branch_and_tree('.')
1903- self.build_tree_contents([('empty', '')])
1904+ self.build_tree_contents([('empty', b'')])
1905 tree.add('empty')
1906 tree.commit('add empty file')
1907 out, err = self.run_bzr(['annotate', '--show-ids', 'empty'])
1908@@ -292,7 +292,7 @@
1909
1910 def test_annotate_without_workingtree(self):
1911 tree = self.make_branch_and_tree('.')
1912- self.build_tree_contents([('empty', '')])
1913+ self.build_tree_contents([('empty', b'')])
1914 tree.add('empty')
1915 tree.commit('add empty file')
1916 bzrdir = tree.branch.controldir
1917@@ -304,7 +304,7 @@
1918 def test_annotate_directory(self):
1919 """Test --directory option"""
1920 wt = self.make_branch_and_tree('a')
1921- self.build_tree_contents([('a/hello.txt', 'my helicopter\n')])
1922+ self.build_tree_contents([('a/hello.txt', b'my helicopter\n')])
1923 wt.add(['hello.txt'])
1924 wt.commit('commit', committer='test@user')
1925 out, err = self.run_bzr(['annotate', '-d', 'a', 'hello.txt'])
1926@@ -316,7 +316,7 @@
1927 def test_simple_annotate(self):
1928 self.setup_smart_server_with_call_log()
1929 wt = self.make_branch_and_tree('branch')
1930- self.build_tree_contents([('branch/hello.txt', 'my helicopter\n')])
1931+ self.build_tree_contents([('branch/hello.txt', b'my helicopter\n')])
1932 wt.add(['hello.txt'])
1933 wt.commit('commit', committer='test@user')
1934 self.reset_smart_call_log()
1935
1936=== modified file 'breezy/tests/blackbox/test_bound_branches.py'
1937--- breezy/tests/blackbox/test_bound_branches.py 2017-06-10 00:17:06 +0000
1938+++ breezy/tests/blackbox/test_bound_branches.py 2018-03-25 11:39:57 +0000
1939@@ -94,7 +94,7 @@
1940 def test_bound_commit(self):
1941 child_tree = self.create_branches()[1]
1942
1943- self.build_tree_contents([('child/a', 'new contents')])
1944+ self.build_tree_contents([('child/a', b'new contents')])
1945 child_tree.commit(message='child')
1946
1947 self.check_revno(2, 'child')
1948@@ -107,8 +107,8 @@
1949 base_tree, child_tree = self.create_branches()
1950
1951 self.build_tree_contents([
1952- ('base/a', 'new base contents\n' ),
1953- ('child/b', 'new b child contents\n')])
1954+ ('base/a', b'new base contents\n' ),
1955+ ('child/b', b'new b child contents\n')])
1956 base_tree.commit(message='base')
1957 self.check_revno(2, 'base')
1958
1959@@ -140,8 +140,8 @@
1960 base_tree, child_tree = self.create_branches()
1961
1962 self.build_tree_contents([
1963- ('base/a', 'new base contents\n' ),
1964- ('child/b', 'new b child contents\n')])
1965+ ('base/a', b'new base contents\n' ),
1966+ ('child/b', b'new b child contents\n')])
1967
1968 base_tree.commit(message='base')
1969 self.check_revno(2, 'base')
1970@@ -172,7 +172,7 @@
1971 def test_pull_updates_both(self):
1972 base_tree = self.create_branches()[0]
1973 newchild_tree = base_tree.controldir.sprout('newchild').open_workingtree()
1974- self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
1975+ self.build_tree_contents([('newchild/b', b'newchild b contents\n')])
1976 newchild_tree.commit(message='newchild')
1977 self.check_revno(2, 'newchild')
1978
1979@@ -185,7 +185,7 @@
1980 def test_pull_local_updates_local(self):
1981 base_tree = self.create_branches()[0]
1982 newchild_tree = base_tree.controldir.sprout('newchild').open_workingtree()
1983- self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
1984+ self.build_tree_contents([('newchild/b', b'newchild b contents\n')])
1985 newchild_tree.commit(message='newchild')
1986 self.check_revno(2, 'newchild')
1987
1988@@ -293,7 +293,7 @@
1989 other_tree = child_tree.controldir.sprout('other').open_workingtree()
1990 other_branch = other_tree.branch
1991
1992- self.build_tree_contents([('other/c', 'file c\n')])
1993+ self.build_tree_contents([('other/c', b'file c\n')])
1994 other_tree.add('c')
1995 other_tree.commit(message='adding c')
1996 new_rev_id = other_branch.last_revision()
1997@@ -322,19 +322,19 @@
1998
1999 other_tree = child_tree.controldir.sprout('other').open_workingtree()
2000
2001- self.build_tree_contents([('other/a', 'new contents\n')])
2002+ self.build_tree_contents([('other/a', b'new contents\n')])
2003 other_tree.commit(message='changed a')
2004 self.check_revno(2, 'other')
2005 self.build_tree_contents([
2006- ('other/a', 'new contents\nand then some\n')])
2007+ ('other/a', b'new contents\nand then some\n')])
2008 other_tree.commit(message='another a')
2009 self.check_revno(3, 'other')
2010 self.build_tree_contents([
2011- ('other/a', 'new contents\nand then some\nand some more\n')])
2012+ ('other/a', b'new contents\nand then some\nand some more\n')])
2013 other_tree.commit('yet another a')
2014 self.check_revno(4, 'other')
2015
2016- self.build_tree_contents([('child/a', 'also changed a\n')])
2017+ self.build_tree_contents([('child/a', b'also changed a\n')])
2018 child_tree.commit(message='child modified a')
2019
2020 self.check_revno(2, 'child')
2021
2022=== modified file 'breezy/tests/blackbox/test_branch.py'
2023--- breezy/tests/blackbox/test_branch.py 2018-03-04 17:01:24 +0000
2024+++ breezy/tests/blackbox/test_branch.py 2018-03-25 11:39:57 +0000
2025@@ -49,10 +49,10 @@
2026
2027 def example_branch(self, path='.', format=None):
2028 tree = self.make_branch_and_tree(path, format=format)
2029- self.build_tree_contents([(path + '/hello', 'foo')])
2030+ self.build_tree_contents([(path + '/hello', b'foo')])
2031 tree.add('hello')
2032 tree.commit(message='setup')
2033- self.build_tree_contents([(path + '/goodbye', 'baz')])
2034+ self.build_tree_contents([(path + '/goodbye', b'baz')])
2035 tree.add('goodbye')
2036 tree.commit(message='setup')
2037 return tree
2038@@ -216,16 +216,16 @@
2039 tree_a = make_shared_tree('a')
2040 self.build_tree(['repo/a/file'])
2041 tree_a.add('file')
2042- tree_a.commit('commit a-1', rev_id='a-1')
2043+ tree_a.commit('commit a-1', rev_id=b'a-1')
2044 f = open('repo/a/file', 'ab')
2045 f.write('more stuff\n')
2046 f.close()
2047- tree_a.commit('commit a-2', rev_id='a-2')
2048+ tree_a.commit('commit a-2', rev_id=b'a-2')
2049
2050 tree_b = make_shared_tree('b')
2051 self.build_tree(['repo/b/file'])
2052 tree_b.add('file')
2053- tree_b.commit('commit b-1', rev_id='b-1')
2054+ tree_b.commit('commit b-1', rev_id=b'b-1')
2055
2056 self.assertTrue(shared_repo.has_revision('a-1'))
2057 self.assertTrue(shared_repo.has_revision('a-2'))
2058@@ -293,8 +293,8 @@
2059 self.example_branch('a')
2060 # existing dir with similar files but no .brz dir
2061 self.build_tree_contents([('b/',)])
2062- self.build_tree_contents([('b/hello', 'bar')]) # different content
2063- self.build_tree_contents([('b/goodbye', 'baz')])# same content
2064+ self.build_tree_contents([('b/hello', b'bar')]) # different content
2065+ self.build_tree_contents([('b/goodbye', b'baz')])# same content
2066 # fails without --use-existing-dir
2067 out, err = self.run_bzr('branch a b', retcode=3)
2068 self.assertEqual('', out)
2069@@ -595,7 +595,7 @@
2070 def setUp(self):
2071 super(TestRemoteBranch, self).setUp()
2072 tree = self.make_branch_and_tree('branch')
2073- self.build_tree_contents([('branch/file', 'file content\n')])
2074+ self.build_tree_contents([('branch/file', b'file content\n')])
2075 tree.add('file')
2076 tree.commit('file created')
2077
2078
2079=== modified file 'breezy/tests/blackbox/test_break_lock.py'
2080--- breezy/tests/blackbox/test_break_lock.py 2017-05-21 18:10:28 +0000
2081+++ breezy/tests/blackbox/test_break_lock.py 2018-03-25 11:39:57 +0000
2082@@ -110,7 +110,7 @@
2083 super(TestConfigBreakLock, self).setUp()
2084 self.config_file_name = './my.conf'
2085 self.build_tree_contents([(self.config_file_name,
2086- '[DEFAULT]\none=1\n')])
2087+ b'[DEFAULT]\none=1\n')])
2088 self.config = config.LockableConfig(file_name=self.config_file_name)
2089 self.config.lock_write()
2090
2091
2092=== modified file 'breezy/tests/blackbox/test_bundle_info.py'
2093--- breezy/tests/blackbox/test_bundle_info.py 2017-05-21 18:10:28 +0000
2094+++ breezy/tests/blackbox/test_bundle_info.py 2018-03-25 11:39:57 +0000
2095@@ -27,7 +27,7 @@
2096 source = self.make_branch_and_tree('source')
2097 self.build_tree(['source/foo'])
2098 source.add('foo')
2099- source.commit('added file', rev_id='rev1')
2100+ source.commit('added file', rev_id=b'rev1')
2101 bundle = open('bundle', 'wb')
2102 try:
2103 source.branch.repository.create_bundle('rev1', 'null:', bundle,
2104@@ -45,7 +45,7 @@
2105 target = self.make_branch('target')
2106 md = merge_directive.MergeDirective2.from_objects(
2107 source.branch.repository, 'rev1', 0, 0, 'target',
2108- base_revision_id='null:')
2109+ base_revision_id=b'null:')
2110 directive = open('directive', 'wb')
2111 try:
2112 directive.writelines(md.to_lines())
2113
2114=== modified file 'breezy/tests/blackbox/test_cat.py'
2115--- breezy/tests/blackbox/test_cat.py 2018-03-04 15:59:37 +0000
2116+++ breezy/tests/blackbox/test_cat.py 2018-03-25 11:39:57 +0000
2117@@ -27,13 +27,13 @@
2118
2119 def test_cat(self):
2120 tree = self.make_branch_and_tree('branch')
2121- self.build_tree_contents([('branch/a', 'foo\n')])
2122+ self.build_tree_contents([('branch/a', b'foo\n')])
2123 tree.add('a')
2124 # 'brz cat' without an option should cat the last revision
2125 self.run_bzr(['cat', 'a'], retcode=3, working_dir='branch')
2126
2127 tree.commit(message='1')
2128- self.build_tree_contents([('branch/a', 'baz\n')])
2129+ self.build_tree_contents([('branch/a', b'baz\n')])
2130
2131 self.assertEqual('foo\n',
2132 self.run_bzr(['cat', 'a'], working_dir='branch')[0])
2133@@ -77,11 +77,11 @@
2134 # current trees later in the test case
2135 # a-rev-tree is special because it appears in both the revision
2136 # tree and the working tree
2137- self.build_tree_contents([('a-rev-tree', 'foo\n'),
2138- ('c-rev', 'baz\n'), ('d-rev', 'bar\n'), ('e-rev', 'qux\n')])
2139+ self.build_tree_contents([('a-rev-tree', b'foo\n'),
2140+ ('c-rev', b'baz\n'), ('d-rev', b'bar\n'), ('e-rev', b'qux\n')])
2141 with tree.lock_write():
2142 tree.add(['a-rev-tree', 'c-rev', 'd-rev', 'e-rev'])
2143- tree.commit('add test files', rev_id='first')
2144+ tree.commit('add test files', rev_id=b'first')
2145 # remove currently uses self._write_inventory -
2146 # work around that for now.
2147 tree.flush()
2148@@ -89,7 +89,7 @@
2149 tree.rename_one('a-rev-tree', 'b-tree')
2150 tree.rename_one('c-rev', 'a-rev-tree')
2151 tree.rename_one('e-rev', 'old-rev')
2152- self.build_tree_contents([('e-rev', 'new\n')])
2153+ self.build_tree_contents([('e-rev', b'new\n')])
2154 tree.add(['e-rev'])
2155
2156 # 'b-tree' is not present in the old tree.
2157@@ -161,7 +161,7 @@
2158 from ...tree import Tree
2159 wt = self.make_branch_and_tree('.')
2160 self.build_tree_contents([
2161- ('README', "junk\nline 1 of README\nline 2 of README\n"),
2162+ ('README', b"junk\nline 1 of README\nline 2 of README\n"),
2163 ])
2164 wt.add('README')
2165 wt.commit('Making sure there is a basis_tree available')
2166@@ -219,7 +219,7 @@
2167 def test_simple_branch_cat(self):
2168 self.setup_smart_server_with_call_log()
2169 t = self.make_branch_and_tree('branch')
2170- self.build_tree_contents([('branch/foo', 'thecontents')])
2171+ self.build_tree_contents([('branch/foo', b'thecontents')])
2172 t.add("foo")
2173 t.commit("message")
2174 self.reset_smart_call_log()
2175
2176=== modified file 'breezy/tests/blackbox/test_cat_revision.py'
2177--- breezy/tests/blackbox/test_cat_revision.py 2017-08-26 13:58:53 +0000
2178+++ breezy/tests/blackbox/test_cat_revision.py 2018-03-25 11:39:57 +0000
2179@@ -22,7 +22,7 @@
2180
2181 def test_cat_unicode_revision(self):
2182 tree = self.make_branch_and_tree('.')
2183- tree.commit('This revision', rev_id='abcd')
2184+ tree.commit('This revision', rev_id=b'abcd')
2185 output, errors = self.run_bzr(['cat-revision', u'abcd'])
2186 self.assertContainsRe(output, 'This revision')
2187 self.assertEqual('', errors)
2188@@ -33,9 +33,9 @@
2189 wt = self.make_branch_and_tree('.')
2190 r = wt.branch.repository
2191
2192- wt.commit('Commit one', rev_id='a@r-0-1')
2193- wt.commit('Commit two', rev_id='a@r-0-2')
2194- wt.commit('Commit three', rev_id='a@r-0-3')
2195+ wt.commit('Commit one', rev_id=b'a@r-0-1')
2196+ wt.commit('Commit two', rev_id=b'a@r-0-2')
2197+ wt.commit('Commit three', rev_id=b'a@r-0-3')
2198
2199 with r.lock_read():
2200 revs = {}
2201@@ -61,14 +61,14 @@
2202 def test_cat_revision_directory(self):
2203 """Test --directory option"""
2204 tree = self.make_branch_and_tree('a')
2205- tree.commit('This revision', rev_id='abcd')
2206+ tree.commit('This revision', rev_id=b'abcd')
2207 output, errors = self.run_bzr(['cat-revision', '-d', 'a', u'abcd'])
2208 self.assertContainsRe(output, 'This revision')
2209 self.assertEqual('', errors)
2210
2211 def test_cat_tree_less_branch(self):
2212 tree = self.make_branch_and_tree('.')
2213- tree.commit('This revision', rev_id='abcd')
2214+ tree.commit('This revision', rev_id=b'abcd')
2215 tree.controldir.destroy_workingtree()
2216 output, errors = self.run_bzr(['cat-revision', '-d', 'a', u'abcd'])
2217 self.assertContainsRe(output, 'This revision')
2218
2219=== modified file 'breezy/tests/blackbox/test_checkout.py'
2220--- breezy/tests/blackbox/test_checkout.py 2017-11-12 13:53:51 +0000
2221+++ breezy/tests/blackbox/test_checkout.py 2018-03-25 11:39:57 +0000
2222@@ -41,10 +41,10 @@
2223 def setUp(self):
2224 super(TestCheckout, self).setUp()
2225 tree = controldir.ControlDir.create_standalone_workingtree('branch')
2226- tree.commit('1', rev_id='1', allow_pointless=True)
2227+ tree.commit('1', rev_id=b'1', allow_pointless=True)
2228 self.build_tree(['branch/added_in_2'])
2229 tree.add('added_in_2')
2230- tree.commit('2', rev_id='2')
2231+ tree.commit('2', rev_id=b'2')
2232
2233 def test_checkout_makes_bound_branch(self):
2234 self.run_bzr('checkout branch checkout')
2235@@ -118,13 +118,13 @@
2236
2237 def _test_checkout_existing_dir(self, lightweight):
2238 source = self.make_branch_and_tree('source')
2239- self.build_tree_contents([('source/file1', 'content1'),
2240- ('source/file2', 'content2'),])
2241+ self.build_tree_contents([('source/file1', b'content1'),
2242+ ('source/file2', b'content2'),])
2243 source.add(['file1', 'file2'])
2244 source.commit('added files')
2245- self.build_tree_contents([('target/', ''),
2246- ('target/file1', 'content1'),
2247- ('target/file2', 'content3'),])
2248+ self.build_tree_contents([('target/', b''),
2249+ ('target/file1', b'content1'),
2250+ ('target/file2', b'content3'),])
2251 cmd = ['checkout', 'source', 'target']
2252 if lightweight:
2253 cmd.append('--lightweight')
2254
2255=== modified file 'breezy/tests/blackbox/test_commit.py'
2256--- breezy/tests/blackbox/test_commit.py 2017-12-21 16:44:19 +0000
2257+++ breezy/tests/blackbox/test_commit.py 2018-03-25 11:39:57 +0000
2258@@ -92,10 +92,10 @@
2259 self.run_bzr(['commit', '-m', 'first commit', 'a'])
2260
2261 b_tree = a_tree.controldir.sprout('b').open_workingtree()
2262- self.build_tree_contents([('b/a_file', 'changes in b')])
2263+ self.build_tree_contents([('b/a_file', b'changes in b')])
2264 self.run_bzr(['commit', '-m', 'first commit in b', 'b'])
2265
2266- self.build_tree_contents([('a/a_file', 'new contents')])
2267+ self.build_tree_contents([('a/a_file', b'new contents')])
2268 self.run_bzr(['commit', '-m', 'change in a', 'a'])
2269
2270 b_tree.merge_from_branch(a_tree.branch)
2271@@ -126,7 +126,7 @@
2272 def test_verbose_commit_modified(self):
2273 # Verbose commit of modified file should say so
2274 wt = self.prepare_simple_history()
2275- self.build_tree_contents([('hello.txt', 'new contents')])
2276+ self.build_tree_contents([('hello.txt', b'new contents')])
2277 out, err = self.run_bzr('commit -m modified')
2278 self.assertEqual('', out)
2279 self.assertContainsRe(err, '^Committing to: .*\n'
2280@@ -320,8 +320,8 @@
2281 other_tree.remove(['dirtoremove', 'filetoremove'])
2282 self.build_tree_contents([
2283 ('other/newdir/',),
2284- ('other/filetomodify', 'new content'),
2285- ('other/newfile', 'new file content')])
2286+ ('other/filetomodify', b'new content'),
2287+ ('other/newfile', b'new file content')])
2288 other_tree.add('newfile')
2289 other_tree.add('newdir/')
2290 other_tree.commit('modify all sample files and dirs.')
2291@@ -347,7 +347,7 @@
2292
2293 def test_empty_commit_message(self):
2294 tree = self.make_branch_and_tree('.')
2295- self.build_tree_contents([('foo.c', 'int main() {}')])
2296+ self.build_tree_contents([('foo.c', b'int main() {}')])
2297 tree.add('foo.c')
2298 self.run_bzr('commit -m ""')
2299
2300@@ -357,8 +357,8 @@
2301 outer_tree = self.make_branch_and_tree('.')
2302 inner_tree = self.make_branch_and_tree('branch')
2303 self.build_tree_contents([
2304- ('branch/foo.c', 'int main() {}'),
2305- ('branch/bar.c', 'int main() {}')])
2306+ ('branch/foo.c', b'int main() {}'),
2307+ ('branch/bar.c', b'int main() {}')])
2308 inner_tree.add(['foo.c', 'bar.c'])
2309 # can't commit files in different trees; sane error
2310 self.run_bzr('commit -m newstuff branch/foo.c .', retcode=3)
2311@@ -403,16 +403,16 @@
2312 trunk = self.make_branch_and_tree('trunk')
2313
2314 u1 = trunk.branch.create_checkout('u1')
2315- self.build_tree_contents([('u1/hosts', 'initial contents\n')])
2316+ self.build_tree_contents([('u1/hosts', b'initial contents\n')])
2317 u1.add('hosts')
2318 self.run_bzr('commit -m add-hosts u1')
2319
2320 u2 = trunk.branch.create_checkout('u2')
2321- self.build_tree_contents([('u2/hosts', 'altered in u2\n')])
2322+ self.build_tree_contents([('u2/hosts', b'altered in u2\n')])
2323 self.run_bzr('commit -m checkin-from-u2 u2')
2324
2325 # make an offline commits
2326- self.build_tree_contents([('u1/hosts', 'first offline change in u1\n')])
2327+ self.build_tree_contents([('u1/hosts', b'first offline change in u1\n')])
2328 self.run_bzr('commit -m checkin-offline --local u1')
2329
2330 # now try to pull in online work from u2, and then commit our offline
2331@@ -432,7 +432,7 @@
2332 # add a text change here to represent resolving the merge conflicts in
2333 # favour of a new version of the file not identical to either the u1
2334 # version or the u2 version.
2335- self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
2336+ self.build_tree_contents([('u1/hosts', b'merge resolution\n')])
2337 self.run_bzr('commit -m checkin-merge-of-the-offline-work-from-u1 u1')
2338
2339 def test_commit_exclude_excludes_modified_files(self):
2340@@ -759,7 +759,7 @@
2341 # then during partial commit we have error
2342 # parent_id {dir-XXX} not in inventory
2343 t.rename_one('dir/a', 'a')
2344- self.build_tree_contents([('test', 'changes in test')])
2345+ self.build_tree_contents([('test', b'changes in test')])
2346 # partial commit
2347 out, err = self.run_bzr('commit test -m "partial commit"')
2348 self.assertEqual('', out)
2349
2350=== modified file 'breezy/tests/blackbox/test_config.py'
2351--- breezy/tests/blackbox/test_config.py 2018-03-10 13:52:14 +0000
2352+++ breezy/tests/blackbox/test_config.py 2018-03-25 11:39:57 +0000
2353@@ -57,12 +57,12 @@
2354
2355 def test_unexpected_regexp(self):
2356 self.run_bzr_error(
2357- ['The "\*file" configuration option does not exist',],
2358+ ['The "\\*file" configuration option does not exist',],
2359 ['config', '*file'])
2360
2361 def test_wrong_regexp(self):
2362 self.run_bzr_error(
2363- ['Invalid pattern\(s\) found. "\*file" nothing to repeat',],
2364+ ['Invalid pattern\\(s\\) found. "\\*file" nothing to repeat',],
2365 ['config', '--all', '*file'])
2366
2367
2368
2369=== modified file 'breezy/tests/blackbox/test_conflicts.py'
2370--- breezy/tests/blackbox/test_conflicts.py 2017-06-10 00:17:06 +0000
2371+++ breezy/tests/blackbox/test_conflicts.py 2018-03-25 11:39:57 +0000
2372@@ -26,8 +26,8 @@
2373 prefix='my'):
2374 this_tree = test.make_branch_and_tree(this_path)
2375 test.build_tree_contents([
2376- ('%s/%sfile' % (this_path, prefix), 'this content\n'),
2377- ('%s/%s_other_file' % (this_path, prefix), 'this content\n'),
2378+ ('%s/%sfile' % (this_path, prefix), b'this content\n'),
2379+ ('%s/%s_other_file' % (this_path, prefix), b'this content\n'),
2380 ('%s/%sdir/' % (this_path, prefix),),
2381 ])
2382 this_tree.add(prefix+'file')
2383@@ -36,14 +36,14 @@
2384 this_tree.commit(message="new")
2385 other_tree = this_tree.controldir.sprout(other_path).open_workingtree()
2386 test.build_tree_contents([
2387- ('%s/%sfile' % (other_path, prefix), 'contentsb\n'),
2388- ('%s/%s_other_file' % (other_path, prefix), 'contentsb\n'),
2389+ ('%s/%sfile' % (other_path, prefix), b'contentsb\n'),
2390+ ('%s/%s_other_file' % (other_path, prefix), b'contentsb\n'),
2391 ])
2392 other_tree.rename_one(prefix+'dir', prefix+'dir2')
2393 other_tree.commit(message="change")
2394 test.build_tree_contents([
2395- ('%s/%sfile' % (this_path, prefix), 'contentsa2\n'),
2396- ('%s/%s_other_file' % (this_path, prefix), 'contentsa2\n'),
2397+ ('%s/%sfile' % (this_path, prefix), b'contentsa2\n'),
2398+ ('%s/%s_other_file' % (this_path, prefix), b'contentsa2\n'),
2399 ])
2400 this_tree.rename_one(prefix+'dir', prefix+'dir3')
2401 this_tree.commit(message='change')
2402
2403=== modified file 'breezy/tests/blackbox/test_diff.py'
2404--- breezy/tests/blackbox/test_diff.py 2017-06-10 00:17:06 +0000
2405+++ breezy/tests/blackbox/test_diff.py 2018-03-25 11:39:57 +0000
2406@@ -45,8 +45,8 @@
2407 def make_example_branch(self):
2408 tree = self.make_branch_and_tree('.')
2409 self.build_tree_contents([
2410- ('hello', 'foo\n'),
2411- ('goodbye', 'baz\n')])
2412+ ('hello', b'foo\n'),
2413+ ('goodbye', b'baz\n')])
2414 tree.add(['hello'])
2415 tree.commit('setup')
2416 tree.add(['goodbye'])
2417@@ -58,7 +58,7 @@
2418
2419 def test_diff(self):
2420 tree = self.make_example_branch()
2421- self.build_tree_contents([('hello', 'hello world!')])
2422+ self.build_tree_contents([('hello', b'hello world!')])
2423 tree.commit(message='fixing hello')
2424 output = self.run_bzr('diff -r 2..3', retcode=1)[0]
2425 self.assertTrue('\n+hello world!' in output)
2426@@ -76,7 +76,7 @@
2427 def test_diff_prefix(self):
2428 """diff --prefix appends to filenames in output"""
2429 self.make_example_branch()
2430- self.build_tree_contents([('hello', 'hello world!\n')])
2431+ self.build_tree_contents([('hello', b'hello world!\n')])
2432 out, err = self.run_bzr('diff --prefix old/:new/', retcode=1)
2433 self.assertEqual(err, '')
2434 self.assertEqualDiff(subst_dates(out), '''\
2435@@ -98,7 +98,7 @@
2436 def test_diff_p1(self):
2437 """diff -p1 produces lkml-style diffs"""
2438 self.make_example_branch()
2439- self.build_tree_contents([('hello', 'hello world!\n')])
2440+ self.build_tree_contents([('hello', b'hello world!\n')])
2441 out, err = self.run_bzr('diff -p1', retcode=1)
2442 self.assertEqual(err, '')
2443 self.assertEqualDiff(subst_dates(out), '''\
2444@@ -114,7 +114,7 @@
2445 def test_diff_p0(self):
2446 """diff -p0 produces diffs with no prefix"""
2447 self.make_example_branch()
2448- self.build_tree_contents([('hello', 'hello world!\n')])
2449+ self.build_tree_contents([('hello', b'hello world!\n')])
2450 out, err = self.run_bzr('diff -p0', retcode=1)
2451 self.assertEqual(err, '')
2452 self.assertEqualDiff(subst_dates(out), '''\
2453@@ -175,7 +175,7 @@
2454 branch1_tree.add('file2')
2455 branch1_tree.commit(message='add file and file2')
2456 branch2_tree = branch1_tree.controldir.sprout('branch2').open_workingtree()
2457- self.build_tree_contents([('branch2/file', 'new content\n')])
2458+ self.build_tree_contents([('branch2/file', b'new content\n')])
2459 branch2_tree.commit(message='update file')
2460 return branch1_tree, branch2_tree
2461
2462@@ -250,7 +250,7 @@
2463 def test_diff_revno_branches(self):
2464 self.example_branches()
2465 branch2_tree = workingtree.WorkingTree.open_containing('branch2')[0]
2466- self.build_tree_contents([('branch2/file', 'even newer content')])
2467+ self.build_tree_contents([('branch2/file', b'even newer content')])
2468 branch2_tree.commit(message='update file once more')
2469
2470 out, err = self.run_bzr('diff -r revno:1:branch2..revno:1:branch1',
2471@@ -270,22 +270,22 @@
2472
2473 def example_branch2(self):
2474 branch1_tree = self.make_branch_and_tree('branch1')
2475- self.build_tree_contents([('branch1/file1', 'original line\n')])
2476+ self.build_tree_contents([('branch1/file1', b'original line\n')])
2477 branch1_tree.add('file1')
2478 branch1_tree.commit(message='first commit')
2479- self.build_tree_contents([('branch1/file1', 'repo line\n')])
2480+ self.build_tree_contents([('branch1/file1', b'repo line\n')])
2481 branch1_tree.commit(message='second commit')
2482 return branch1_tree
2483
2484 def test_diff_to_working_tree(self):
2485 self.example_branch2()
2486- self.build_tree_contents([('branch1/file1', 'new line')])
2487+ self.build_tree_contents([('branch1/file1', b'new line')])
2488 output = self.run_bzr('diff -r 1.. branch1', retcode=1)
2489 self.assertContainsRe(output[0], '\n\\-original line\n\\+new line\n')
2490
2491 def test_diff_to_working_tree_in_subdir(self):
2492 self.example_branch2()
2493- self.build_tree_contents([('branch1/file1', 'new line')])
2494+ self.build_tree_contents([('branch1/file1', b'new line')])
2495 os.mkdir('branch1/dir1')
2496 output = self.run_bzr('diff -r 1..', retcode=1,
2497 working_dir='branch1/dir1')
2498@@ -318,7 +318,7 @@
2499 diff_format_registry.register("boo", BooDiffTree, "Scary diff format")
2500 self.addCleanup(diff_format_registry.remove, "boo")
2501 self.make_example_branch()
2502- self.build_tree_contents([('hello', 'hello world!\n')])
2503+ self.build_tree_contents([('hello', b'hello world!\n')])
2504 output = self.run_bzr('diff --format=boo', retcode=1)
2505 self.assertTrue("BOO!" in output[0])
2506 output = self.run_bzr('diff -Fboo', retcode=1)
2507@@ -360,14 +360,14 @@
2508
2509 def test_diff_label_added(self):
2510 tree = super(TestDiffLabels, self).make_example_branch()
2511- self.build_tree_contents([('barbar', 'barbar')])
2512+ self.build_tree_contents([('barbar', b'barbar')])
2513 tree.add('barbar')
2514 diff = self.run_bzr('diff', retcode=1)
2515 self.assertTrue("=== added file 'barbar'" in diff[0])
2516
2517 def test_diff_label_modified(self):
2518 super(TestDiffLabels, self).make_example_branch()
2519- self.build_tree_contents([('hello', 'barbar')])
2520+ self.build_tree_contents([('hello', b'barbar')])
2521 diff = self.run_bzr('diff', retcode=1)
2522 self.assertTrue("=== modified file 'hello'" in diff[0])
2523
2524@@ -409,7 +409,7 @@
2525 """Test that the options are passed correctly to an external diff process"""
2526 self.requireFeature(features.diff_feature)
2527 self.make_example_branch()
2528- self.build_tree_contents([('hello', 'Foo\n')])
2529+ self.build_tree_contents([('hello', b'Foo\n')])
2530 out, err = self.run_bzr('diff --diff-options -i --using diff',
2531 retcode=1)
2532 self.assertEqual("=== modified file 'hello'\n", out)
2533@@ -421,6 +421,6 @@
2534 def test_diff_output(self):
2535 # check that output doesn't mangle line-endings
2536 self.make_example_branch()
2537- self.build_tree_contents([('hello', 'hello world!\n')])
2538+ self.build_tree_contents([('hello', b'hello world!\n')])
2539 output = self.run_bzr_subprocess('diff', retcode=1)[0]
2540 self.assertTrue('\n+hello world!\n' in output)
2541
2542=== modified file 'breezy/tests/blackbox/test_dpush.py'
2543--- breezy/tests/blackbox/test_dpush.py 2017-11-16 00:39:04 +0000
2544+++ breezy/tests/blackbox/test_dpush.py 2018-03-25 11:39:57 +0000
2545@@ -47,7 +47,7 @@
2546 builder.build_snapshot(None,
2547 [('add', ('', 'TREE_ROOT', 'directory', None)),
2548 ('add', ('foo', 'fooid', 'file', 'bar'))],
2549- revision_id='revid')
2550+ revision_id=b'revid')
2551 return builder
2552
2553 def test_dpush_native(self):
2554@@ -78,7 +78,7 @@
2555 b = self.make_dummy_builder('d').get_branch()
2556
2557 dc = b.controldir.sprout('dc', force_new_repo=True)
2558- self.build_tree_contents([("dc/foofile", "blaaaa")])
2559+ self.build_tree_contents([("dc/foofile", b"blaaaa")])
2560 dc_tree = dc.open_workingtree()
2561 dc_tree.add("foofile")
2562 dc_tree.commit("msg")
2563@@ -97,12 +97,12 @@
2564 b = self.make_dummy_builder('d').get_branch()
2565
2566 dc = b.controldir.sprout('dc', force_new_repo=True)
2567- self.build_tree_contents([("dc/foofile", "blaaaa")])
2568+ self.build_tree_contents([("dc/foofile", b"blaaaa")])
2569 dc_tree = dc.open_workingtree()
2570 dc_tree.add("foofile")
2571 newrevid = dc_tree.commit('msg')
2572
2573- self.build_tree_contents([("dc/foofile", "blaaaal")])
2574+ self.build_tree_contents([("dc/foofile", b"blaaaal")])
2575 script.run_script(self, '''
2576 $ brz dpush -d dc d --no-strict
2577 2>Doing on-the-fly conversion from DummyForeignVcsRepositoryFormat() to RepositoryFormat2a().
2578@@ -126,11 +126,11 @@
2579 dc = b.controldir.sprout('dc', force_new_repo=True)
2580 dc_tree = dc.open_workingtree()
2581
2582- self.build_tree_contents([("dc/foo", "bar")])
2583+ self.build_tree_contents([("dc/foo", b"bar")])
2584 dc_tree.commit('msg1')
2585
2586 builder.build_snapshot(None,
2587- [('modify', ('fooid', 'blie'))], revision_id='revid2')
2588+ [('modify', (b'fooid', 'blie'))], revision_id=b'revid2')
2589
2590 output, error = self.run_bzr("dpush -d dc d", retcode=3)
2591 self.assertEqual(output, "")
2592
2593=== modified file 'breezy/tests/blackbox/test_export.py'
2594--- breezy/tests/blackbox/test_export.py 2017-06-10 00:17:06 +0000
2595+++ breezy/tests/blackbox/test_export.py 2018-03-25 11:39:57 +0000
2596@@ -78,7 +78,7 @@
2597
2598 def make_tree_with_extra_bzr_files(self):
2599 tree = self.make_basic_tree()
2600- self.build_tree_contents([('tree/.bzrrules', '')])
2601+ self.build_tree_contents([('tree/.bzrrules', b'')])
2602 self.build_tree(['tree/.bzr-adir/', 'tree/.bzr-adir/afile'])
2603 tree.add(['.bzrrules', '.bzr-adir/', '.bzr-adir/afile'])
2604
2605@@ -244,7 +244,7 @@
2606 tree = self.make_branch_and_tree('dir')
2607 self.build_tree(['dir/a'])
2608 tree.add('a')
2609- self.build_tree_contents([('dir/.bzrrules', '')])
2610+ self.build_tree_contents([('dir/.bzrrules', b'')])
2611 tree.add('.bzrrules')
2612 self.build_tree(['dir/.bzr-adir/', 'dir/.bzr-adir/afile'])
2613 tree.add(['.bzr-adir/', '.bzr-adir/afile'])
2614@@ -267,11 +267,11 @@
2615 def example_branch(self):
2616 """Create a branch a 'branch' containing hello and goodbye."""
2617 tree = self.make_branch_and_tree('branch')
2618- self.build_tree_contents([('branch/hello', 'foo')])
2619+ self.build_tree_contents([('branch/hello', b'foo')])
2620 tree.add('hello')
2621 tree.commit('setup')
2622
2623- self.build_tree_contents([('branch/goodbye', 'baz')])
2624+ self.build_tree_contents([('branch/goodbye', b'baz')])
2625 tree.add('goodbye')
2626 tree.commit('setup')
2627 return tree
2628@@ -380,7 +380,7 @@
2629
2630 def test_dir_export_per_file_timestamps(self):
2631 tree = self.example_branch()
2632- self.build_tree_contents([('branch/har', 'foo')])
2633+ self.build_tree_contents([('branch/har', b'foo')])
2634 tree.add('har')
2635 # Earliest allowable date on FAT32 filesystems is 1980-01-01
2636 tree.commit('setup', timestamp=315532800)
2637@@ -409,7 +409,7 @@
2638 """Test --uncommitted option"""
2639 self.example_branch()
2640 os.chdir('branch')
2641- self.build_tree_contents([('goodbye', 'uncommitted data')])
2642+ self.build_tree_contents([('goodbye', b'uncommitted data')])
2643 self.run_bzr(['export', '--uncommitted', 'latest'])
2644 self.check_file_contents('latest/goodbye', 'uncommitted data')
2645
2646@@ -424,7 +424,7 @@
2647
2648 def test_zip_export_per_file_timestamps(self):
2649 tree = self.example_branch()
2650- self.build_tree_contents([('branch/har', 'foo')])
2651+ self.build_tree_contents([('branch/har', b'foo')])
2652 tree.add('har')
2653 # Earliest allowable date on FAT32 filesystems is 1980-01-01
2654 timestamp = 347151600
2655@@ -440,7 +440,7 @@
2656 def test_simple_export(self):
2657 self.setup_smart_server_with_call_log()
2658 t = self.make_branch_and_tree('branch')
2659- self.build_tree_contents([('branch/foo', 'thecontents')])
2660+ self.build_tree_contents([('branch/foo', b'thecontents')])
2661 t.add("foo")
2662 t.commit("message")
2663 self.reset_smart_call_log()
2664
2665=== modified file 'breezy/tests/blackbox/test_filesystem_cicp.py'
2666--- breezy/tests/blackbox/test_filesystem_cicp.py 2017-05-22 00:56:52 +0000
2667+++ breezy/tests/blackbox/test_filesystem_cicp.py 2018-03-25 11:39:57 +0000
2668@@ -43,9 +43,9 @@
2669 wt = self.make_branch_and_tree('.')
2670 # create a file on disk with the mixed-case parent and base name
2671 self.build_tree(['CamelCaseParent/', 'lowercaseparent/'])
2672- self.build_tree_contents([('CamelCaseParent/CamelCase', 'camel case'),
2673- ('lowercaseparent/lowercase', 'lower case'),
2674- ('lowercaseparent/mixedCase', 'mixedCasecase'),
2675+ self.build_tree_contents([('CamelCaseParent/CamelCase', b'camel case'),
2676+ ('lowercaseparent/lowercase', b'lower case'),
2677+ ('lowercaseparent/mixedCase', b'mixedCasecase'),
2678 ])
2679 return wt
2680
2681
2682=== modified file 'breezy/tests/blackbox/test_filtered_view_ops.py'
2683--- breezy/tests/blackbox/test_filtered_view_ops.py 2017-06-10 00:17:06 +0000
2684+++ breezy/tests/blackbox/test_filtered_view_ops.py 2018-03-25 11:39:57 +0000
2685@@ -160,8 +160,8 @@
2686 wt2.views.set_view('my', ['a', 'b'])
2687 # Commit a change to the first tree
2688 self.build_tree_contents([
2689- ('tree_1/a', 'changed a\n'),
2690- ('tree_1/c', 'changed c\n'),
2691+ ('tree_1/a', b'changed a\n'),
2692+ ('tree_1/c', b'changed c\n'),
2693 ])
2694 wt1.commit("changing a c")
2695 return wt1, wt2
2696
2697=== modified file 'breezy/tests/blackbox/test_ignore.py'
2698--- breezy/tests/blackbox/test_ignore.py 2017-11-12 18:17:03 +0000
2699+++ breezy/tests/blackbox/test_ignore.py 2018-03-25 11:39:57 +0000
2700@@ -68,24 +68,24 @@
2701 ignores._set_user_ignores(['*.tmp'])
2702
2703 self.build_tree_contents(
2704- [('foo.tmp', '.tmp files are ignored by default')])
2705+ [('foo.tmp', b'.tmp files are ignored by default')])
2706 self.assertEqual(list(tree.unknowns()), [])
2707
2708- self.build_tree_contents([('foo.c', 'int main() {}')])
2709+ self.build_tree_contents([('foo.c', b'int main() {}')])
2710 self.assertEqual(list(tree.unknowns()), ['foo.c'])
2711
2712 tree.add('foo.c')
2713 self.assertEqual(list(tree.unknowns()), [])
2714
2715 # 'ignore' works when creating the .bzrignore file
2716- self.build_tree_contents([('foo.blah', 'blah')])
2717+ self.build_tree_contents([('foo.blah', b'blah')])
2718 self.assertEqual(list(tree.unknowns()), ['foo.blah'])
2719 self.run_bzr('ignore *.blah')
2720 self.assertEqual(list(tree.unknowns()), [])
2721 self.check_file_contents('.bzrignore', '*.blah\n')
2722
2723 # 'ignore' works when then .bzrignore file already exists
2724- self.build_tree_contents([('garh', 'garh')])
2725+ self.build_tree_contents([('garh', b'garh')])
2726 self.assertEqual(list(tree.unknowns()), ['garh'])
2727 self.run_bzr('ignore garh')
2728 self.assertEqual(list(tree.unknowns()), [])
2729
2730=== modified file 'breezy/tests/blackbox/test_ignored.py'
2731--- breezy/tests/blackbox/test_ignored.py 2017-05-21 18:10:28 +0000
2732+++ breezy/tests/blackbox/test_ignored.py 2018-03-25 11:39:57 +0000
2733@@ -31,7 +31,7 @@
2734 tree = self.make_branch_and_tree('.')
2735 self.build_tree(['foo.pyc'])
2736 # ensure that foo.pyc is ignored
2737- self.build_tree_contents([('.bzrignore', 'foo.pyc')])
2738+ self.build_tree_contents([('.bzrignore', b'foo.pyc')])
2739 self.assertTrue(tree.is_ignored('foo.pyc'))
2740 # now add it and check the ui does not show it.
2741 tree.add('foo.pyc')
2742@@ -42,7 +42,7 @@
2743 def test_ignored_directory(self):
2744 """Test --directory option"""
2745 tree = self.make_branch_and_tree('a')
2746- self.build_tree_contents([('a/README', 'contents'),
2747- ('a/.bzrignore', 'README')])
2748+ self.build_tree_contents([('a/README', b'contents'),
2749+ ('a/.bzrignore', b'README')])
2750 out, err = self.run_bzr(['ignored', '--directory=a'])
2751 self.assertStartsWith(out, 'README')
2752
2753=== modified file 'breezy/tests/blackbox/test_info.py'
2754--- breezy/tests/blackbox/test_info.py 2017-06-10 16:40:42 +0000
2755+++ breezy/tests/blackbox/test_info.py 2018-03-25 11:39:57 +0000
2756@@ -1553,7 +1553,7 @@
2757 def test_simple_branch_info(self):
2758 self.setup_smart_server_with_call_log()
2759 t = self.make_branch_and_tree('branch')
2760- self.build_tree_contents([('branch/foo', 'thecontents')])
2761+ self.build_tree_contents([('branch/foo', b'thecontents')])
2762 t.add("foo")
2763 t.commit("message")
2764 self.reset_smart_call_log()
2765@@ -1570,7 +1570,7 @@
2766 def test_verbose_branch_info(self):
2767 self.setup_smart_server_with_call_log()
2768 t = self.make_branch_and_tree('branch')
2769- self.build_tree_contents([('branch/foo', 'thecontents')])
2770+ self.build_tree_contents([('branch/foo', b'thecontents')])
2771 t.add("foo")
2772 t.commit("message")
2773 self.reset_smart_call_log()
2774
2775=== modified file 'breezy/tests/blackbox/test_init.py'
2776--- breezy/tests/blackbox/test_init.py 2018-03-04 17:01:24 +0000
2777+++ breezy/tests/blackbox/test_init.py 2018-03-25 11:39:57 +0000
2778@@ -153,8 +153,8 @@
2779 def create_simple_tree(self):
2780 tree = self.make_branch_and_tree('tree')
2781 self.build_tree(['tree/a'])
2782- tree.add(['a'], ['a-id'])
2783- tree.commit('one', rev_id='r1')
2784+ tree.add(['a'], [b'a-id'])
2785+ tree.commit('one', rev_id=b'r1')
2786 return tree
2787
2788 def test_init_create_prefix(self):
2789
2790=== modified file 'breezy/tests/blackbox/test_inventory.py'
2791--- breezy/tests/blackbox/test_inventory.py 2017-05-21 18:10:28 +0000
2792+++ breezy/tests/blackbox/test_inventory.py 2018-03-25 11:39:57 +0000
2793@@ -29,8 +29,8 @@
2794 tree = self.make_branch_and_tree('.')
2795 self.build_tree(['a', 'b/', 'b/c'])
2796
2797- tree.add(['a', 'b', 'b/c'], ['a-id', 'b-id', 'c-id'])
2798- tree.commit('init', rev_id='one')
2799+ tree.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
2800+ tree.commit('init', rev_id=b'one')
2801 self.tree = tree
2802
2803 def assertInventoryEqual(self, expected, args=None, **kwargs):
2804@@ -91,7 +91,7 @@
2805
2806 def test_inventory_revision(self):
2807 self.build_tree(['b/d', 'e'])
2808- self.tree.add(['b/d', 'e'], ['d-id', 'e-id'])
2809+ self.tree.add(['b/d', 'e'], [b'd-id', b'e-id'])
2810 self.tree.commit('add files')
2811
2812 self.tree.rename_one('b/d', 'd')
2813
2814=== modified file 'breezy/tests/blackbox/test_join.py'
2815--- breezy/tests/blackbox/test_join.py 2017-10-07 22:42:22 +0000
2816+++ breezy/tests/blackbox/test_join.py 2018-03-25 11:39:57 +0000
2817@@ -32,7 +32,7 @@
2818 base_tree.commit('empty commit')
2819 self.build_tree(['tree/subtree/', 'tree/subtree/file1'])
2820 sub_tree = self.make_branch_and_tree('tree/subtree')
2821- sub_tree.add('file1', 'file1-id')
2822+ sub_tree.add('file1', b'file1-id')
2823 sub_tree.commit('added file1')
2824 return base_tree, sub_tree
2825
2826
2827=== modified file 'breezy/tests/blackbox/test_link_tree.py'
2828--- breezy/tests/blackbox/test_link_tree.py 2017-08-27 02:13:50 +0000
2829+++ breezy/tests/blackbox/test_link_tree.py 2018-03-25 11:39:57 +0000
2830@@ -37,8 +37,8 @@
2831 self.parent_tree = self.make_branch_and_tree('parent')
2832 self.parent_tree.lock_write()
2833 self.addCleanup(self.parent_tree.unlock)
2834- self.build_tree_contents([('parent/foo', 'bar')])
2835- self.parent_tree.add('foo', 'foo-id')
2836+ self.build_tree_contents([('parent/foo', b'bar')])
2837+ self.parent_tree.add('foo', b'foo-id')
2838 self.parent_tree.commit('added foo')
2839 child_controldir = self.parent_tree.controldir.sprout('child')
2840 self.child_tree = child_controldir.open_workingtree()
2841
2842=== modified file 'breezy/tests/blackbox/test_locale.py'
2843--- breezy/tests/blackbox/test_locale.py 2017-05-21 18:10:28 +0000
2844+++ breezy/tests/blackbox/test_locale.py 2018-03-25 11:39:57 +0000
2845@@ -35,7 +35,7 @@
2846 tree = self.make_branch_and_tree('tree')
2847 self.build_tree(['tree/a'])
2848 tree.add('a')
2849- tree.commit(u'Unicode \xb5 commit', rev_id='r1',
2850+ tree.commit(u'Unicode \xb5 commit', rev_id=b'r1',
2851 committer=u'\u062c\u0648\u062c\u0648'
2852 u' Meinel <juju@info.com>',
2853 timestamp=1156451297.96, timezone=0)
2854
2855=== modified file 'breezy/tests/blackbox/test_log.py'
2856--- breezy/tests/blackbox/test_log.py 2017-11-16 00:39:04 +0000
2857+++ breezy/tests/blackbox/test_log.py 2018-03-25 11:39:57 +0000
2858@@ -215,23 +215,23 @@
2859 # mainline
2860 builder.build_snapshot(None, [
2861 ('add', ('', 'root-id', 'directory', ''))],
2862- revision_id='1')
2863- builder.build_snapshot(['1'], [], revision_id='2')
2864+ revision_id=b'1')
2865+ builder.build_snapshot([b'1'], [], revision_id=b'2')
2866 # branch
2867- builder.build_snapshot(['1'], [], revision_id='1.1.1')
2868+ builder.build_snapshot([b'1'], [], revision_id=b'1.1.1')
2869 # merge branch into mainline
2870- builder.build_snapshot(['2', '1.1.1'], [], revision_id='3')
2871+ builder.build_snapshot([b'2', '1.1.1'], [], revision_id=b'3')
2872 # new commits in branch
2873- builder.build_snapshot(['1.1.1'], [], revision_id='1.1.2')
2874- builder.build_snapshot(['1.1.2'], [], revision_id='1.1.3')
2875+ builder.build_snapshot([b'1.1.1'], [], revision_id=b'1.1.2')
2876+ builder.build_snapshot([b'1.1.2'], [], revision_id=b'1.1.3')
2877 # merge branch into mainline
2878- builder.build_snapshot(['3', '1.1.3'], [], revision_id='4')
2879+ builder.build_snapshot([b'3', b'1.1.3'], [], revision_id=b'4')
2880 # merge mainline into branch
2881- builder.build_snapshot(['1.1.3', '4'], [], revision_id='1.1.4')
2882+ builder.build_snapshot([b'1.1.3', b'4'], [], revision_id=b'1.1.4')
2883 # merge branch into mainline
2884- builder.build_snapshot(['4', '1.1.4'], [], revision_id='5')
2885- builder.build_snapshot(['5'], [], revision_id='5.1.1')
2886- builder.build_snapshot(['5', '5.1.1'], [], revision_id='6')
2887+ builder.build_snapshot([b'4', b'1.1.4'], [], revision_id=b'5')
2888+ builder.build_snapshot([b'5'], [], revision_id=b'5.1.1')
2889+ builder.build_snapshot([b'5', b'5.1.1'], [], revision_id=b'6')
2890 builder.finish_series()
2891
2892 def test_n0(self):
2893@@ -287,16 +287,16 @@
2894 # | /
2895 # 5 -----/
2896 builder.build_snapshot(None, [
2897- ('add', ('', 'root-id', 'directory', ''))], revision_id='1')
2898- builder.build_snapshot(['1'], [], revision_id='2')
2899- builder.build_snapshot(['1'], [], revision_id='1.1.1')
2900- builder.build_snapshot(['2'], [], revision_id='2.1.1')
2901- builder.build_snapshot(['2', '1.1.1'], [], revision_id='3')
2902- builder.build_snapshot(['2.1.1'], [], revision_id='2.1.2')
2903- builder.build_snapshot(['2.1.1'], [], revision_id='2.2.1')
2904- builder.build_snapshot(['2.1.2', '2.2.1'], [], revision_id='2.1.3')
2905- builder.build_snapshot(['3', '2.1.3'], [], revision_id='4')
2906- builder.build_snapshot(['4', '2.1.2'], [], revision_id='5')
2907+ ('add', ('', b'root-id', 'directory', ''))], revision_id=b'1')
2908+ builder.build_snapshot(['1'], [], revision_id=b'2')
2909+ builder.build_snapshot(['1'], [], revision_id=b'1.1.1')
2910+ builder.build_snapshot(['2'], [], revision_id=b'2.1.1')
2911+ builder.build_snapshot(['2', '1.1.1'], [], revision_id=b'3')
2912+ builder.build_snapshot(['2.1.1'], [], revision_id=b'2.1.2')
2913+ builder.build_snapshot(['2.1.1'], [], revision_id=b'2.2.1')
2914+ builder.build_snapshot(['2.1.2', '2.2.1'], [], revision_id=b'2.1.3')
2915+ builder.build_snapshot(['3', '2.1.3'], [], revision_id=b'4')
2916+ builder.build_snapshot(['4', '2.1.2'], [], revision_id=b'5')
2917 builder.finish_series()
2918 return builder
2919
2920@@ -625,7 +625,7 @@
2921 self.wt_commit(level0, 'in branch level0')
2922
2923 level1 = level0.controldir.sprout('level1').open_workingtree()
2924- self.build_tree_contents([('level1/file2', 'hello\n')])
2925+ self.build_tree_contents([('level1/file2', b'hello\n')])
2926 self.wt_commit(level1, 'in branch level1')
2927 level0.merge_from_branch(level1.branch)
2928 self.wt_commit(level0, 'merge branch level1')
2929@@ -713,7 +713,7 @@
2930 def test_log_show_diff_non_ascii(self):
2931 # Smoke test for bug #328007 UnicodeDecodeError on 'log -p'
2932 message = u'Message with \xb5'
2933- body = 'Body with \xb5\n'
2934+ body = b'Body with \xb5\n'
2935 wt = self.make_branch_and_tree('.')
2936 self.build_tree_contents([('foo', body)])
2937 wt.add('foo')
2938@@ -759,7 +759,7 @@
2939 def create_branch(self):
2940 brz = self.run_bzr
2941 brz('init')
2942- self.build_tree_contents([('a', 'some stuff\n')])
2943+ self.build_tree_contents([('a', b'some stuff\n')])
2944 brz('add a')
2945 brz(['commit', '-m', self._message])
2946
2947@@ -850,7 +850,7 @@
2948 tree.add('file3')
2949 tree.commit('add file3')
2950 child_tree = tree.controldir.sprout('child').open_workingtree()
2951- self.build_tree_contents([('child/file2', 'hello')])
2952+ self.build_tree_contents([('child/file2', b'hello')])
2953 child_tree.commit(message='branch 1')
2954 tree.merge_from_branch(child_tree.branch)
2955 tree.commit(message='merge child branch')
2956@@ -943,7 +943,7 @@
2957 tree.add('dir1/file5')
2958 tree.commit('add file5')
2959 child_tree = tree.controldir.sprout('child').open_workingtree()
2960- self.build_tree_contents([('child/file2', 'hello')])
2961+ self.build_tree_contents([('child/file2', b'hello')])
2962 child_tree.commit(message='branch 1')
2963 tree.merge_from_branch(child_tree.branch)
2964 tree.commit(message='merge child branch')
2965@@ -990,8 +990,8 @@
2966 tree = self.make_branch_and_tree('')
2967 tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
2968 tree.add('')
2969- tree.commit('msg1', rev_id='rev1')
2970- tree.commit('msg2', rev_id='rev2')
2971+ tree.commit('msg1', rev_id=b'rev1')
2972+ tree.commit('msg2', rev_id=b'rev2')
2973
2974 def test_log_range(self):
2975 self.assertLogRevnos(["-r1..2"], ["2", "1"])
2976@@ -1072,7 +1072,7 @@
2977 def test_standard_log(self):
2978 self.setup_smart_server_with_call_log()
2979 t = self.make_branch_and_tree('branch')
2980- self.build_tree_contents([('branch/foo', 'thecontents')])
2981+ self.build_tree_contents([('branch/foo', b'thecontents')])
2982 t.add("foo")
2983 t.commit("message")
2984 self.reset_smart_call_log()
2985@@ -1089,7 +1089,7 @@
2986 def test_verbose_log(self):
2987 self.setup_smart_server_with_call_log()
2988 t = self.make_branch_and_tree('branch')
2989- self.build_tree_contents([('branch/foo', 'thecontents')])
2990+ self.build_tree_contents([('branch/foo', b'thecontents')])
2991 t.add("foo")
2992 t.commit("message")
2993 self.reset_smart_call_log()
2994@@ -1106,7 +1106,7 @@
2995 def test_per_file(self):
2996 self.setup_smart_server_with_call_log()
2997 t = self.make_branch_and_tree('branch')
2998- self.build_tree_contents([('branch/foo', 'thecontents')])
2999+ self.build_tree_contents([('branch/foo', b'thecontents')])
3000 t.add("foo")
3001 t.commit("message")
3002 self.reset_smart_call_log()
3003
3004=== modified file 'breezy/tests/blackbox/test_lookup_revision.py'
3005--- breezy/tests/blackbox/test_lookup_revision.py 2017-05-21 18:10:28 +0000
3006+++ breezy/tests/blackbox/test_lookup_revision.py 2018-03-25 11:39:57 +0000
3007@@ -25,7 +25,7 @@
3008 def test_lookup_revison_directory(self):
3009 """Test --directory option"""
3010 tree = self.make_branch_and_tree('a')
3011- tree.commit('This revision', rev_id='abcd')
3012+ tree.commit('This revision', rev_id=b'abcd')
3013 out, err = self.run_bzr(['lookup-revision', '-d', 'a', '1'])
3014 self.assertEqual('abcd\n', out)
3015 self.assertEqual('', err)
3016
3017=== modified file 'breezy/tests/blackbox/test_ls.py'
3018--- breezy/tests/blackbox/test_ls.py 2017-11-12 13:53:51 +0000
3019+++ breezy/tests/blackbox/test_ls.py 2018-03-25 11:39:57 +0000
3020@@ -33,8 +33,8 @@
3021
3022 self.wt = self.make_branch_and_tree('.')
3023 self.build_tree_contents([
3024- ('.bzrignore', '*.pyo\n'),
3025- ('a', 'hello\n'),
3026+ ('.bzrignore', b'*.pyo\n'),
3027+ ('a', b'hello\n'),
3028 ])
3029
3030 def ls_equals(self, value, args=None, recursive=True, working_dir=None):
3031@@ -97,7 +97,7 @@
3032
3033 def test_show_ids(self):
3034 self.build_tree(['subdir/'])
3035- self.wt.add(['a', 'subdir'], ['a-id', 'subdir-id'])
3036+ self.wt.add(['a', 'subdir'], [b'a-id', b'subdir-id'])
3037 self.ls_equals(
3038 '.bzrignore \n'
3039 'a a-id\n'
3040@@ -247,7 +247,7 @@
3041 def test_simple_ls(self):
3042 self.setup_smart_server_with_call_log()
3043 t = self.make_branch_and_tree('branch')
3044- self.build_tree_contents([('branch/foo', 'thecontents')])
3045+ self.build_tree_contents([('branch/foo', b'thecontents')])
3046 t.add("foo")
3047 t.commit("message")
3048 self.reset_smart_call_log()
3049
3050=== modified file 'breezy/tests/blackbox/test_merge.py'
3051--- breezy/tests/blackbox/test_merge.py 2018-03-12 04:40:40 +0000
3052+++ breezy/tests/blackbox/test_merge.py 2018-03-25 11:39:57 +0000
3053@@ -48,8 +48,8 @@
3054 def example_branch(self, path='.'):
3055 tree = self.make_branch_and_tree(path)
3056 self.build_tree_contents([
3057- (osutils.pathjoin(path, 'hello'), 'foo'),
3058- (osutils.pathjoin(path, 'goodbye'), 'baz')])
3059+ (osutils.pathjoin(path, 'hello'), b'foo'),
3060+ (osutils.pathjoin(path, 'goodbye'), b'baz')])
3061 tree.add('hello')
3062 tree.commit(message='setup')
3063 tree.add('goodbye')
3064@@ -66,13 +66,13 @@
3065 builder.build_snapshot(None,
3066 [('add', ('', 'root-id', 'directory', None)),
3067 ('add', ('fname', 'f-id', 'file', 'a\nb\nc\n'))],
3068- revision_id='rev1')
3069+ revision_id=b'rev1')
3070 builder.build_snapshot(['rev1'],
3071 [('modify', ('f-id', 'a\nB\nD\n'))],
3072- revision_id='rev2other')
3073+ revision_id=b'rev2other')
3074 other = builder.get_branch().controldir.sprout('other').open_branch()
3075 builder.build_snapshot(['rev1'],
3076- [('modify', ('f-id', 'a\nB\nC\n'))], revision_id='rev2this')
3077+ [('modify', ('f-id', 'a\nB\nC\n'))], revision_id=b'rev2this')
3078 tree = builder.get_branch().create_checkout('tree', lightweight=True)
3079 return tree, other
3080
3081@@ -85,10 +85,10 @@
3082 a_tree = self.example_branch('a')
3083 ancestor = a_tree.branch.revno()
3084 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3085- self.build_tree_contents([('b/goodbye', 'quux')])
3086+ self.build_tree_contents([('b/goodbye', b'quux')])
3087 b_tree.commit(message="more u's are always good")
3088
3089- self.build_tree_contents([('a/hello', 'quuux')])
3090+ self.build_tree_contents([('a/hello', b'quuux')])
3091 # We can't merge when there are in-tree changes
3092 self.run_bzr('merge ../b', retcode=3, working_dir='a')
3093 a = workingtree.WorkingTree.open('a')
3094@@ -195,17 +195,17 @@
3095 self.build_tree_contents([
3096 ('a/',),
3097 ('a/sub/',),
3098- ('a/sub/a.txt', 'hello\n'),
3099- ('a/b.txt', 'hello\n'),
3100- ('a/sub/c.txt', 'hello\n')])
3101+ ('a/sub/a.txt', b'hello\n'),
3102+ ('a/b.txt', b'hello\n'),
3103+ ('a/sub/c.txt', b'hello\n')])
3104 a_tree = self.make_branch_and_tree('a')
3105 a_tree.add(['sub', 'b.txt', 'sub/c.txt', 'sub/a.txt'])
3106 a_tree.commit(message='added a')
3107 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3108 self.build_tree_contents([
3109- ('a/sub/a.txt', 'hello\nthere\n'),
3110- ('a/b.txt', 'hello\nthere\n'),
3111- ('a/sub/c.txt', 'hello\nthere\n')])
3112+ ('a/sub/a.txt', b'hello\nthere\n'),
3113+ ('a/b.txt', b'hello\nthere\n'),
3114+ ('a/sub/c.txt', b'hello\nthere\n')])
3115 a_tree.commit(message='Added there')
3116 os.remove('a/sub/a.txt')
3117 os.remove('a/sub/c.txt')
3118@@ -213,9 +213,9 @@
3119 os.remove('a/b.txt')
3120 a_tree.commit(message='Removed a.txt')
3121 self.build_tree_contents([
3122- ('b/sub/a.txt', 'hello\nsomething\n'),
3123- ('b/b.txt', 'hello\nsomething\n'),
3124- ('b/sub/c.txt', 'hello\nsomething\n')])
3125+ ('b/sub/a.txt', b'hello\nsomething\n'),
3126+ ('b/b.txt', b'hello\nsomething\n'),
3127+ ('b/sub/c.txt', b'hello\nsomething\n')])
3128 b_tree.commit(message='Modified a.txt')
3129
3130 self.run_bzr('merge ../a/', retcode=1, working_dir='b')
3131@@ -310,15 +310,15 @@
3132 def test_merge_bundle(self):
3133 from breezy.testament import Testament
3134 tree_a = self.make_branch_and_tree('branch_a')
3135- self.build_tree_contents([('branch_a/a', 'hello')])
3136+ self.build_tree_contents([('branch_a/a', b'hello')])
3137 tree_a.add('a')
3138 tree_a.commit('message')
3139
3140 tree_b = tree_a.controldir.sprout('branch_b').open_workingtree()
3141- self.build_tree_contents([('branch_a/a', 'hey there')])
3142+ self.build_tree_contents([('branch_a/a', b'hey there')])
3143 tree_a.commit('message')
3144
3145- self.build_tree_contents([('branch_b/a', 'goodbye')])
3146+ self.build_tree_contents([('branch_b/a', b'goodbye')])
3147 tree_b.commit('message')
3148 self.run_bzr('bundle ../branch_a -o ../bundle', working_dir='branch_b')
3149 self.run_bzr('merge ../bundle', retcode=1, working_dir='branch_a')
3150@@ -370,7 +370,7 @@
3151 """It should not be possible to merge changes from a file which
3152 does not exist."""
3153 tree_a = self.make_branch_and_tree('tree_a')
3154- self.build_tree_contents([('tree_a/file', 'bar\n')])
3155+ self.build_tree_contents([('tree_a/file', b'bar\n')])
3156 tree_a.add(['file'])
3157 tree_a.commit('commit 1')
3158 self.run_bzr_error(('Path\(s\) do not exist: non/existing',),
3159@@ -378,13 +378,13 @@
3160
3161 def pullable_branch(self):
3162 tree_a = self.make_branch_and_tree('a')
3163- self.build_tree_contents([('a/file', 'bar\n')])
3164+ self.build_tree_contents([('a/file', b'bar\n')])
3165 tree_a.add(['file'])
3166 self.id1 = tree_a.commit('commit 1')
3167
3168 tree_b = self.make_branch_and_tree('b')
3169 tree_b.pull(tree_a.branch)
3170- self.build_tree_contents([('b/file', 'foo\n')])
3171+ self.build_tree_contents([('b/file', b'foo\n')])
3172 self.id2 = tree_b.commit('commit 2')
3173
3174 def test_merge_pull(self):
3175@@ -411,8 +411,8 @@
3176
3177 def test_merge_kind_change(self):
3178 tree_a = self.make_branch_and_tree('tree_a')
3179- self.build_tree_contents([('tree_a/file', 'content_1')])
3180- tree_a.add('file', 'file-id')
3181+ self.build_tree_contents([('tree_a/file', b'content_1')])
3182+ tree_a.add('file', b'file-id')
3183 tree_a.commit('added file')
3184 tree_b = tree_a.controldir.sprout('tree_b').open_workingtree()
3185 os.unlink('tree_a/file')
3186@@ -422,7 +422,7 @@
3187 self.assertEqual('directory', osutils.file_kind('tree_b/file'))
3188 tree_b.revert()
3189 self.assertEqual('file', osutils.file_kind('tree_b/file'))
3190- self.build_tree_contents([('tree_b/file', 'content_2')])
3191+ self.build_tree_contents([('tree_b/file', b'content_2')])
3192 tree_b.commit('content change')
3193 self.run_bzr('merge ../tree_a', retcode=1, working_dir='tree_b')
3194 self.assertEqual(tree_b.conflicts(),
3195@@ -439,10 +439,10 @@
3196 target = source.controldir.sprout('target').open_workingtree()
3197 self.build_tree(['source/a'])
3198 source.add('a')
3199- source.commit('Added a', rev_id='rev1')
3200+ source.commit('Added a', rev_id=b'rev1')
3201 self.build_tree(['source/b'])
3202 source.add('b')
3203- source.commit('Added b', rev_id='rev2')
3204+ source.commit('Added b', rev_id=b'rev2')
3205 target.commit('empty commit')
3206 self.write_directive('directive', source.branch, 'target', 'rev2',
3207 'rev1')
3208@@ -458,13 +458,13 @@
3209 base_revision_id=base_revision_id)
3210 if mangle_patch:
3211 md.patch = 'asdf\n'
3212- self.build_tree_contents([(filename, ''.join(md.to_lines()))])
3213+ self.build_tree_contents([(filename, b''.join(md.to_lines()))])
3214
3215 def test_directive_verify_warning(self):
3216 source = self.make_branch_and_tree('source')
3217 self.build_tree(['source/a'])
3218 source.add('a')
3219- source.commit('Added a', rev_id='rev1')
3220+ source.commit('Added a', rev_id=b'rev1')
3221 target = self.make_branch_and_tree('target')
3222 target.commit('empty commit')
3223 self.write_directive('directive', source.branch, 'target', 'rev1')
3224@@ -483,14 +483,14 @@
3225 branch_a = target.controldir.sprout('branch_a').open_workingtree()
3226 self.build_tree(['branch_a/file1'])
3227 branch_a.add('file1')
3228- branch_a.commit('added file1', rev_id='rev2a')
3229+ branch_a.commit('added file1', rev_id=b'rev2a')
3230 branch_b = target.controldir.sprout('branch_b').open_workingtree()
3231 self.build_tree(['branch_b/file2'])
3232 branch_b.add('file2')
3233- branch_b.commit('added file2', rev_id='rev2b')
3234+ branch_b.commit('added file2', rev_id=b'rev2b')
3235 branch_b.merge_from_branch(branch_a.branch)
3236 self.assertPathExists('branch_b/file1')
3237- branch_b.commit('merged branch_a', rev_id='rev3b')
3238+ branch_b.commit('merged branch_a', rev_id=b'rev3b')
3239
3240 # It works if the revid has an interger revno
3241 self.run_bzr('merge -d target -r revid:rev2a branch_a')
3242@@ -523,7 +523,7 @@
3243 for f in ('a', 'b', 'c', 'd'):
3244 self.build_tree(['source/'+f])
3245 source.add(f)
3246- source.commit('added '+f, rev_id='rev_'+f)
3247+ source.commit('added '+f, rev_id=b'rev_'+f)
3248 # target branch
3249 target = source.controldir.sprout('target', 'rev_a').open_workingtree()
3250 self.assertDirectoryContent('target', ['.bzr', 'a'])
3251@@ -541,14 +541,14 @@
3252
3253 def test_merge_criss_cross(self):
3254 tree_a = self.make_branch_and_tree('a')
3255- tree_a.commit('', rev_id='rev1')
3256+ tree_a.commit('', rev_id=b'rev1')
3257 tree_b = tree_a.controldir.sprout('b').open_workingtree()
3258- tree_a.commit('', rev_id='rev2a')
3259- tree_b.commit('', rev_id='rev2b')
3260+ tree_a.commit('', rev_id=b'rev2a')
3261+ tree_b.commit('', rev_id=b'rev2b')
3262 tree_a.merge_from_branch(tree_b.branch)
3263 tree_b.merge_from_branch(tree_a.branch)
3264- tree_a.commit('', rev_id='rev3a')
3265- tree_b.commit('', rev_id='rev3b')
3266+ tree_a.commit('', rev_id=b'rev3a')
3267+ tree_b.commit('', rev_id=b'rev3b')
3268 graph = tree_a.branch.repository.get_graph(tree_b.branch.repository)
3269 out, err = self.run_bzr(['merge', '-d', 'a', 'b'])
3270 self.assertContainsRe(err, 'Warning: criss-cross merge encountered.')
3271@@ -589,7 +589,7 @@
3272
3273 def test_no_remember_dont_set_submit(self):
3274 tree_a = self.make_branch_and_tree('a')
3275- self.build_tree_contents([('a/file', "a\n")])
3276+ self.build_tree_contents([('a/file', b"a\n")])
3277 tree_a.add('file')
3278 tree_a.commit('rev1')
3279 tree_b = tree_a.controldir.sprout('b').open_workingtree()
3280@@ -606,39 +606,39 @@
3281
3282 def test_weave_cherrypick(self):
3283 this_tree = self.make_branch_and_tree('this')
3284- self.build_tree_contents([('this/file', "a\n")])
3285+ self.build_tree_contents([('this/file', b"a\n")])
3286 this_tree.add('file')
3287 this_tree.commit('rev1')
3288 other_tree = this_tree.controldir.sprout('other').open_workingtree()
3289- self.build_tree_contents([('other/file', "a\nb\n")])
3290+ self.build_tree_contents([('other/file', b"a\nb\n")])
3291 other_tree.commit('rev2b')
3292- self.build_tree_contents([('other/file', "c\na\nb\n")])
3293+ self.build_tree_contents([('other/file', b"c\na\nb\n")])
3294 other_tree.commit('rev3b')
3295 self.run_bzr('merge --weave -d this other -r -2..-1')
3296 self.assertFileEqual('c\na\n', 'this/file')
3297
3298 def test_lca_merge_criss_cross(self):
3299 tree_a = self.make_branch_and_tree('a')
3300- self.build_tree_contents([('a/file', 'base-contents\n')])
3301+ self.build_tree_contents([('a/file', b'base-contents\n')])
3302 tree_a.add('file')
3303- tree_a.commit('', rev_id='rev1')
3304+ tree_a.commit('', rev_id=b'rev1')
3305 tree_b = tree_a.controldir.sprout('b').open_workingtree()
3306 self.build_tree_contents([('a/file',
3307- 'base-contents\nthis-contents\n')])
3308- tree_a.commit('', rev_id='rev2a')
3309+ b'base-contents\nthis-contents\n')])
3310+ tree_a.commit('', rev_id=b'rev2a')
3311 self.build_tree_contents([('b/file',
3312- 'base-contents\nother-contents\n')])
3313- tree_b.commit('', rev_id='rev2b')
3314+ b'base-contents\nother-contents\n')])
3315+ tree_b.commit('', rev_id=b'rev2b')
3316 tree_a.merge_from_branch(tree_b.branch)
3317 self.build_tree_contents([('a/file',
3318- 'base-contents\nthis-contents\n')])
3319+ b'base-contents\nthis-contents\n')])
3320 tree_a.set_conflicts(conflicts.ConflictList())
3321 tree_b.merge_from_branch(tree_a.branch)
3322 self.build_tree_contents([('b/file',
3323- 'base-contents\nother-contents\n')])
3324+ b'base-contents\nother-contents\n')])
3325 tree_b.set_conflicts(conflicts.ConflictList())
3326- tree_a.commit('', rev_id='rev3a')
3327- tree_b.commit('', rev_id='rev3b')
3328+ tree_a.commit('', rev_id=b'rev3a')
3329+ tree_b.commit('', rev_id=b'rev3b')
3330 out, err = self.run_bzr(['merge', '-d', 'a', 'b', '--lca'], retcode=1)
3331 self.assertFileEqual('base-contents\n<<<<<<< TREE\nthis-contents\n'
3332 '=======\nother-contents\n>>>>>>> MERGE-SOURCE\n',
3333@@ -648,7 +648,7 @@
3334 this_tree = self.make_branch_and_tree('this')
3335 this_tree.commit('rev1')
3336 other_tree = this_tree.controldir.sprout('other').open_workingtree()
3337- self.build_tree_contents([('other/file', 'new line')])
3338+ self.build_tree_contents([('other/file', b'new line')])
3339 other_tree.add('file')
3340 other_tree.commit('rev2a')
3341 this_tree.commit('rev2b')
3342@@ -686,15 +686,15 @@
3343 """
3344 # Make a source, sprout a target off it
3345 builder = self.make_branch_builder('source')
3346- builder.build_commit(message="Rev 1", rev_id='rev-1')
3347+ builder.build_commit(message="Rev 1", rev_id=b'rev-1')
3348 source = builder.get_branch()
3349 target_bzrdir = source.controldir.sprout('target')
3350 # Add a non-ancestry tag to source
3351- builder.build_commit(message="Rev 2a", rev_id='rev-2a')
3352+ builder.build_commit(message="Rev 2a", rev_id=b'rev-2a')
3353 source.tags.set_tag('tag-a', 'rev-2a')
3354 source.set_last_revision_info(1, 'rev-1')
3355 source.get_config_stack().set('branch.fetch_tags', True)
3356- builder.build_commit(message="Rev 2b", rev_id='rev-2b')
3357+ builder.build_commit(message="Rev 2b", rev_id=b'rev-2b')
3358 # Merge from source
3359 self.run_bzr('merge -d target source')
3360 target = target_bzrdir.open_branch()
3361@@ -728,7 +728,7 @@
3362 source = self.make_branch_and_tree('source')
3363 self.build_tree(['source/a'])
3364 source.add('a')
3365- source.commit('Added a', rev_id='rev1')
3366+ source.commit('Added a', rev_id=b'rev1')
3367 target = self.make_branch_and_tree('target')
3368 self.run_script("""\
3369 $ brz merge -d target source
3370@@ -744,7 +744,7 @@
3371 self.tree_a.add(['foo'])
3372 self.tree_a.commit('add file')
3373 self.tree_b = self.tree_a.controldir.sprout('b').open_workingtree()
3374- self.build_tree_contents([('a/foo', 'change 1')])
3375+ self.build_tree_contents([('a/foo', b'change 1')])
3376 self.tree_a.commit('change file')
3377 self.tree_b.merge_from_branch(self.tree_a.branch)
3378
3379
3380=== modified file 'breezy/tests/blackbox/test_merge_directive.py'
3381--- breezy/tests/blackbox/test_merge_directive.py 2017-06-10 00:17:06 +0000
3382+++ breezy/tests/blackbox/test_merge_directive.py 2018-03-25 11:39:57 +0000
3383@@ -43,14 +43,14 @@
3384
3385 def prepare_merge_directive(self):
3386 self.tree1 = self.make_branch_and_tree('tree1')
3387- self.build_tree_contents([('tree1/file', 'a\nb\nc\nd\n')])
3388+ self.build_tree_contents([('tree1/file', b'a\nb\nc\nd\n')])
3389 self.tree1.branch.get_config_stack().set(
3390 'email', 'J. Random Hacker <jrandom@example.com>')
3391 self.tree1.add('file')
3392- self.tree1.commit('foo', rev_id='foo-id')
3393+ self.tree1.commit('foo', rev_id=b'foo-id')
3394 self.tree2 = self.tree1.controldir.sprout('tree2').open_workingtree()
3395- self.build_tree_contents([('tree1/file', 'a\nb\nc\nd\ne\n')])
3396- self.tree1.commit('bar', rev_id='bar-id')
3397+ self.build_tree_contents([('tree1/file', b'a\nb\nc\nd\ne\n')])
3398+ self.tree1.commit('bar', rev_id=b'bar-id')
3399 os.chdir('tree1')
3400 return self.tree1, self.tree2
3401
3402@@ -155,7 +155,7 @@
3403
3404 def test_pull_raw(self):
3405 self.prepare_merge_directive()
3406- self.tree1.commit('baz', rev_id='baz-id')
3407+ self.tree1.commit('baz', rev_id=b'baz-id')
3408 md_text = self.run_bzr(['merge-directive', self.tree2.basedir,
3409 '-r', '2', self.tree1.basedir, '--plain'])[0]
3410 self.build_tree_contents([('../directive', md_text)])
3411@@ -167,7 +167,7 @@
3412 def test_pull_user_r(self):
3413 """If the user supplies -r, an error is emitted"""
3414 self.prepare_merge_directive()
3415- self.tree1.commit('baz', rev_id='baz-id')
3416+ self.tree1.commit('baz', rev_id=b'baz-id')
3417 md_text = self.run_bzr(['merge-directive', self.tree2.basedir,
3418 self.tree1.basedir, '--plain'])[0]
3419 self.build_tree_contents([('../directive', md_text)])
3420@@ -178,7 +178,7 @@
3421
3422 def test_pull_bundle(self):
3423 self.prepare_merge_directive()
3424- self.tree1.commit('baz', rev_id='baz-id')
3425+ self.tree1.commit('baz', rev_id=b'baz-id')
3426 md_text = self.run_bzr(['merge-directive', self.tree2.basedir,
3427 '-r', '2', '/dev/null', '--bundle'])[0]
3428 self.build_tree_contents([('../directive', md_text)])
3429@@ -189,7 +189,7 @@
3430
3431 def test_merge_raw(self):
3432 self.prepare_merge_directive()
3433- self.tree1.commit('baz', rev_id='baz-id')
3434+ self.tree1.commit('baz', rev_id=b'baz-id')
3435 md_text = self.run_bzr(['merge-directive', self.tree2.basedir,
3436 '-r', '2', self.tree1.basedir, '--plain'])[0]
3437 self.build_tree_contents([('../directive', md_text)])
3438@@ -201,7 +201,7 @@
3439 def test_merge_user_r(self):
3440 """If the user supplies -r, an error is emitted"""
3441 self.prepare_merge_directive()
3442- self.tree1.commit('baz', rev_id='baz-id')
3443+ self.tree1.commit('baz', rev_id=b'baz-id')
3444 md_text = self.run_bzr(['merge-directive', self.tree2.basedir,
3445 self.tree1.basedir, '--plain'])[0]
3446 self.build_tree_contents([('../directive', md_text)])
3447@@ -212,7 +212,7 @@
3448
3449 def test_merge_bundle(self):
3450 self.prepare_merge_directive()
3451- self.tree1.commit('baz', rev_id='baz-id')
3452+ self.tree1.commit('baz', rev_id=b'baz-id')
3453 md_text = self.run_bzr(['merge-directive', self.tree2.basedir,
3454 '-r', '2', '/dev/null', '--bundle'])[0]
3455 self.build_tree_contents([('../directive', md_text)])
3456
3457=== modified file 'breezy/tests/blackbox/test_missing.py'
3458--- breezy/tests/blackbox/test_missing.py 2017-11-12 13:53:51 +0000
3459+++ breezy/tests/blackbox/test_missing.py 2018-03-25 11:39:57 +0000
3460@@ -38,7 +38,7 @@
3461 # XXX: This still needs a test that missing is quiet when there are
3462 # missing revisions.
3463 a_tree = self.make_branch_and_tree('.')
3464- self.build_tree_contents([('a', 'initial\n')])
3465+ self.build_tree_contents([('a', b'initial\n')])
3466 a_tree.add('a')
3467 a_tree.commit(message='initial')
3468
3469@@ -52,13 +52,13 @@
3470
3471 # create a source branch
3472 a_tree = self.make_branch_and_tree('a')
3473- self.build_tree_contents([('a/a', 'initial\n')])
3474+ self.build_tree_contents([('a/a', b'initial\n')])
3475 a_tree.add('a')
3476 a_tree.commit(message='initial')
3477
3478 # clone and add a differing revision
3479 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3480- self.build_tree_contents([('b/a', 'initial\nmore\n')])
3481+ self.build_tree_contents([('b/a', b'initial\nmore\n')])
3482 b_tree.commit(message='more')
3483
3484 def run_missing(args, retcode=1, working_dir=None):
3485@@ -160,7 +160,7 @@
3486 def test_missing_filtered(self):
3487 # create a source branch
3488 a_tree = self.make_branch_and_tree('a')
3489- self.build_tree_contents([('a/a', 'initial\n')])
3490+ self.build_tree_contents([('a/a', b'initial\n')])
3491 a_tree.add('a')
3492 a_tree.commit(message='r1')
3493 # clone and add differing revisions
3494@@ -221,13 +221,13 @@
3495
3496 # create a source branch
3497 a_tree = self.make_branch_and_tree('a')
3498- self.build_tree_contents([('a/a', 'initial\n')])
3499+ self.build_tree_contents([('a/a', b'initial\n')])
3500 a_tree.add('a')
3501 a_tree.commit(message='initial')
3502
3503 # clone and add a differing revision
3504 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3505- self.build_tree_contents([('b/a', 'initial\nmore\n')])
3506+ self.build_tree_contents([('b/a', b'initial\nmore\n')])
3507 b_tree.commit(message='more')
3508
3509 out2, err2 = self.run_bzr('missing --directory a b', retcode=1)
3510@@ -240,13 +240,13 @@
3511
3512 # create a source branch
3513 a_tree = self.make_branch_and_tree('a')
3514- self.build_tree_contents([('a/a', 'initial\n')])
3515+ self.build_tree_contents([('a/a', b'initial\n')])
3516 a_tree.add('a')
3517 a_tree.commit(message='initial')
3518
3519 # clone and add a differing revision
3520 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3521- self.build_tree_contents([('b/a', 'initial\nmore\n')])
3522+ self.build_tree_contents([('b/a', b'initial\nmore\n')])
3523 b_tree.commit(message='more')
3524 b_tree.branch.tags.set_tag('a-tag', b_tree.last_revision())
3525
3526
3527=== modified file 'breezy/tests/blackbox/test_modified.py'
3528--- breezy/tests/blackbox/test_modified.py 2017-05-21 18:10:28 +0000
3529+++ breezy/tests/blackbox/test_modified.py 2018-03-25 11:39:57 +0000
3530@@ -48,7 +48,7 @@
3531 check_modified('')
3532
3533 # with unknown file, still nothing modified
3534- self.build_tree_contents([(name, 'contents of %s\n' % (name))])
3535+ self.build_tree_contents([(name, b'contents of %s\n' % (name))])
3536 check_modified('')
3537
3538 # after add, not modified
3539@@ -60,7 +60,7 @@
3540 check_modified('')
3541
3542 # modify the file
3543- self.build_tree_contents([(name, 'changed\n')])
3544+ self.build_tree_contents([(name, b'changed\n')])
3545 check_modified(output + '\n')
3546
3547 # check null seps - use the unquoted raw name here
3548@@ -76,6 +76,6 @@
3549 self.build_tree(['a/README'])
3550 tree.add('README')
3551 tree.commit('r1')
3552- self.build_tree_contents([('a/README', 'changed\n')])
3553+ self.build_tree_contents([('a/README', b'changed\n')])
3554 out, err = self.run_bzr(['modified', '--directory=a'])
3555 self.assertEqual('README\n', out)
3556
3557=== modified file 'breezy/tests/blackbox/test_mv.py'
3558--- breezy/tests/blackbox/test_mv.py 2018-02-15 19:38:33 +0000
3559+++ breezy/tests/blackbox/test_mv.py 2018-03-25 11:39:57 +0000
3560@@ -196,7 +196,7 @@
3561 self.build_tree(['a/', 'a/b'])
3562 os.symlink('a', 'c')
3563 os.symlink('.', 'd')
3564- tree.add(['a', 'a/b', 'c'], ['a-id', 'b-id', 'c-id'])
3565+ tree.add(['a', 'a/b', 'c'], [b'a-id', b'b-id', b'c-id'])
3566 self.run_bzr('mv c/b b')
3567 tree = workingtree.WorkingTree.open('.')
3568 self.assertEqual('b-id', tree.path2id('b'))
3569
3570=== modified file 'breezy/tests/blackbox/test_non_ascii.py'
3571--- breezy/tests/blackbox/test_non_ascii.py 2017-06-10 00:17:06 +0000
3572+++ breezy/tests/blackbox/test_non_ascii.py 2018-03-25 11:39:57 +0000
3573@@ -115,17 +115,17 @@
3574
3575 def create_base(self):
3576 wt = self.make_branch_and_tree('.')
3577- self.build_tree_contents([('a', 'foo\n')])
3578+ self.build_tree_contents([('a', b'foo\n')])
3579 wt.add('a')
3580 wt.commit('adding a')
3581
3582 self.build_tree_contents(
3583- [('b', 'non-ascii \xFF\xFF\xFC\xFB\x00 in b\n')])
3584+ [('b', b'non-ascii \xFF\xFF\xFC\xFB\x00 in b\n')])
3585 wt.add('b')
3586 wt.commit(self.info['message'])
3587
3588 fname = self.info['filename']
3589- self.build_tree_contents([(fname, 'unicode filename\n')])
3590+ self.build_tree_contents([(fname, b'unicode filename\n')])
3591 wt.add(fname)
3592 wt.commit(u'And a unicode file\n')
3593 self.wt = wt
3594@@ -137,7 +137,7 @@
3595
3596 def test_status(self):
3597 self.build_tree_contents(
3598- [(self.info['filename'], 'changed something\n')])
3599+ [(self.info['filename'], b'changed something\n')])
3600 txt = self.run_bzr_decode('status')
3601 self._check_OSX_can_roundtrip(self.info['filename'])
3602 self.assertEqual(u'modified:\n %s\n' % (self.info['filename'],), txt)
3603@@ -259,7 +259,7 @@
3604 out_bzrdir.sprout(url2)
3605
3606 self.build_tree_contents(
3607- [(osutils.pathjoin(dirname1, "a"), 'different text\n')])
3608+ [(osutils.pathjoin(dirname1, "a"), b'different text\n')])
3609 self.wt.commit('mod a')
3610
3611 txt = self.run_bzr_decode('pull', working_dir=dirname2)
3612@@ -269,7 +269,7 @@
3613 'No revisions or tags to pull.\n' % (expected,), txt)
3614
3615 self.build_tree_contents(
3616- [(osutils.pathjoin(dirname1, 'a'), 'and yet more\n')])
3617+ [(osutils.pathjoin(dirname1, 'a'), b'and yet more\n')])
3618 self.wt.commit(u'modifying a by ' + self.info['committer'])
3619
3620 # We should be able to pull, even if our encoding is bad
3621@@ -288,14 +288,14 @@
3622 dirname = self.info['directory']
3623 self.run_bzr_decode(['push', dirname])
3624
3625- self.build_tree_contents([('a', 'adding more text\n')])
3626+ self.build_tree_contents([('a', b'adding more text\n')])
3627 self.wt.commit('added some stuff')
3628
3629 # TODO: check the output text is properly encoded
3630 self.run_bzr_decode('push')
3631
3632 self.build_tree_contents(
3633- [('a', 'and a bit more: \n%s\n' % (dirname.encode('utf-8'),))])
3634+ [('a', b'and a bit more: \n%s\n' % (dirname.encode('utf-8'),))])
3635
3636 self.wt.commit('Added some ' + dirname)
3637 self.run_bzr_decode('push --verbose', encoding='ascii')
3638@@ -372,7 +372,7 @@
3639 # TODO: jam 20060106 diff is a difficult one to test, because it
3640 # shouldn't encode the file contents, but it needs some sort
3641 # of encoding for the paths, etc which are displayed.
3642- self.build_tree_contents([(self.info['filename'], 'newline\n')])
3643+ self.build_tree_contents([(self.info['filename'], b'newline\n')])
3644 txt = self.run_bzr('diff', retcode=1)[0]
3645
3646 def test_deleted(self):
3647@@ -394,7 +394,7 @@
3648
3649 def test_modified(self):
3650 fname = self.info['filename']
3651- self.build_tree_contents([(fname, 'modified\n')])
3652+ self.build_tree_contents([(fname, b'modified\n')])
3653
3654 txt = self.run_bzr_decode('modified')
3655 self._check_OSX_can_roundtrip(self.info['filename'])
3656@@ -404,7 +404,7 @@
3657
3658 def test_added(self):
3659 fname = self.info['filename'] + '2'
3660- self.build_tree_contents([(fname, 'added\n')])
3661+ self.build_tree_contents([(fname, b'added\n')])
3662 self.wt.add(fname)
3663
3664 txt = self.run_bzr_decode('added')
3665@@ -474,7 +474,7 @@
3666
3667 def test_unknowns(self):
3668 fname = self.info['filename'] + '2'
3669- self.build_tree_contents([(fname, 'unknown\n')])
3670+ self.build_tree_contents([(fname, b'unknown\n')])
3671
3672 # TODO: jam 20060112 brz unknowns is the only one which
3673 # quotes paths do we really want it to?
3674@@ -487,7 +487,7 @@
3675
3676 def test_ignore(self):
3677 fname2 = self.info['filename'] + '2.txt'
3678- self.build_tree_contents([(fname2, 'ignored\n')])
3679+ self.build_tree_contents([(fname2, b'ignored\n')])
3680
3681 def check_unknowns(expected):
3682 self.assertEqual(expected, list(self.wt.unknowns()))
3683@@ -499,7 +499,7 @@
3684 check_unknowns([])
3685
3686 fname3 = self.info['filename'] + '3.txt'
3687- self.build_tree_contents([(fname3, 'unknown 3\n')])
3688+ self.build_tree_contents([(fname3, b'unknown 3\n')])
3689 check_unknowns([fname3])
3690
3691 # Ignore should not care what the encoding is
3692@@ -509,7 +509,7 @@
3693
3694 # Now try a wildcard match
3695 fname4 = self.info['filename'] + '4.txt'
3696- self.build_tree_contents([(fname4, 'unknown 4\n')])
3697+ self.build_tree_contents([(fname4, b'unknown 4\n')])
3698 self.run_bzr_decode('ignore *.txt')
3699 check_unknowns([])
3700
3701@@ -541,7 +541,7 @@
3702
3703 def test_ignored(self):
3704 fname = self.info['filename'] + '1.txt'
3705- self.build_tree_contents([(fname, 'ignored\n')])
3706+ self.build_tree_contents([(fname, b'ignored\n')])
3707 self.run_bzr(['ignore', fname])
3708 txt = self.run_bzr_decode(['ignored'])
3709 self.assertEqual(txt, '%-50s %s\n' % (fname, fname))
3710
3711=== modified file 'breezy/tests/blackbox/test_pack.py'
3712--- breezy/tests/blackbox/test_pack.py 2017-06-10 00:17:06 +0000
3713+++ breezy/tests/blackbox/test_pack.py 2018-03-25 11:39:57 +0000
3714@@ -90,7 +90,7 @@
3715 def test_simple_pack(self):
3716 self.setup_smart_server_with_call_log()
3717 t = self.make_branch_and_tree('branch')
3718- self.build_tree_contents([('branch/foo', 'thecontents')])
3719+ self.build_tree_contents([('branch/foo', b'thecontents')])
3720 t.add("foo")
3721 t.commit("message")
3722 self.reset_smart_call_log()
3723
3724=== modified file 'breezy/tests/blackbox/test_ping.py'
3725--- breezy/tests/blackbox/test_ping.py 2017-05-21 18:10:28 +0000
3726+++ breezy/tests/blackbox/test_ping.py 2018-03-25 11:39:57 +0000
3727@@ -25,7 +25,7 @@
3728 def test_simple_ping(self):
3729 self.setup_smart_server_with_call_log()
3730 t = self.make_branch_and_tree('branch')
3731- self.build_tree_contents([('branch/foo', 'thecontents')])
3732+ self.build_tree_contents([('branch/foo', b'thecontents')])
3733 t.add("foo")
3734 t.commit("message")
3735 self.reset_smart_call_log()
3736
3737=== modified file 'breezy/tests/blackbox/test_pull.py'
3738--- breezy/tests/blackbox/test_pull.py 2017-11-12 13:53:51 +0000
3739+++ breezy/tests/blackbox/test_pull.py 2018-03-25 11:39:57 +0000
3740@@ -45,8 +45,8 @@
3741 def example_branch(self, path='.'):
3742 tree = self.make_branch_and_tree(path)
3743 self.build_tree_contents([
3744- (osutils.pathjoin(path, 'hello'), 'foo'),
3745- (osutils.pathjoin(path, 'goodbye'), 'baz')])
3746+ (osutils.pathjoin(path, 'hello'), b'foo'),
3747+ (osutils.pathjoin(path, 'goodbye'), b'baz')])
3748 tree.add('hello')
3749 tree.commit(message='setup')
3750 tree.add('goodbye')
3751@@ -120,8 +120,8 @@
3752 """Pull some changes from one branch to another."""
3753 a_tree = self.example_branch('a')
3754 self.build_tree_contents([
3755- ('a/hello2', 'foo'),
3756- ('a/goodbye2', 'baz')])
3757+ ('a/hello2', b'foo'),
3758+ ('a/goodbye2', b'baz')])
3759 a_tree.add('hello2')
3760 a_tree.commit(message="setup")
3761 a_tree.add('goodbye2')
3762@@ -161,16 +161,16 @@
3763 # even if the target branch has merged
3764 # everything already.
3765 a_tree = self.make_branch_and_tree('a')
3766- self.build_tree_contents([('a/foo', 'original\n')])
3767+ self.build_tree_contents([('a/foo', b'original\n')])
3768 a_tree.add('foo')
3769 a_tree.commit(message='initial commit')
3770
3771 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3772
3773- self.build_tree_contents([('a/foo', 'changed\n')])
3774+ self.build_tree_contents([('a/foo', b'changed\n')])
3775 a_tree.commit(message='later change')
3776
3777- self.build_tree_contents([('a/foo', 'a third change')])
3778+ self.build_tree_contents([('a/foo', b'a third change')])
3779 a_tree.commit(message='a third change')
3780
3781 self.assertEqual(a_tree.branch.last_revision_info()[0], 3)
3782@@ -189,16 +189,16 @@
3783 # Make sure pull --overwrite sets the revision-history
3784 # to be identical to the pull source, even if we have convergence
3785 a_tree = self.make_branch_and_tree('a')
3786- self.build_tree_contents([('a/foo', 'original\n')])
3787+ self.build_tree_contents([('a/foo', b'original\n')])
3788 a_tree.add('foo')
3789 a_tree.commit(message='initial commit')
3790
3791 b_tree = a_tree.controldir.sprout('b').open_workingtree()
3792
3793- self.build_tree_contents([('a/foo', 'changed\n')])
3794+ self.build_tree_contents([('a/foo', b'changed\n')])
3795 a_tree.commit(message='later change')
3796
3797- self.build_tree_contents([('a/foo', 'a third change')])
3798+ self.build_tree_contents([('a/foo', b'a third change')])
3799 a_tree.commit(message='a third change')
3800
3801 self.assertEqual(a_tree.branch.last_revision_info()[0], 3)
3802@@ -208,7 +208,7 @@
3803
3804 self.assertEqual(b_tree.branch.last_revision_info()[0], 2)
3805
3806- self.build_tree_contents([('a/foo', 'a fourth change\n')])
3807+ self.build_tree_contents([('a/foo', b'a fourth change\n')])
3808 a_tree.commit(message='a fourth change')
3809
3810 rev_info_a = a_tree.branch.last_revision_info()
3811
3812=== modified file 'breezy/tests/blackbox/test_push.py'
3813--- breezy/tests/blackbox/test_push.py 2017-11-16 00:39:04 +0000
3814+++ breezy/tests/blackbox/test_push.py 2018-03-25 11:39:57 +0000
3815@@ -208,16 +208,16 @@
3816 tree_a = make_shared_tree('a')
3817 self.build_tree(['repo/a/file'])
3818 tree_a.add('file')
3819- tree_a.commit('commit a-1', rev_id='a-1')
3820+ tree_a.commit('commit a-1', rev_id=b'a-1')
3821 f = open('repo/a/file', 'ab')
3822 f.write('more stuff\n')
3823 f.close()
3824- tree_a.commit('commit a-2', rev_id='a-2')
3825+ tree_a.commit('commit a-2', rev_id=b'a-2')
3826
3827 tree_b = make_shared_tree('b')
3828 self.build_tree(['repo/b/file'])
3829 tree_b.add('file')
3830- tree_b.commit('commit b-1', rev_id='b-1')
3831+ tree_b.commit('commit b-1', rev_id=b'b-1')
3832
3833 self.assertTrue(shared_repo.has_revision('a-1'))
3834 self.assertTrue(shared_repo.has_revision('a-2'))
3835@@ -256,9 +256,9 @@
3836 source.start_series()
3837 source.build_snapshot(None, [
3838 ('add', ('', 'root-id', 'directory', None))],
3839- revision_id='A')
3840- source.build_snapshot(['A'], [], revision_id='B')
3841- source.build_snapshot(['A'], [], revision_id='C')
3842+ revision_id=b'A')
3843+ source.build_snapshot(['A'], [], revision_id=b'B')
3844+ source.build_snapshot(['A'], [], revision_id=b'C')
3845 source.finish_series()
3846 self.run_bzr('push target -d source')
3847 self.addCleanup(target_repo.lock_read().unlock)
3848@@ -363,8 +363,8 @@
3849 def create_simple_tree(self):
3850 tree = self.make_branch_and_tree('tree')
3851 self.build_tree(['tree/a'])
3852- tree.add(['a'], ['a-id'])
3853- tree.commit('one', rev_id='r1')
3854+ tree.add(['a'], [b'a-id'])
3855+ tree.commit('one', rev_id=b'r1')
3856 return tree
3857
3858 def test_push_create_prefix(self):
3859@@ -578,11 +578,11 @@
3860 builder.build_snapshot(None, [
3861 ('add', ('', 'root-id', 'directory', '')),
3862 ('add', ('filename', 'f-id', 'file', 'content\n'))],
3863- revision_id='rev-1')
3864- builder.build_snapshot(['rev-1'], [], revision_id='rev-2')
3865+ revision_id=b'rev-1')
3866+ builder.build_snapshot(['rev-1'], [], revision_id=b'rev-2')
3867 builder.build_snapshot(['rev-2'],
3868 [('modify', ('f-id', 'new-content\n'))],
3869- revision_id='rev-3')
3870+ revision_id=b'rev-3')
3871 builder.finish_series()
3872 branch = builder.get_branch()
3873 # Push rev-1 to "trunk", so that we can stack on it.
3874@@ -727,11 +727,11 @@
3875
3876 def make_local_branch_and_tree(self):
3877 self.tree = self.make_branch_and_tree('local')
3878- self.build_tree_contents([('local/file', 'initial')])
3879+ self.build_tree_contents([('local/file', b'initial')])
3880 self.tree.add('file')
3881- self.tree.commit('adding file', rev_id='added')
3882- self.build_tree_contents([('local/file', 'modified')])
3883- self.tree.commit('modify file', rev_id='modified')
3884+ self.tree.commit('adding file', rev_id=b'added')
3885+ self.build_tree_contents([('local/file', b'modified')])
3886+ self.tree.commit('modify file', rev_id=b'modified')
3887
3888 def set_config_push_strict(self, value):
3889 br = branch.Branch.open('local')
3890@@ -823,16 +823,16 @@
3891 def _uncommitted_changes(self):
3892 self.make_local_branch_and_tree()
3893 # Make a change without committing it
3894- self.build_tree_contents([('local/file', 'in progress')])
3895+ self.build_tree_contents([('local/file', b'in progress')])
3896
3897 def _pending_merges(self):
3898 self.make_local_branch_and_tree()
3899 # Create 'other' branch containing a new file
3900 other_bzrdir = self.tree.controldir.sprout('other')
3901 other_tree = other_bzrdir.open_workingtree()
3902- self.build_tree_contents([('other/other-file', 'other')])
3903+ self.build_tree_contents([('other/other-file', b'other')])
3904 other_tree.add('other-file')
3905- other_tree.commit('other commit', rev_id='other')
3906+ other_tree.commit('other commit', rev_id=b'other')
3907 # Merge and revert, leaving a pending merge
3908 self.tree.merge_from_branch(other_tree.branch)
3909 self.tree.revert(filenames=['other-file'], backups=False)
3910@@ -841,8 +841,8 @@
3911 self.make_local_branch_and_tree()
3912 self.run_bzr(['checkout', '--lightweight', 'local', 'checkout'])
3913 # Make a change and commit it
3914- self.build_tree_contents([('local/file', 'modified in local')])
3915- self.tree.commit('modify file', rev_id='modified-in-local')
3916+ self.build_tree_contents([('local/file', b'modified in local')])
3917+ self.tree.commit('modify file', rev_id=b'modified-in-local')
3918 # Exercise commands from the checkout directory
3919 self._default_wd = 'checkout'
3920 self._default_errors = ["Working tree is out of date, please run"
3921@@ -889,9 +889,9 @@
3922 builder = self.make_branch_builder(
3923 relpath, format=test_foreign.DummyForeignVcsDirFormat())
3924 builder.build_snapshot(None,
3925- [('add', ('', 'TREE_ROOT', 'directory', None)),
3926- ('add', ('foo', 'fooid', 'file', 'bar'))],
3927- revision_id='revid')
3928+ [('add', ('', b'TREE_ROOT', 'directory', None)),
3929+ ('add', ('foo', b'fooid', 'file', 'bar'))],
3930+ revision_id=b'revid')
3931 return builder
3932
3933 def test_no_roundtripping(self):
3934
3935=== modified file 'breezy/tests/blackbox/test_re_sign.py'
3936--- breezy/tests/blackbox/test_re_sign.py 2017-05-21 18:10:28 +0000
3937+++ breezy/tests/blackbox/test_re_sign.py 2018-03-25 11:39:57 +0000
3938@@ -40,9 +40,9 @@
3939
3940 def setup_tree(self):
3941 wt = ControlDir.create_standalone_workingtree('.')
3942- wt.commit("base A", allow_pointless=True, rev_id='A')
3943- wt.commit("base B", allow_pointless=True, rev_id='B')
3944- wt.commit("base C", allow_pointless=True, rev_id='C')
3945+ wt.commit("base A", allow_pointless=True, rev_id=b'A')
3946+ wt.commit("base B", allow_pointless=True, rev_id=b'B')
3947+ wt.commit("base C", allow_pointless=True, rev_id=b'C')
3948
3949 return wt
3950
3951@@ -90,9 +90,9 @@
3952 def test_resign_directory(self):
3953 """Test --directory option"""
3954 wt = ControlDir.create_standalone_workingtree('a')
3955- wt.commit("base A", allow_pointless=True, rev_id='A')
3956- wt.commit("base B", allow_pointless=True, rev_id='B')
3957- wt.commit("base C", allow_pointless=True, rev_id='C')
3958+ wt.commit("base A", allow_pointless=True, rev_id=b'A')
3959+ wt.commit("base B", allow_pointless=True, rev_id=b'B')
3960+ wt.commit("base C", allow_pointless=True, rev_id=b'C')
3961 repo = wt.branch.repository
3962 self.monkey_patch_gpg()
3963 self.run_bzr('re-sign --directory=a -r revid:A')
3964
3965=== modified file 'breezy/tests/blackbox/test_reconcile.py'
3966--- breezy/tests/blackbox/test_reconcile.py 2017-06-10 16:40:42 +0000
3967+++ breezy/tests/blackbox/test_reconcile.py 2018-03-25 11:39:57 +0000
3968@@ -50,7 +50,7 @@
3969 t = controldir.ControlDir.create_standalone_workingtree('.')
3970 # an empty inventory with no revision will trigger reconciliation.
3971 repo = t.branch.repository
3972- inv = inventory.Inventory(revision_id='missing')
3973+ inv = inventory.Inventory(revision_id=b'missing')
3974 inv.root.revision='missing'
3975 repo.lock_write()
3976 repo.start_write_group()
3977
3978=== modified file 'breezy/tests/blackbox/test_reconfigure.py'
3979--- breezy/tests/blackbox/test_reconfigure.py 2017-06-10 00:17:06 +0000
3980+++ breezy/tests/blackbox/test_reconfigure.py 2018-03-25 11:39:57 +0000
3981@@ -140,13 +140,13 @@
3982 self.assertNotEqual(branch.controldir.root_transport.base,
3983 branch.repository.controldir.root_transport.base)
3984 tree = workingtree.WorkingTree.open('repo/tree')
3985- self.build_tree_contents([('repo/tree/file', 'foo\n')]);
3986+ self.build_tree_contents([('repo/tree/file', b'foo\n')]);
3987 tree.add(['file'])
3988 tree.commit('added file')
3989 self.run_bzr('reconfigure --standalone', working_dir='repo/tree')
3990 tree = workingtree.WorkingTree.open('repo/tree')
3991- self.build_tree_contents([('repo/tree/file', 'bar\n')]);
3992- self.check_file_contents('repo/tree/file', 'bar\n')
3993+ self.build_tree_contents([('repo/tree/file', b'bar\n')]);
3994+ self.check_file_contents('repo/tree/file', b'bar\n')
3995 self.run_bzr('revert', working_dir='repo/tree')
3996 self.check_file_contents('repo/tree/file', 'foo\n')
3997 self.assertEqual(tree.controldir.root_transport.base,
3998@@ -165,13 +165,13 @@
3999 branch = self.make_branch('branch', format=format)
4000 checkout = branch.create_checkout('checkout', lightweight=True)
4001 tree = workingtree.WorkingTree.open('checkout')
4002- self.build_tree_contents([('checkout/file', 'foo\n')]);
4003+ self.build_tree_contents([('checkout/file', b'foo\n')]);
4004 tree.add(['file'])
4005 tree.commit('added file')
4006 self.run_bzr('reconfigure --tree', working_dir='checkout')
4007 tree = workingtree.WorkingTree.open('checkout')
4008- self.build_tree_contents([('checkout/file', 'bar\n')]);
4009- self.check_file_contents('checkout/file', 'bar\n')
4010+ self.build_tree_contents([('checkout/file', b'bar\n')]);
4011+ self.check_file_contents('checkout/file', b'bar\n')
4012 self.run_bzr('revert', working_dir='checkout')
4013 self.check_file_contents('checkout/file', 'foo\n')
4014
4015@@ -255,7 +255,7 @@
4016 # because that's most likely to work across different transports
4017 self.assertEqual('../b1', branch_2.get_stacked_on_url())
4018 # commit, and it should be stored into b2's repo
4019- self.build_tree_contents([('foo', 'new foo')])
4020+ self.build_tree_contents([('foo', b'new foo')])
4021 tree_2.commit('update foo')
4022 # Now turn it off again
4023 out, err = self.run_bzr('reconfigure --unstacked b2')
4024
4025=== modified file 'breezy/tests/blackbox/test_reference.py'
4026--- breezy/tests/blackbox/test_reference.py 2017-06-10 16:40:42 +0000
4027+++ breezy/tests/blackbox/test_reference.py 2018-03-25 11:39:57 +0000
4028@@ -43,7 +43,7 @@
4029 def make_tree_with_reference(self):
4030 tree = self.make_branch_and_tree('tree')
4031 self.build_tree(['tree/newpath'])
4032- tree.add('newpath', 'file-id')
4033+ tree.add('newpath', b'file-id')
4034 tree.branch.set_reference_info('file-id', 'path', 'http://example.org')
4035 tree.branch.set_reference_info('file-id2', 'lath',
4036 'http://example.org/2')
4037@@ -74,7 +74,7 @@
4038 def test_two_args_sets(self):
4039 tree = self.make_branch_and_tree('tree')
4040 self.build_tree(['tree/file'])
4041- tree.add('file', 'file-id')
4042+ tree.add('file', b'file-id')
4043 out, err = self.run_bzr('reference tree/file http://example.org')
4044 path, location = tree.branch.get_reference_info('file-id')
4045 self.assertEqual('http://example.org', location)
4046
4047=== modified file 'breezy/tests/blackbox/test_resolve.py'
4048--- breezy/tests/blackbox/test_resolve.py 2017-12-04 00:18:38 +0000
4049+++ breezy/tests/blackbox/test_resolve.py 2018-03-25 11:39:57 +0000
4050@@ -175,7 +175,7 @@
4051 """Text conflicts can be resolved automatically"""
4052 tree = self.make_branch_and_tree('tree')
4053 self.build_tree_contents([('tree/file',
4054- '<<<<<<<\na\n=======\n>>>>>>>\n')])
4055+ b'<<<<<<<\na\n=======\n>>>>>>>\n')])
4056 tree.add('file', 'file_id')
4057 self.assertEqual(tree.kind('file', 'file_id'), 'file')
4058 file_conflict = conflicts.TextConflict('file', file_id='file_id')
4059@@ -184,6 +184,6 @@
4060 self.assertContainsRe(note, '0 conflicts auto-resolved.')
4061 self.assertContainsRe(note,
4062 'Remaining conflicts:\nText conflict in file')
4063- self.build_tree_contents([('tree/file', 'a\n')])
4064+ self.build_tree_contents([('tree/file', b'a\n')])
4065 note = self.run_bzr('resolve', working_dir='tree')[1]
4066 self.assertContainsRe(note, 'All conflicts resolved.')
4067
4068=== modified file 'breezy/tests/blackbox/test_revert.py'
4069--- breezy/tests/blackbox/test_revert.py 2017-05-21 18:10:28 +0000
4070+++ breezy/tests/blackbox/test_revert.py 2018-03-25 11:39:57 +0000
4071@@ -197,7 +197,7 @@
4072 self.run_bzr(['revert', '--forget-merges'])
4073 self.build_tree(['file'])
4074 first_rev_id = tree.commit('initial commit')
4075- self.build_tree_contents([('file', 'new content')])
4076+ self.build_tree_contents([('file', b'new content')])
4077 existing_parents = tree.get_parent_ids()
4078 self.assertEqual([first_rev_id], existing_parents)
4079 merged_parents = existing_parents + ['merged-in-rev']
4080
4081=== modified file 'breezy/tests/blackbox/test_revision_history.py'
4082--- breezy/tests/blackbox/test_revision_history.py 2017-11-12 13:53:51 +0000
4083+++ breezy/tests/blackbox/test_revision_history.py 2018-03-25 11:39:57 +0000
4084@@ -28,13 +28,13 @@
4085 with open('test/foo', 'wb') as f:
4086 f.write('1111\n')
4087 tree.add('foo')
4088- tree.commit('added foo', rev_id='revision_1')
4089+ tree.commit('added foo', rev_id=b'revision_1')
4090 with open('test/foo', 'wb')as f:
4091 f.write('2222\n')
4092- tree.commit('updated foo', rev_id='revision_2')
4093+ tree.commit('updated foo', rev_id=b'revision_2')
4094 with open('test/foo', 'wb')as f:
4095 f.write('3333\n')
4096- tree.commit('updated foo again', rev_id='revision_3')
4097+ tree.commit('updated foo again', rev_id=b'revision_3')
4098 return tree
4099
4100 def _check_revision_history(self, location='', working_dir=None):
4101
4102=== modified file 'breezy/tests/blackbox/test_revision_info.py'
4103--- breezy/tests/blackbox/test_revision_info.py 2017-11-16 00:39:04 +0000
4104+++ breezy/tests/blackbox/test_revision_info.py 2018-03-25 11:39:57 +0000
4105@@ -36,11 +36,11 @@
4106 wt = self.make_branch_and_tree('.')
4107
4108 # Make history with a non-mainline rev
4109- wt.commit('Commit one', rev_id='a@r-0-1')
4110- wt.commit('Commit two', rev_id='a@r-0-1.1.1')
4111+ wt.commit('Commit one', rev_id=b'a@r-0-1')
4112+ wt.commit('Commit two', rev_id=b'a@r-0-1.1.1')
4113 wt.set_parent_ids(['a@r-0-1', 'a@r-0-1.1.1'])
4114 wt.branch.set_last_revision_info(1, 'a@r-0-1')
4115- wt.commit('Commit three', rev_id='a@r-0-2')
4116+ wt.commit('Commit three', rev_id=b'a@r-0-2')
4117
4118 # This is expected to work even if the working tree is removed
4119 wt.controldir.destroy_workingtree()
4120@@ -88,17 +88,17 @@
4121 """Test that 'brz revision-info' honors the '-d' option."""
4122 wt = self.make_branch_and_tree('branch')
4123
4124- wt.commit('Commit one', rev_id='a@r-0-1')
4125+ wt.commit('Commit one', rev_id=b'a@r-0-1')
4126 self.check_output('1 a@r-0-1\n', 'revision-info -d branch')
4127
4128 def test_revision_info_tree(self):
4129 # Make branch and checkout
4130 wt = self.make_branch_and_tree('branch')
4131- wt.commit('Commit one', rev_id='a@r-0-1')
4132+ wt.commit('Commit one', rev_id=b'a@r-0-1')
4133
4134 # Make checkout and move the branch forward
4135 wt.branch.create_checkout('checkout', lightweight=True)
4136- wt.commit('Commit two', rev_id='a@r-0-2')
4137+ wt.commit('Commit two', rev_id=b'a@r-0-2')
4138
4139 # Make sure the checkout gives the right answer for branch and
4140 # tree
4141@@ -120,9 +120,9 @@
4142 builder.start_series()
4143 builder.build_snapshot(None, [
4144 ('add', ('', 'root-id', 'directory', None))],
4145- revision_id='A-id')
4146- builder.build_snapshot(['A-id'], [], revision_id='B-id')
4147- builder.build_snapshot(['A-id'], [], revision_id='C-id')
4148+ revision_id=b'A-id')
4149+ builder.build_snapshot(['A-id'], [], revision_id=b'B-id')
4150+ builder.build_snapshot(['A-id'], [], revision_id=b'C-id')
4151 builder.finish_series()
4152 self.check_output(' 1 A-id\n??? B-id\n 2 C-id\n',
4153 'revision-info -d branch'
4154
4155=== modified file 'breezy/tests/blackbox/test_revno.py'
4156--- breezy/tests/blackbox/test_revno.py 2017-11-16 00:39:04 +0000
4157+++ breezy/tests/blackbox/test_revno.py 2018-03-25 11:39:57 +0000
4158@@ -86,13 +86,13 @@
4159 builder.build_snapshot(None, [
4160 ('add', ('', 'root-id', 'directory', None)),
4161 ('add', ('file', 'file-id', 'file', 'content\n'))],
4162- revision_id='A-id')
4163- builder.build_snapshot(['A-id'], [], revision_id='B-id')
4164- builder.build_snapshot(['A-id', 'B-id'], [], revision_id='C-id')
4165+ revision_id=b'A-id')
4166+ builder.build_snapshot(['A-id'], [], revision_id=b'B-id')
4167+ builder.build_snapshot(['A-id', 'B-id'], [], revision_id=b'C-id')
4168 builder.finish_series()
4169 b = builder.get_branch()
4170 co_b = b.create_checkout('checkout_b', lightweight=True,
4171- revision_id='B-id')
4172+ revision_id=b'B-id')
4173 out, err = self.run_bzr('revno checkout_b')
4174 self.assertEqual('', err)
4175 self.assertEqual('2\n', out)
4176@@ -104,17 +104,17 @@
4177 builder = self.make_branch_builder('branch')
4178 builder.start_series()
4179 builder.build_snapshot(None, [
4180- ('add', ('', 'root-id', 'directory', None)),
4181- ('add', ('file', 'file-id', 'file', 'content\n'))],
4182- revision_id='A-id')
4183- builder.build_snapshot(['A-id'], [], revision_id='B-id')
4184- builder.build_snapshot(['A-id'], [], revision_id='C-id')
4185+ ('add', ('', b'root-id', 'directory', None)),
4186+ ('add', ('file', b'file-id', 'file', 'content\n'))],
4187+ revision_id=b'A-id')
4188+ builder.build_snapshot(['A-id'], [], revision_id=b'B-id')
4189+ builder.build_snapshot(['A-id'], [], revision_id=b'C-id')
4190 builder.finish_series()
4191 b = builder.get_branch()
4192 # The branch is now at "C-id", but the checkout is still at "B-id"
4193 # which is no longer in the history
4194 co_b = b.create_checkout('checkout_b', lightweight=True,
4195- revision_id='B-id')
4196+ revision_id=b'B-id')
4197 out, err = self.run_bzr('revno checkout_b')
4198 self.assertEqual('', err)
4199 self.assertEqual('2\n', out)
4200@@ -147,7 +147,7 @@
4201 def test_simple_branch_revno(self):
4202 self.setup_smart_server_with_call_log()
4203 t = self.make_branch_and_tree('branch')
4204- self.build_tree_contents([('branch/foo', 'thecontents')])
4205+ self.build_tree_contents([('branch/foo', b'thecontents')])
4206 t.add("foo")
4207 revid = t.commit("message")
4208 self.reset_smart_call_log()
4209@@ -164,7 +164,7 @@
4210 def test_simple_branch_revno_lookup(self):
4211 self.setup_smart_server_with_call_log()
4212 t = self.make_branch_and_tree('branch')
4213- self.build_tree_contents([('branch/foo', 'thecontents')])
4214+ self.build_tree_contents([('branch/foo', b'thecontents')])
4215 t.add("foo")
4216 revid1 = t.commit("message")
4217 revid2 = t.commit("message")
4218
4219=== modified file 'breezy/tests/blackbox/test_rmbranch.py'
4220--- breezy/tests/blackbox/test_rmbranch.py 2017-06-10 00:17:06 +0000
4221+++ breezy/tests/blackbox/test_rmbranch.py 2018-03-25 11:39:57 +0000
4222@@ -30,10 +30,10 @@
4223
4224 def example_tree(self, path='.', format=None):
4225 tree = self.make_branch_and_tree(path, format=format)
4226- self.build_tree_contents([(path + '/hello', 'foo')])
4227+ self.build_tree_contents([(path + '/hello', b'foo')])
4228 tree.add('hello')
4229 tree.commit(message='setup')
4230- self.build_tree_contents([(path + '/goodbye', 'baz')])
4231+ self.build_tree_contents([(path + '/goodbye', b'baz')])
4232 tree.add('goodbye')
4233 tree.commit(message='setup')
4234 return tree
4235
4236=== modified file 'breezy/tests/blackbox/test_script.py'
4237--- breezy/tests/blackbox/test_script.py 2017-05-21 18:10:28 +0000
4238+++ breezy/tests/blackbox/test_script.py 2018-03-25 11:39:57 +0000
4239@@ -32,7 +32,7 @@
4240 self.run_bzr(['test-script', 'I-do-not-exist'], retcode=3)
4241
4242 def test_empty_file(self):
4243- self.build_tree_contents([('script', '')])
4244+ self.build_tree_contents([('script', b'')])
4245 out, err = self.run_bzr(['test-script', 'script'])
4246 out_lines = out.splitlines()
4247 self.assertStartsWith(out_lines[-3], 'Ran 1 test in ')
4248@@ -40,7 +40,7 @@
4249 self.assertEqual('', err)
4250
4251 def test_simple_file(self):
4252- self.build_tree_contents([('script', '''
4253+ self.build_tree_contents([('script', b'''
4254 $ echo hello world
4255 hello world
4256 ''')])
4257@@ -51,7 +51,7 @@
4258 self.assertEqual('', err)
4259
4260 def test_null_output(self):
4261- self.build_tree_contents([('script', '''
4262+ self.build_tree_contents([('script', b'''
4263 $ echo hello world
4264 ''')])
4265 out, err = self.run_bzr(['test-script', 'script', '--null-output'])
4266@@ -61,7 +61,7 @@
4267 self.assertEqual('', err)
4268
4269 def test_failing_script(self):
4270- self.build_tree_contents([('script', '''
4271+ self.build_tree_contents([('script', b'''
4272 $ echo hello foo
4273 hello bar
4274 ''')])
4275
4276=== modified file 'breezy/tests/blackbox/test_send.py'
4277--- breezy/tests/blackbox/test_send.py 2017-06-10 00:17:06 +0000
4278+++ breezy/tests/blackbox/test_send.py 2018-03-25 11:39:57 +0000
4279@@ -65,17 +65,17 @@
4280 super(TestSend, self).setUp()
4281 grandparent_tree = ControlDir.create_standalone_workingtree(
4282 'grandparent')
4283- self.build_tree_contents([('grandparent/file1', 'grandparent')])
4284+ self.build_tree_contents([('grandparent/file1', b'grandparent')])
4285 grandparent_tree.add('file1')
4286- grandparent_tree.commit('initial commit', rev_id='rev1')
4287+ grandparent_tree.commit('initial commit', rev_id=b'rev1')
4288
4289 parent_bzrdir = grandparent_tree.controldir.sprout('parent')
4290 parent_tree = parent_bzrdir.open_workingtree()
4291- parent_tree.commit('next commit', rev_id='rev2')
4292+ parent_tree.commit('next commit', rev_id=b'rev2')
4293
4294 branch_tree = parent_tree.controldir.sprout('branch').open_workingtree()
4295- self.build_tree_contents([('branch/file1', 'branch')])
4296- branch_tree.commit('last commit', rev_id='rev3')
4297+ self.build_tree_contents([('branch/file1', b'branch')])
4298+ branch_tree.commit('last commit', rev_id=b'rev3')
4299
4300 def assertFormatIs(self, fmt_string, md):
4301 self.assertEqual(fmt_string, md.get_raw_bundle().splitlines()[0])
4302@@ -276,14 +276,14 @@
4303 def make_parent_and_local_branches(self):
4304 # Create a 'parent' branch as the base
4305 self.parent_tree = ControlDir.create_standalone_workingtree('parent')
4306- self.build_tree_contents([('parent/file', 'parent')])
4307+ self.build_tree_contents([('parent/file', b'parent')])
4308 self.parent_tree.add('file')
4309- self.parent_tree.commit('first commit', rev_id='parent')
4310+ self.parent_tree.commit('first commit', rev_id=b'parent')
4311 # Branch 'local' from parent and do a change
4312 local_bzrdir = self.parent_tree.controldir.sprout('local')
4313 self.local_tree = local_bzrdir.open_workingtree()
4314- self.build_tree_contents([('local/file', 'local')])
4315- self.local_tree.commit('second commit', rev_id='local')
4316+ self.build_tree_contents([('local/file', b'local')])
4317+ self.local_tree.commit('second commit', rev_id=b'local')
4318
4319 _default_command = ['send', '-o-', '../parent']
4320 _default_wd = 'local'
4321@@ -380,16 +380,16 @@
4322 def _uncommitted_changes(self):
4323 self.make_parent_and_local_branches()
4324 # Make a change without committing it
4325- self.build_tree_contents([('local/file', 'modified')])
4326+ self.build_tree_contents([('local/file', b'modified')])
4327
4328 def _pending_merges(self):
4329 self.make_parent_and_local_branches()
4330 # Create 'other' branch containing a new file
4331 other_bzrdir = self.parent_tree.controldir.sprout('other')
4332 other_tree = other_bzrdir.open_workingtree()
4333- self.build_tree_contents([('other/other-file', 'other')])
4334+ self.build_tree_contents([('other/other-file', b'other')])
4335 other_tree.add('other-file')
4336- other_tree.commit('other commit', rev_id='other')
4337+ other_tree.commit('other commit', rev_id=b'other')
4338 # Merge and revert, leaving a pending merge
4339 self.local_tree.merge_from_branch(other_tree.branch)
4340 self.local_tree.revert(filenames=['other-file'], backups=False)
4341@@ -398,8 +398,8 @@
4342 self.make_parent_and_local_branches()
4343 self.run_bzr(['checkout', '--lightweight', 'local', 'checkout'])
4344 # Make a change and commit it
4345- self.build_tree_contents([('local/file', 'modified in local')])
4346- self.local_tree.commit('modify file', rev_id='modified-in-local')
4347+ self.build_tree_contents([('local/file', b'modified in local')])
4348+ self.local_tree.commit('modify file', rev_id=b'modified-in-local')
4349 # Exercise commands from the checkout directory
4350 self._default_wd = 'checkout'
4351 self._default_errors = ["Working tree is out of date, please run"
4352@@ -448,11 +448,11 @@
4353 def test_send(self):
4354 self.setup_smart_server_with_call_log()
4355 t = self.make_branch_and_tree('branch')
4356- self.build_tree_contents([('branch/foo', 'thecontents')])
4357+ self.build_tree_contents([('branch/foo', b'thecontents')])
4358 t.add("foo")
4359 t.commit("message")
4360 local = t.controldir.sprout('local-branch').open_workingtree()
4361- self.build_tree_contents([('branch/foo', 'thenewcontents')])
4362+ self.build_tree_contents([('branch/foo', b'thenewcontents')])
4363 local.commit("anothermessage")
4364 self.reset_smart_call_log()
4365 out, err = self.run_bzr(
4366
4367=== modified file 'breezy/tests/blackbox/test_serve.py'
4368--- breezy/tests/blackbox/test_serve.py 2017-08-26 13:58:53 +0000
4369+++ breezy/tests/blackbox/test_serve.py 2018-03-25 11:39:57 +0000
4370@@ -275,7 +275,7 @@
4371 # Save the config as the subprocess will use it
4372 gs.store.save()
4373 process, url = self.start_server_port()
4374- self.build_tree_contents([('a_file', 'contents\n')])
4375+ self.build_tree_contents([('a_file', b'contents\n')])
4376 # We can connect and issue a request
4377 t = transport.get_transport_from_url(url)
4378 self.assertEqual('contents\n', t.get_bytes('a_file'))
4379@@ -292,7 +292,7 @@
4380
4381 def test_bzr_serve_supports_client_timeout(self):
4382 process, url = self.start_server_port(['--client-timeout=0.1'])
4383- self.build_tree_contents([('a_file', 'contents\n')])
4384+ self.build_tree_contents([('a_file', b'contents\n')])
4385 # We can connect and issue a request
4386 t = transport.get_transport_from_url(url)
4387 self.assertEqual('contents\n', t.get_bytes('a_file'))
4388@@ -311,7 +311,7 @@
4389 self.assertServerFinishesCleanly(process)
4390
4391 def test_bzr_serve_graceful_shutdown(self):
4392- big_contents = 'a'*64*1024
4393+ big_contents = b'a'*64*1024
4394 self.build_tree_contents([('bigfile', big_contents)])
4395 process, url = self.start_server_port(['--client-timeout=1.0'])
4396 t = transport.get_transport_from_url(url)
4397
4398=== modified file 'breezy/tests/blackbox/test_shelve.py'
4399--- breezy/tests/blackbox/test_shelve.py 2017-05-21 18:10:28 +0000
4400+++ breezy/tests/blackbox/test_shelve.py 2018-03-25 11:39:57 +0000
4401@@ -145,10 +145,10 @@
4402 def test_directory(self):
4403 """Test --directory option"""
4404 tree = self.make_branch_and_tree('tree')
4405- self.build_tree_contents([('tree/a', 'initial\n')])
4406+ self.build_tree_contents([('tree/a', b'initial\n')])
4407 tree.add('a')
4408 tree.commit(message='committed')
4409- self.build_tree_contents([('tree/a', 'initial\nmore\n')])
4410+ self.build_tree_contents([('tree/a', b'initial\nmore\n')])
4411 self.run_bzr('shelve -d tree --all')
4412 self.assertFileEqual('initial\n', 'tree/a')
4413 self.run_bzr('unshelve --directory tree')
4414
4415=== modified file 'breezy/tests/blackbox/test_sign_my_commits.py'
4416--- breezy/tests/blackbox/test_sign_my_commits.py 2017-05-21 18:10:28 +0000
4417+++ breezy/tests/blackbox/test_sign_my_commits.py 2018-03-25 11:39:57 +0000
4418@@ -37,13 +37,13 @@
4419
4420 def setup_tree(self, location='.'):
4421 wt = self.make_branch_and_tree(location)
4422- wt.commit("base A", allow_pointless=True, rev_id='A')
4423- wt.commit("base B", allow_pointless=True, rev_id='B')
4424- wt.commit("base C", allow_pointless=True, rev_id='C')
4425- wt.commit("base D", allow_pointless=True, rev_id='D',
4426+ wt.commit("base A", allow_pointless=True, rev_id=b'A')
4427+ wt.commit("base B", allow_pointless=True, rev_id=b'B')
4428+ wt.commit("base C", allow_pointless=True, rev_id=b'C')
4429+ wt.commit("base D", allow_pointless=True, rev_id=b'D',
4430 committer='Alternate <alt@foo.com>')
4431 wt.add_parent_tree_id("aghost")
4432- wt.commit("base E", allow_pointless=True, rev_id='E')
4433+ wt.commit("base E", allow_pointless=True, rev_id=b'E')
4434 return wt
4435
4436 def assertUnsigned(self, repo, revision_id):
4437@@ -131,7 +131,7 @@
4438 def test_sign_single_commit(self):
4439 self.setup_smart_server_with_call_log()
4440 t = self.make_branch_and_tree('branch')
4441- self.build_tree_contents([('branch/foo', 'thecontents')])
4442+ self.build_tree_contents([('branch/foo', b'thecontents')])
4443 t.add("foo")
4444 t.commit("message")
4445 self.reset_smart_call_log()
4446
4447=== modified file 'breezy/tests/blackbox/test_split.py'
4448--- breezy/tests/blackbox/test_split.py 2017-11-12 13:53:51 +0000
4449+++ breezy/tests/blackbox/test_split.py 2018-03-25 11:39:57 +0000
4450@@ -36,7 +36,7 @@
4451 a_branch = repo.controldir.create_branch()
4452 self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d'])
4453 wt = a_branch.create_checkout('a', lightweight=True)
4454- wt.add(['b', 'b/c', 'b/c/d'], ['b-id', 'c-id', 'd-id'])
4455+ wt.add(['b', 'b/c', 'b/c/d'], [b'b-id', b'c-id', b'd-id'])
4456 wt.commit('added files')
4457 self.run_bzr_error(('must upgrade your branch at .*a',), 'split a/b')
4458
4459
4460=== modified file 'breezy/tests/blackbox/test_status.py'
4461--- breezy/tests/blackbox/test_status.py 2017-11-12 13:53:51 +0000
4462+++ breezy/tests/blackbox/test_status.py 2018-03-25 11:39:57 +0000
4463@@ -491,7 +491,7 @@
4464 def test_status_out_of_date(self):
4465 """Simulate status of out-of-date tree after remote push"""
4466 tree = self.make_branch_and_tree('.')
4467- self.build_tree_contents([('a', 'foo\n')])
4468+ self.build_tree_contents([('a', b'foo\n')])
4469 tree.lock_write()
4470 try:
4471 tree.add(['a'])
4472@@ -753,11 +753,11 @@
4473 def test_pending_specific_files(self):
4474 """With a specific file list, pending merges are not shown."""
4475 tree = self.make_branch_and_tree('tree')
4476- self.build_tree_contents([('tree/a', 'content of a\n')])
4477+ self.build_tree_contents([('tree/a', b'content of a\n')])
4478 tree.add('a')
4479 r1_id = tree.commit('one')
4480 alt = tree.controldir.sprout('alt').open_workingtree()
4481- self.build_tree_contents([('alt/a', 'content of a\nfrom alt\n')])
4482+ self.build_tree_contents([('alt/a', b'content of a\nfrom alt\n')])
4483 alt_id = alt.commit('alt')
4484 tree.merge_from_branch(alt.branch)
4485 output = self.make_utf8_encoded_stringio()
4486@@ -774,7 +774,7 @@
4487 working_tree = self.make_branch_and_tree(u'.')
4488 filename = u'hell\u00d8'
4489 try:
4490- self.build_tree_contents([(filename, 'contents of hello')])
4491+ self.build_tree_contents([(filename, b'contents of hello')])
4492 except UnicodeEncodeError:
4493 raise TestSkipped("can't build unicode working tree in "
4494 "filesystem encoding %s" % sys.getfilesystemencoding())
4495
4496=== modified file 'breezy/tests/blackbox/test_switch.py'
4497--- breezy/tests/blackbox/test_switch.py 2017-06-10 00:17:06 +0000
4498+++ breezy/tests/blackbox/test_switch.py 2018-03-25 11:39:57 +0000
4499@@ -317,7 +317,7 @@
4500 def test_create_branch(self):
4501 branch = self.make_branch('branch')
4502 tree = branch.create_checkout('tree', lightweight=True)
4503- tree.commit('one', rev_id='rev-1')
4504+ tree.commit('one', rev_id=b'rev-1')
4505 self.run_bzr('switch --create-branch ../branch2', working_dir='tree')
4506 tree = WorkingTree.open('tree')
4507 self.assertEndsWith(tree.branch.base, '/branch2/')
4508@@ -325,7 +325,7 @@
4509 def test_create_branch_local(self):
4510 branch = self.make_branch('branch')
4511 tree = branch.create_checkout('tree', lightweight=True)
4512- tree.commit('one', rev_id='rev-1')
4513+ tree.commit('one', rev_id=b'rev-1')
4514 self.run_bzr('switch --create-branch branch2', working_dir='tree')
4515 tree = WorkingTree.open('tree')
4516 # The new branch should have been created at the same level as
4517@@ -335,7 +335,7 @@
4518 def test_create_branch_short_name(self):
4519 branch = self.make_branch('branch')
4520 tree = branch.create_checkout('tree', lightweight=True)
4521- tree.commit('one', rev_id='rev-1')
4522+ tree.commit('one', rev_id=b'rev-1')
4523 self.run_bzr('switch -b branch2', working_dir='tree')
4524 tree = WorkingTree.open('tree')
4525 # The new branch should have been created at the same level as
4526@@ -385,13 +385,13 @@
4527
4528 # create a source branch
4529 a_tree = self.make_branch_and_tree('a')
4530- self.build_tree_contents([('a/a', 'initial\n')])
4531+ self.build_tree_contents([('a/a', b'initial\n')])
4532 a_tree.add('a')
4533 a_tree.commit(message='initial')
4534
4535 # clone and add a differing revision
4536 b_tree = a_tree.controldir.sprout('b').open_workingtree()
4537- self.build_tree_contents([('b/a', 'initial\nmore\n')])
4538+ self.build_tree_contents([('b/a', b'initial\nmore\n')])
4539 b_tree.commit(message='more')
4540
4541 self.run_bzr('checkout --lightweight a checkout')
4542
4543=== modified file 'breezy/tests/blackbox/test_tags.py'
4544--- breezy/tests/blackbox/test_tags.py 2017-06-10 00:17:06 +0000
4545+++ breezy/tests/blackbox/test_tags.py 2018-03-25 11:39:57 +0000
4546@@ -58,7 +58,7 @@
4547 def test_tag_current_rev(self):
4548 t = self.make_branch_and_tree('branch')
4549 t.commit(allow_pointless=True, message='initial commit',
4550- rev_id='first-revid')
4551+ rev_id=b'first-revid')
4552 # make a tag through the command line
4553 out, err = self.run_bzr('tag -d branch NEWTAG')
4554 self.assertContainsRe(err, 'Created tag NEWTAG.')
4555@@ -85,9 +85,9 @@
4556 def test_tag_same_revision(self):
4557 t = self.make_branch_and_tree('branch')
4558 t.commit(allow_pointless=True, message='initial commit',
4559- rev_id='first-revid')
4560+ rev_id=b'first-revid')
4561 t.commit(allow_pointless=True, message='second commit',
4562- rev_id='second-revid')
4563+ rev_id=b'second-revid')
4564 out, err = self.run_bzr('tag -rrevid:first-revid -d branch NEWTAG')
4565 out, err = self.run_bzr('tag -rrevid:first-revid -d branch NEWTAG')
4566 self.assertContainsRe(err,
4567@@ -103,7 +103,7 @@
4568 def test_branch_push_pull_merge_copies_tags(self):
4569 t = self.make_branch_and_tree('branch1')
4570 t.commit(allow_pointless=True, message='initial commit',
4571- rev_id='first-revid')
4572+ rev_id=b'first-revid')
4573 b1 = t.branch
4574 b1.tags.set_tag('tag1', 'first-revid')
4575 # branching copies the tag across
4576@@ -120,7 +120,7 @@
4577 self.assertEqual(b2.tags.lookup_tag('tag3'), 'san')
4578 # make a new tag and merge it
4579 t.commit(allow_pointless=True, message='second commit',
4580- rev_id='second-revid')
4581+ rev_id=b'second-revid')
4582 t2 = WorkingTree.open('branch2')
4583 t2.commit(allow_pointless=True, message='commit in second')
4584 b1.tags.set_tag('tag4', 'second-revid')
4585@@ -133,7 +133,7 @@
4586
4587 def make_master_and_checkout(self):
4588 builder = self.make_branch_builder('master')
4589- builder.build_commit(message='Initial commit.', rev_id='rev-1')
4590+ builder.build_commit(message='Initial commit.', rev_id=b'rev-1')
4591 master = builder.get_branch()
4592 child = master.create_checkout(self.get_url('child'))
4593 return master, child
4594@@ -142,9 +142,9 @@
4595 fork = branch.create_clone_on_transport(self.get_transport('fork'))
4596 self.addCleanup(fork.lock_write().unlock)
4597 with transform.TransformPreview(fork.basis_tree()) as tt:
4598- tt.commit(fork, message='Commit in fork.', revision_id='fork-0')
4599+ tt.commit(fork, message='Commit in fork.', revision_id=b'fork-0')
4600 with transform.TransformPreview(fork.basis_tree()) as tt:
4601- tt.commit(fork, message='Commit in fork.', revision_id='fork-1')
4602+ tt.commit(fork, message='Commit in fork.', revision_id=b'fork-1')
4603 return fork
4604
4605 def test_merge_without_commit_does_not_propagate_tags_to_master(self):
4606@@ -208,9 +208,9 @@
4607 def test_list_tags(self):
4608 tree1 = self.make_branch_and_tree('branch1')
4609 tree1.commit(allow_pointless=True, message='revision 1',
4610- rev_id='revid-1', timestamp=10)
4611+ rev_id=b'revid-1', timestamp=10)
4612 tree1.commit(allow_pointless=True, message='revision 2',
4613- rev_id='revid-2', timestamp=15)
4614+ rev_id=b'revid-2', timestamp=15)
4615
4616 b1 = tree1.branch
4617 # note how the tag for revid-1 sorts after the one for revid-2
4618@@ -254,14 +254,14 @@
4619 # now test dotted revnos
4620 tree2 = tree1.controldir.sprout('branch2').open_workingtree()
4621 tree1.commit(allow_pointless=True, message='revision 3 in branch1',
4622- rev_id='revid-3a')
4623+ rev_id=b'revid-3a')
4624 tree2.commit(allow_pointless=True, message='revision 3 in branch2',
4625- rev_id='revid-3b')
4626+ rev_id=b'revid-3b')
4627
4628 b2 = tree2.branch
4629 b2.tags.set_tag('tagD', 'revid-3b')
4630 self.run_bzr('merge -d branch1 branch2')
4631- tree1.commit('merge', rev_id='revid-4')
4632+ tree1.commit('merge', rev_id=b'revid-4')
4633
4634 out, err = self.run_bzr('tags -d branch1', encoding='utf-8')
4635 self.assertEqual(err, '')
4636@@ -284,13 +284,13 @@
4637 def test_list_tags_revision_filtering(self):
4638 tree1 = self.make_branch_and_tree('.')
4639 tree1.commit(allow_pointless=True, message='revision 1',
4640- rev_id='revid-1')
4641+ rev_id=b'revid-1')
4642 tree1.commit(allow_pointless=True, message='revision 2',
4643- rev_id='revid-2')
4644+ rev_id=b'revid-2')
4645 tree1.commit(allow_pointless=True, message='revision 3',
4646- rev_id='revid-3')
4647+ rev_id=b'revid-3')
4648 tree1.commit(allow_pointless=True, message='revision 4',
4649- rev_id='revid-4')
4650+ rev_id=b'revid-4')
4651 b1 = tree1.branch
4652 b1.tags.set_tag(u'tag 1', 'revid-1')
4653 b1.tags.set_tag(u'tag 2', 'revid-2')
4654@@ -324,9 +324,9 @@
4655
4656 tree1 = self.make_branch_and_tree('branch1')
4657 tree1.commit(allow_pointless=True, message='revision 1',
4658- rev_id='revid-1', timestamp=10)
4659+ rev_id=b'revid-1', timestamp=10)
4660 tree1.commit(allow_pointless=True, message='revision 2',
4661- rev_id='revid-2', timestamp=15)
4662+ rev_id=b'revid-2', timestamp=15)
4663
4664 b1 = tree1.branch
4665
4666@@ -393,8 +393,8 @@
4667 tree = self.make_branch_and_tree('tree1')
4668 tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
4669 tree.add('')
4670- tree.commit('msg1', rev_id='rev1')
4671- tree.commit('msg2', rev_id='rev2')
4672+ tree.commit('msg1', rev_id=b'rev1')
4673+ tree.commit('msg2', rev_id=b'rev2')
4674 tree.branch.tags.set_tag('unknown', 'out-of-mainline')
4675 tree.branch.tags.set_tag('ghost', 'spooky')
4676 tree.branch.tags.set_tag('tag1', 'rev1')
4677@@ -414,7 +414,7 @@
4678 def test_set_tag(self):
4679 self.setup_smart_server_with_call_log()
4680 t = self.make_branch_and_tree('branch')
4681- self.build_tree_contents([('branch/foo', 'thecontents')])
4682+ self.build_tree_contents([('branch/foo', b'thecontents')])
4683 t.add("foo")
4684 t.commit("message")
4685 self.reset_smart_call_log()
4686@@ -431,7 +431,7 @@
4687 def test_show_tags(self):
4688 self.setup_smart_server_with_call_log()
4689 t = self.make_branch_and_tree('branch')
4690- self.build_tree_contents([('branch/foo', 'thecontents')])
4691+ self.build_tree_contents([('branch/foo', b'thecontents')])
4692 t.add("foo")
4693 t.commit("message")
4694 t.branch.tags.set_tag("sometag", "rev1")
4695
4696=== modified file 'breezy/tests/blackbox/test_uncommit.py'
4697--- breezy/tests/blackbox/test_uncommit.py 2017-06-10 16:40:42 +0000
4698+++ breezy/tests/blackbox/test_uncommit.py 2018-03-25 11:39:57 +0000
4699@@ -35,10 +35,10 @@
4700 wt = self.make_branch_and_tree('tree')
4701 self.build_tree(['tree/a', 'tree/b', 'tree/c'])
4702 wt.add(['a', 'b', 'c'])
4703- wt.commit('initial commit', rev_id='a1')
4704+ wt.commit('initial commit', rev_id=b'a1')
4705
4706- self.build_tree_contents([('tree/a', 'new contents of a\n')])
4707- wt.commit('second commit', rev_id='a2')
4708+ self.build_tree_contents([('tree/a', b'new contents of a\n')])
4709+ wt.commit('second commit', rev_id=b'a2')
4710
4711 return wt
4712
4713@@ -163,11 +163,11 @@
4714
4715 tree2 = wt.controldir.sprout('tree2').open_workingtree()
4716
4717- tree2.commit('unchanged', rev_id='b3')
4718- tree2.commit('unchanged', rev_id='b4')
4719+ tree2.commit('unchanged', rev_id=b'b3')
4720+ tree2.commit('unchanged', rev_id=b'b4')
4721
4722 wt.merge_from_branch(tree2.branch)
4723- wt.commit('merge b4', rev_id='a3')
4724+ wt.commit('merge b4', rev_id=b'a3')
4725
4726 self.assertEqual(['a3'], wt.get_parent_ids())
4727
4728@@ -179,7 +179,7 @@
4729 def test_uncommit_pending_merge(self):
4730 wt = self.create_simple_tree()
4731 tree2 = wt.controldir.sprout('tree2').open_workingtree()
4732- tree2.commit('unchanged', rev_id='b3')
4733+ tree2.commit('unchanged', rev_id=b'b3')
4734
4735 wt.branch.fetch(tree2.branch)
4736 wt.set_pending_merges(['b3'])
4737@@ -192,16 +192,16 @@
4738 wt = self.create_simple_tree()
4739
4740 tree2 = wt.controldir.sprout('tree2').open_workingtree()
4741- tree2.commit('unchanged', rev_id='b3')
4742+ tree2.commit('unchanged', rev_id=b'b3')
4743
4744 tree3 = wt.controldir.sprout('tree3').open_workingtree()
4745- tree3.commit('unchanged', rev_id='c3')
4746+ tree3.commit('unchanged', rev_id=b'c3')
4747
4748 wt.merge_from_branch(tree2.branch)
4749- wt.commit('merge b3', rev_id='a3')
4750+ wt.commit('merge b3', rev_id=b'a3')
4751
4752 wt.merge_from_branch(tree3.branch)
4753- wt.commit('merge c3', rev_id='a4')
4754+ wt.commit('merge c3', rev_id=b'a4')
4755
4756 self.assertEqual(['a4'], wt.get_parent_ids())
4757
4758@@ -214,13 +214,13 @@
4759 wt = self.create_simple_tree()
4760
4761 tree2 = wt.controldir.sprout('tree2').open_workingtree()
4762- tree2.commit('unchanged', rev_id='b3')
4763+ tree2.commit('unchanged', rev_id=b'b3')
4764 tree3 = wt.controldir.sprout('tree3').open_workingtree()
4765- tree3.commit('unchanged', rev_id='c3')
4766+ tree3.commit('unchanged', rev_id=b'c3')
4767
4768 wt.branch.fetch(tree2.branch)
4769 wt.set_pending_merges(['b3'])
4770- wt.commit('merge b3', rev_id='a3')
4771+ wt.commit('merge b3', rev_id=b'a3')
4772
4773
4774 wt.merge_from_branch(tree3.branch)
4775@@ -255,19 +255,19 @@
4776 tree2 = wt.controldir.sprout('tree2').open_workingtree()
4777 tree3 = wt.controldir.sprout('tree3').open_workingtree()
4778
4779- tree2.commit('unchanged', rev_id='b3')
4780- tree3.commit('unchanged', rev_id='c3')
4781+ tree2.commit('unchanged', rev_id=b'b3')
4782+ tree3.commit('unchanged', rev_id=b'c3')
4783
4784 wt.merge_from_branch(tree2.branch)
4785 wt.merge_from_branch(tree3.branch, force=True)
4786- wt.commit('merge b3, c3', rev_id='a3')
4787+ wt.commit('merge b3, c3', rev_id=b'a3')
4788
4789- tree2.commit('unchanged', rev_id='b4')
4790- tree3.commit('unchanged', rev_id='c4')
4791+ tree2.commit('unchanged', rev_id=b'b4')
4792+ tree3.commit('unchanged', rev_id=b'c4')
4793
4794 wt.merge_from_branch(tree3.branch)
4795 wt.merge_from_branch(tree2.branch, force=True)
4796- wt.commit('merge b4, c4', rev_id='a4')
4797+ wt.commit('merge b4, c4', rev_id=b'a4')
4798
4799 self.assertEqual(['a4'], wt.get_parent_ids())
4800
4801@@ -327,7 +327,7 @@
4802 wt = self.make_branch_and_tree('test')
4803 self.build_tree(['test/a/', 'test/a/b', 'test/a/c'])
4804 wt.add(['a', 'a/b', 'a/c'])
4805- wt.commit('initial commit', rev_id='a1')
4806+ wt.commit('initial commit', rev_id=b'a1')
4807 wt.remove(['a/b', 'a/c'])
4808- wt.commit('remove b and c', rev_id='a2')
4809+ wt.commit('remove b and c', rev_id=b'a2')
4810 self.run_bzr("uncommit --force test")
4811
4812=== modified file 'breezy/tests/blackbox/test_unknowns.py'
4813--- breezy/tests/blackbox/test_unknowns.py 2017-05-21 18:10:28 +0000
4814+++ breezy/tests/blackbox/test_unknowns.py 2018-03-25 11:39:57 +0000
4815@@ -31,7 +31,7 @@
4816 self.assertEqual(self.run_bzr('unknowns')[0], '')
4817
4818 # single unknown file
4819- self.build_tree_contents([('a', 'contents of a\n')])
4820+ self.build_tree_contents([('a', b'contents of a\n')])
4821 self.assertEqual(self.run_bzr('unknowns')[0], 'a\n')
4822
4823 # multiple unknown files, including one with a space in its name
4824
4825=== modified file 'breezy/tests/blackbox/test_update.py'
4826--- breezy/tests/blackbox/test_update.py 2017-11-12 13:53:51 +0000
4827+++ breezy/tests/blackbox/test_update.py 2018-03-25 11:39:57 +0000
4828@@ -192,7 +192,7 @@
4829 master = self.make_branch_and_tree('master')
4830 self.build_tree(['master/file'])
4831 master.add(['file'])
4832- master.commit('one', rev_id='m1')
4833+ master.commit('one', rev_id=b'm1')
4834
4835 self.build_tree(['checkout1/'])
4836 checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1')
4837@@ -203,12 +203,12 @@
4838 other = master.controldir.sprout('other').open_workingtree()
4839 self.build_tree(['other/file2'])
4840 other.add(['file2'])
4841- other.commit('other2', rev_id='o2')
4842+ other.commit('other2', rev_id=b'o2')
4843
4844 # Create a new commit in the master branch
4845 self.build_tree(['master/file3'])
4846 master.add(['file3'])
4847- master.commit('f3', rev_id='m2')
4848+ master.commit('f3', rev_id=b'm2')
4849
4850 # Merge the other branch into checkout
4851 os.chdir('checkout1')
4852@@ -248,7 +248,7 @@
4853 master = self.make_branch_and_tree('master')
4854 self.build_tree(['master/file'])
4855 master.add(['file'])
4856- master.commit('one', rev_id='m1')
4857+ master.commit('one', rev_id=b'm1')
4858
4859 self.build_tree(['checkout1/'])
4860 checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1')
4861@@ -259,7 +259,7 @@
4862 other = master.controldir.sprout('other').open_workingtree()
4863 self.build_tree(['other/file2'])
4864 other.add(['file2'])
4865- other.commit('other2', rev_id='o2')
4866+ other.commit('other2', rev_id=b'o2')
4867
4868 # Merge the other branch into checkout - 'start reviewing a patch'
4869 checkout1.merge_from_branch(other.branch)
4870@@ -267,7 +267,7 @@
4871
4872 # Create a new commit in the master branch - 'someone else lands its'
4873 master.merge_from_branch(other.branch)
4874- master.commit('f3', rev_id='m2')
4875+ master.commit('f3', rev_id=b'm2')
4876
4877 # This should not report about local commits being pending
4878 # merges, because they were real merges (but are now gone).
4879@@ -286,10 +286,10 @@
4880 os.chdir('master')
4881 self.build_tree(['./file1'])
4882 master.add(['file1'])
4883- master.commit('one', rev_id='m1')
4884+ master.commit('one', rev_id=b'm1')
4885 self.build_tree(['./file2'])
4886 master.add(['file2'])
4887- master.commit('two', rev_id='m2')
4888+ master.commit('two', rev_id=b'm2')
4889
4890 sr = ScriptRunner()
4891 sr.run_script(self, '''
4892@@ -308,19 +308,19 @@
4893 master = self.make_branch_and_tree('master')
4894 self.build_tree(['master/file1'])
4895 master.add(['file1'])
4896- master.commit('one', rev_id='m1')
4897+ master.commit('one', rev_id=b'm1')
4898
4899 # Create a second branch, with extra commits
4900 other = master.controldir.sprout('other').open_workingtree()
4901 self.build_tree(['other/file2', 'other/file3'])
4902 other.add(['file2'])
4903- other.commit('other2', rev_id='o2')
4904+ other.commit('other2', rev_id=b'o2')
4905 other.add(['file3'])
4906- other.commit('other3', rev_id='o3')
4907+ other.commit('other3', rev_id=b'o3')
4908
4909 os.chdir('master')
4910 self.run_bzr('merge ../other')
4911- master.commit('merge', rev_id='merge')
4912+ master.commit('merge', rev_id=b'merge')
4913
4914 # Switch to o2. file3 was added only in o3 and should be deleted.
4915 out, err = self.run_bzr('update -r revid:o2')
4916@@ -340,14 +340,14 @@
4917 master = self.make_branch_and_tree('master')
4918 self.build_tree(['master/file1'])
4919 master.add(['file1'])
4920- master.commit('one', rev_id='m1')
4921+ master.commit('one', rev_id=b'm1')
4922
4923 self.run_bzr('checkout master checkout')
4924
4925 # add a revision in the master.
4926 self.build_tree(['master/file2'])
4927 master.add(['file2'])
4928- master.commit('two', rev_id='m2')
4929+ master.commit('two', rev_id=b'm2')
4930
4931 os.chdir('checkout')
4932 sr = ScriptRunner()
4933@@ -400,9 +400,9 @@
4934 """"Launchpad bug 113809 in brz "update performs two merges"
4935 https://launchpad.net/bugs/113809"""
4936 master = self.make_branch_and_tree('master')
4937- self.build_tree_contents([('master/file', 'initial contents\n')])
4938+ self.build_tree_contents([('master/file', b'initial contents\n')])
4939 master.add(['file'])
4940- master.commit('one', rev_id='m1')
4941+ master.commit('one', rev_id=b'm1')
4942
4943 checkout = master.branch.create_checkout('checkout')
4944 lightweight = checkout.branch.create_checkout('lightweight',
4945@@ -410,19 +410,19 @@
4946
4947 # time to create a mess
4948 # add a commit to the master
4949- self.build_tree_contents([('master/file', 'master\n')])
4950- master.commit('two', rev_id='m2')
4951- self.build_tree_contents([('master/file', 'master local changes\n')])
4952+ self.build_tree_contents([('master/file', b'master\n')])
4953+ master.commit('two', rev_id=b'm2')
4954+ self.build_tree_contents([('master/file', b'master local changes\n')])
4955
4956 # local commit on the checkout
4957- self.build_tree_contents([('checkout/file', 'checkout\n')])
4958- checkout.commit('tree', rev_id='c2', local=True)
4959+ self.build_tree_contents([('checkout/file', b'checkout\n')])
4960+ checkout.commit('tree', rev_id=b'c2', local=True)
4961 self.build_tree_contents([('checkout/file',
4962- 'checkout local changes\n')])
4963+ b'checkout local changes\n')])
4964
4965 # lightweight
4966 self.build_tree_contents([('lightweight/file',
4967- 'lightweight local changes\n')])
4968+ b'lightweight local changes\n')])
4969
4970 # now update (and get conflicts)
4971 out, err = self.run_bzr('update lightweight', retcode=1)
4972@@ -439,7 +439,7 @@
4973
4974 # resolve it
4975 self.build_tree_contents([('lightweight/file',
4976- 'lightweight+checkout\n')])
4977+ b'lightweight+checkout\n')])
4978 self.run_bzr('resolve lightweight/file')
4979
4980 # check we get the second conflict
4981@@ -466,7 +466,7 @@
4982 """
4983 self.make_branch_and_tree('.')
4984 self.build_tree_contents([('a/',),
4985- ('a/file', 'content')])
4986+ ('a/file', b'content')])
4987 sr = ScriptRunner()
4988 sr.run_script(self, '''
4989 $ brz update ./a
4990
4991=== modified file 'breezy/tests/blackbox/test_verify_signatures.py'
4992--- breezy/tests/blackbox/test_verify_signatures.py 2017-05-21 18:10:28 +0000
4993+++ breezy/tests/blackbox/test_verify_signatures.py 2018-03-25 11:39:57 +0000
4994@@ -37,13 +37,13 @@
4995
4996 def setup_tree(self, location='.'):
4997 wt = self.make_branch_and_tree(location)
4998- wt.commit("base A", allow_pointless=True, rev_id='A')
4999- wt.commit("base B", allow_pointless=True, rev_id='B')
5000- wt.commit("base C", allow_pointless=True, rev_id='C')
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches