Merge lp:~gz/brz/unmapped into lp:brz

Proposed by Martin Packman
Status: Merged
Approved by: Martin Packman
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~gz/brz/unmapped
Merge into: lp:brz
Prerequisite: lp:~gz/brz/i_unzipping
Diff against target: 444 lines (+56/-51)
24 files modified
breezy/btree_index.py (+6/-3)
breezy/dirstate.py (+2/-2)
breezy/export_pot.py (+1/-2)
breezy/groupcompress.py (+4/-1)
breezy/mutabletree.py (+1/-1)
breezy/osutils.py (+2/-1)
breezy/plugin.py (+2/-2)
breezy/plugins/changelog_merge/changelog_merge.py (+3/-3)
breezy/plugins/weave_fmt/bzrdir.py (+1/-1)
breezy/repository.py (+2/-2)
breezy/smart/repository.py (+2/-2)
breezy/tests/per_pack_repository.py (+1/-1)
breezy/tests/per_versionedfile.py (+4/-4)
breezy/tests/per_workingtree/test_paths2ids.py (+4/-4)
breezy/tests/test_diff.py (+4/-4)
breezy/tests/test_http.py (+2/-2)
breezy/tests/test_rio.py (+2/-2)
breezy/transport/memory.py (+2/-2)
breezy/transport/sftp.py (+1/-1)
breezy/util/simplemapi.py (+3/-4)
breezy/versionedfile.py (+3/-3)
breezy/vf_repository.py (+2/-2)
breezy/weave.py (+1/-1)
breezy/weavefile.py (+1/-1)
To merge this branch: bzr merge lp:~gz/brz/unmapped
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+324568@code.launchpad.net

This proposal supersedes a proposal from 2017-05-24.

Commit message

Make use of map Python 3 compatible

Description of the change

Cope with the builtin map function becoming imap in Python 3.

Worse case the fixer throws in an extra pointless list copy, where it looked like that might matter I refactored or pulled in the iterator version from future_builtins.

There are a few changes on somewhat hot paths, where larger refactors/rewrites are probably called for, but avoided doing so for now.

The static tuple intern change is somewhat driveby, we can't use sys.intern on bytestrings in Python 3 anyway, and a better interface would be constructing the tuple with a new method like from_bytes_interned or something to mega-intern the result.

Same as before just with prereq branch set correctly.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/btree_index.py'
--- breezy/btree_index.py 2017-05-22 00:56:52 +0000
+++ breezy/btree_index.py 2017-05-24 23:42:41 +0000
@@ -42,6 +42,7 @@
42from .index import _OPTION_NODE_REFS, _OPTION_KEY_ELEMENTS, _OPTION_LEN42from .index import _OPTION_NODE_REFS, _OPTION_KEY_ELEMENTS, _OPTION_LEN
43from .sixish import (43from .sixish import (
44 BytesIO,44 BytesIO,
45 map,
45 )46 )
4647
4748
@@ -662,7 +663,9 @@
662 for line in lines[2:]:663 for line in lines[2:]:
663 if line == '':664 if line == '':
664 break665 break
665 nodes.append(as_st(map(intern, line.split('\0'))).intern())666 # GZ 2017-05-24: Used to intern() each chunk of line as well, need
667 # to recheck performance and perhaps adapt StaticTuple to adjust.
668 nodes.append(as_st(line.split(b'\0')).intern())
666 return nodes669 return nodes
667670
668671
@@ -1497,9 +1500,9 @@
1497 if not options_line.startswith(_OPTION_ROW_LENGTHS):1500 if not options_line.startswith(_OPTION_ROW_LENGTHS):
1498 raise errors.BadIndexOptions(self)1501 raise errors.BadIndexOptions(self)
1499 try:1502 try:
1500 self._row_lengths = map(int, [length for length in1503 self._row_lengths = [int(length) for length in
1501 options_line[len(_OPTION_ROW_LENGTHS):].split(',')1504 options_line[len(_OPTION_ROW_LENGTHS):].split(',')
1502 if len(length)])1505 if length]
1503 except ValueError:1506 except ValueError:
1504 raise errors.BadIndexOptions(self)1507 raise errors.BadIndexOptions(self)
1505 self._compute_row_offsets()1508 self._compute_row_offsets()
15061509
=== modified file 'breezy/dirstate.py'
--- breezy/dirstate.py 2017-05-22 11:22:28 +0000
+++ breezy/dirstate.py 2017-05-24 23:42:41 +0000
@@ -1953,7 +1953,7 @@
1953 lines = []1953 lines = []
1954 lines.append(self._get_parents_line(self.get_parent_ids()))1954 lines.append(self._get_parents_line(self.get_parent_ids()))
1955 lines.append(self._get_ghosts_line(self._ghosts))1955 lines.append(self._get_ghosts_line(self._ghosts))
1956 lines.extend(self._get_entry_lines())1956 lines.extend(self._iter_entry_lines())
1957 return self._get_output_lines(lines)1957 return self._get_output_lines(lines)
19581958
1959 def _get_ghosts_line(self, ghost_ids):1959 def _get_ghosts_line(self, ghost_ids):
@@ -1964,7 +1964,7 @@
1964 """Create a line for the state file for parents information."""1964 """Create a line for the state file for parents information."""
1965 return '\0'.join([str(len(parent_ids))] + parent_ids)1965 return '\0'.join([str(len(parent_ids))] + parent_ids)
19661966
1967 def _get_entry_lines(self):1967 def _iter_entry_lines(self):
1968 """Create lines for entries."""1968 """Create lines for entries."""
1969 return map(self._entry_to_line, self._iter_entries())1969 return map(self._entry_to_line, self._iter_entries())
19701970
19711971
=== modified file 'breezy/export_pot.py'
--- breezy/export_pot.py 2017-05-22 00:56:52 +0000
+++ breezy/export_pot.py 2017-05-24 23:42:41 +0000
@@ -65,9 +65,8 @@
65 if not lines[-1]:65 if not lines[-1]:
66 del lines[-1]66 del lines[-1]
67 lines[-1] = lines[-1] + '\n'67 lines[-1] = lines[-1] + '\n'
68 lines = map(_escape, lines)
69 lineterm = '\\n"\n"'68 lineterm = '\\n"\n"'
70 s = '""\n"' + lineterm.join(lines) + '"'69 s = '""\n"' + lineterm.join(map(_escape, lines)) + '"'
71 return s70 return s
7271
7372
7473
=== modified file 'breezy/groupcompress.py'
--- breezy/groupcompress.py 2017-05-22 00:56:52 +0000
+++ breezy/groupcompress.py 2017-05-24 23:42:41 +0000
@@ -42,6 +42,9 @@
4242
43from .btree_index import BTreeBuilder43from .btree_index import BTreeBuilder
44from .lru_cache import LRUSizeCache44from .lru_cache import LRUSizeCache
45from .sixish import (
46 map,
47 )
45from .versionedfile import (48from .versionedfile import (
46 _KeyRefs,49 _KeyRefs,
47 adapter_registry,50 adapter_registry,
@@ -300,7 +303,7 @@
300 compressor = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION)303 compressor = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION)
301 # Peak in this point is 1 fulltext, 1 compressed text, + zlib overhead304 # Peak in this point is 1 fulltext, 1 compressed text, + zlib overhead
302 # (measured peak is maybe 30MB over the above...)305 # (measured peak is maybe 30MB over the above...)
303 compressed_chunks = map(compressor.compress, chunks)306 compressed_chunks = list(map(compressor.compress, chunks))
304 compressed_chunks.append(compressor.flush())307 compressed_chunks.append(compressor.flush())
305 # Ignore empty chunks308 # Ignore empty chunks
306 self._z_content_chunks = [c for c in compressed_chunks if c]309 self._z_content_chunks = [c for c in compressed_chunks if c]
307310
=== modified file 'breezy/mutabletree.py'
--- breezy/mutabletree.py 2017-05-22 00:56:52 +0000
+++ breezy/mutabletree.py 2017-05-24 23:42:41 +0000
@@ -667,7 +667,7 @@
667 # filename alone667 # filename alone
668 # only expanding if symlinks are supported avoids windows path bugs668 # only expanding if symlinks are supported avoids windows path bugs
669 if osutils.has_symlinks():669 if osutils.has_symlinks():
670 file_list = map(osutils.normalizepath, file_list)670 file_list = list(map(osutils.normalizepath, file_list))
671671
672 user_dirs = {}672 user_dirs = {}
673 # validate user file paths and convert all paths to tree673 # validate user file paths and convert all paths to tree
674674
=== modified file 'breezy/osutils.py'
--- breezy/osutils.py 2017-05-22 00:56:52 +0000
+++ breezy/osutils.py 2017-05-24 23:42:41 +0000
@@ -811,7 +811,8 @@
811def sha_strings(strings, _factory=sha):811def sha_strings(strings, _factory=sha):
812 """Return the sha-1 of concatenation of strings"""812 """Return the sha-1 of concatenation of strings"""
813 s = _factory()813 s = _factory()
814 map(s.update, strings)814 for string in strings:
815 s.update(string)
815 return s.hexdigest()816 return s.hexdigest()
816817
817818
818819
=== modified file 'breezy/plugin.py'
--- breezy/plugin.py 2017-05-22 00:56:52 +0000
+++ breezy/plugin.py 2017-05-24 23:42:41 +0000
@@ -266,7 +266,7 @@
266266
267 # Get rid of trailing slashes, since Python can't handle them when267 # Get rid of trailing slashes, since Python can't handle them when
268 # it tries to import modules.268 # it tries to import modules.
269 paths = map(_strip_trailing_sep, paths)269 paths = list(map(_strip_trailing_sep, paths))
270 return paths270 return paths
271271
272272
@@ -317,7 +317,7 @@
317 # this function, and since it sets plugins.__path__, it should set it to317 # this function, and since it sets plugins.__path__, it should set it to
318 # something that will be valid for Python to use (in case people try to318 # something that will be valid for Python to use (in case people try to
319 # run "import breezy.plugins.PLUGINNAME" after calling this function).319 # run "import breezy.plugins.PLUGINNAME" after calling this function).
320 _mod_plugins.__path__ = map(_strip_trailing_sep, dirs)320 _mod_plugins.__path__ = list(map(_strip_trailing_sep, dirs))
321 for d in dirs:321 for d in dirs:
322 if not d:322 if not d:
323 continue323 continue
324324
=== modified file 'breezy/plugins/changelog_merge/changelog_merge.py'
--- breezy/plugins/changelog_merge/changelog_merge.py 2017-05-22 00:56:52 +0000
+++ breezy/plugins/changelog_merge/changelog_merge.py 2017-05-24 23:42:41 +0000
@@ -48,7 +48,7 @@
48 entries.append([])48 entries.append([])
49 entry = entries[-1]49 entry = entries[-1]
50 entry.append(line)50 entry.append(line)
51 return map(tuple, entries)51 return list(map(tuple, entries))
5252
5353
54def entries_to_lines(entries):54def entries_to_lines(entries):
@@ -106,8 +106,8 @@
106 This algorithm does O(N^2 * logN) SequenceMatcher.ratio() calls, which is106 This algorithm does O(N^2 * logN) SequenceMatcher.ratio() calls, which is
107 pretty bad, but it shouldn't be used very often.107 pretty bad, but it shouldn't be used very often.
108 """108 """
109 deleted_entries_as_strs = map(entry_as_str, deleted_entries)109 deleted_entries_as_strs = list(map(entry_as_str, deleted_entries))
110 new_entries_as_strs = map(entry_as_str, new_entries)110 new_entries_as_strs = list(map(entry_as_str, new_entries))
111 result_new = list(new_entries)111 result_new = list(new_entries)
112 result_deleted = list(deleted_entries)112 result_deleted = list(deleted_entries)
113 result_edits = []113 result_edits = []
114114
=== modified file 'breezy/plugins/weave_fmt/bzrdir.py'
--- breezy/plugins/weave_fmt/bzrdir.py 2017-05-22 00:56:52 +0000
+++ breezy/plugins/weave_fmt/bzrdir.py 2017-05-24 23:42:41 +0000
@@ -415,7 +415,7 @@
415 Also upgrade the inventory to refer to the text revision ids."""415 Also upgrade the inventory to refer to the text revision ids."""
416 rev_id = rev.revision_id416 rev_id = rev.revision_id
417 trace.mutter('converting texts of revision {%s}', rev_id)417 trace.mutter('converting texts of revision {%s}', rev_id)
418 parent_invs = map(self._load_updated_inventory, present_parents)418 parent_invs = list(map(self._load_updated_inventory, present_parents))
419 entries = inv.iter_entries()419 entries = inv.iter_entries()
420 entries.next()420 entries.next()
421 for path, ie in entries:421 for path, ie in entries:
422422
=== modified file 'breezy/repository.py'
--- breezy/repository.py 2017-05-22 00:56:52 +0000
+++ breezy/repository.py 2017-05-24 23:42:41 +0000
@@ -924,8 +924,8 @@
924 not part of revision_ids themselves924 not part of revision_ids themselves
925 """925 """
926 parent_map = self.get_parent_map(revision_ids)926 parent_map = self.get_parent_map(revision_ids)
927 parent_ids = set()927 parent_ids = set(itertools.chain.from_iterable(
928 map(parent_ids.update, parent_map.itervalues())928 parent_map.itervalues()))
929 parent_ids.difference_update(revision_ids)929 parent_ids.difference_update(revision_ids)
930 parent_ids.discard(_mod_revision.NULL_REVISION)930 parent_ids.discard(_mod_revision.NULL_REVISION)
931 return parent_ids931 return parent_ids
932932
=== modified file 'breezy/smart/repository.py'
--- breezy/smart/repository.py 2017-05-22 00:56:52 +0000
+++ breezy/smart/repository.py 2017-05-24 23:42:41 +0000
@@ -19,6 +19,7 @@
19from __future__ import absolute_import19from __future__ import absolute_import
2020
21import bz221import bz2
22import itertools
22import os23import os
23try:24try:
24 import queue25 import queue
@@ -307,8 +308,7 @@
307 else:308 else:
308 search_ids = repository.all_revision_ids()309 search_ids = repository.all_revision_ids()
309 search = graph._make_breadth_first_searcher(search_ids)310 search = graph._make_breadth_first_searcher(search_ids)
310 transitive_ids = set()311 transitive_ids = set(itertools.chain.from_iterable(search))
311 map(transitive_ids.update, list(search))
312 parent_map = graph.get_parent_map(transitive_ids)312 parent_map = graph.get_parent_map(transitive_ids)
313 revision_graph = _strip_NULL_ghosts(parent_map)313 revision_graph = _strip_NULL_ghosts(parent_map)
314 if revision_id and revision_id not in revision_graph:314 if revision_id and revision_id not in revision_graph:
315315
=== modified file 'breezy/tests/per_pack_repository.py'
--- breezy/tests/per_pack_repository.py 2017-05-23 14:08:03 +0000
+++ breezy/tests/per_pack_repository.py 2017-05-24 23:42:41 +0000
@@ -358,7 +358,7 @@
358 for _1, key, val, refs in pack.revision_index.iter_all_entries():358 for _1, key, val, refs in pack.revision_index.iter_all_entries():
359 if isinstance(format.repository_format, RepositoryFormat2a):359 if isinstance(format.repository_format, RepositoryFormat2a):
360 # group_start, group_len, internal_start, internal_len360 # group_start, group_len, internal_start, internal_len
361 pos = map(int, val.split())361 pos = list(map(int, val.split()))
362 else:362 else:
363 # eol_flag, start, len363 # eol_flag, start, len
364 pos = int(val[1:].split()[0])364 pos = int(val[1:].split()[0])
365365
=== modified file 'breezy/tests/per_versionedfile.py'
--- breezy/tests/per_versionedfile.py 2017-05-24 23:30:47 +0000
+++ breezy/tests/per_versionedfile.py 2017-05-24 23:42:41 +0000
@@ -945,9 +945,9 @@
945 return x + '\n'945 return x + '\n'
946946
947 w = self.get_file()947 w = self.get_file()
948 w.add_lines('text0', [], map(addcrlf, base))948 w.add_lines('text0', [], list(map(addcrlf, base)))
949 w.add_lines('text1', ['text0'], map(addcrlf, a))949 w.add_lines('text1', ['text0'], list(map(addcrlf, a)))
950 w.add_lines('text2', ['text0'], map(addcrlf, b))950 w.add_lines('text2', ['text0'], list(map(addcrlf, b)))
951951
952 self.log_contents(w)952 self.log_contents(w)
953953
@@ -963,7 +963,7 @@
963 mt.seek(0)963 mt.seek(0)
964 self.log(mt.getvalue())964 self.log(mt.getvalue())
965965
966 mp = map(addcrlf, mp)966 mp = list(map(addcrlf, mp))
967 self.assertEqual(mt.readlines(), mp)967 self.assertEqual(mt.readlines(), mp)
968968
969969
970970
=== modified file 'breezy/tests/per_workingtree/test_paths2ids.py'
--- breezy/tests/per_workingtree/test_paths2ids.py 2017-05-21 18:10:28 +0000
+++ breezy/tests/per_workingtree/test_paths2ids.py 2017-05-24 23:42:41 +0000
@@ -21,8 +21,6 @@
21find_ids_across_trees.21find_ids_across_trees.
22"""22"""
2323
24from operator import attrgetter
25
26from breezy import errors24from breezy import errors
27from breezy.tests import features25from breezy.tests import features
28from breezy.tests.per_workingtree import TestCaseWithWorkingTree26from breezy.tests.per_workingtree import TestCaseWithWorkingTree
@@ -47,10 +45,12 @@
47 """Run paths2ids for tree, and check the result."""45 """Run paths2ids for tree, and check the result."""
48 tree.lock_read()46 tree.lock_read()
49 if trees:47 if trees:
50 map(apply, map(attrgetter('lock_read'), trees))48 for t in trees:
49 t.lock_read()
51 result = tree.paths2ids(paths, trees,50 result = tree.paths2ids(paths, trees,
52 require_versioned=require_versioned)51 require_versioned=require_versioned)
53 map(apply, map(attrgetter('unlock'), trees))52 for t in trees:
53 t.unlock()
54 else:54 else:
55 result = tree.paths2ids(paths,55 result = tree.paths2ids(paths,
56 require_versioned=require_versioned)56 require_versioned=require_versioned)
5757
=== modified file 'breezy/tests/test_diff.py'
--- breezy/tests/test_diff.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_diff.py 2017-05-24 23:42:41 +0000
@@ -1194,8 +1194,8 @@
1194 ]1194 ]
1195 , list(unified_diff(txt_a, txt_b,1195 , list(unified_diff(txt_a, txt_b,
1196 sequencematcher=psm)))1196 sequencematcher=psm)))
1197 txt_a = map(lambda x: x+'\n', 'abcdefghijklmnop')1197 txt_a = [x+'\n' for x in 'abcdefghijklmnop']
1198 txt_b = map(lambda x: x+'\n', 'abcdefxydefghijklmnop')1198 txt_b = [x+'\n' for x in 'abcdefxydefghijklmnop']
1199 # This is the result with LongestCommonSubstring matching1199 # This is the result with LongestCommonSubstring matching
1200 self.assertEqual(['--- \n',1200 self.assertEqual(['--- \n',
1201 '+++ \n',1201 '+++ \n',
@@ -1307,8 +1307,8 @@
1307 , list(unified_diff_files('a1', 'b1',1307 , list(unified_diff_files('a1', 'b1',
1308 sequencematcher=psm)))1308 sequencematcher=psm)))
13091309
1310 txt_a = map(lambda x: x+'\n', 'abcdefghijklmnop')1310 txt_a = [x+'\n' for x in 'abcdefghijklmnop']
1311 txt_b = map(lambda x: x+'\n', 'abcdefxydefghijklmnop')1311 txt_b = [x+'\n' for x in 'abcdefxydefghijklmnop']
1312 with open('a2', 'wb') as f: f.writelines(txt_a)1312 with open('a2', 'wb') as f: f.writelines(txt_a)
1313 with open('b2', 'wb') as f: f.writelines(txt_b)1313 with open('b2', 'wb') as f: f.writelines(txt_b)
13141314
13151315
=== modified file 'breezy/tests/test_http.py'
--- breezy/tests/test_http.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_http.py 2017-05-24 23:42:41 +0000
@@ -1391,8 +1391,8 @@
13911391
1392 def test_range_header(self):1392 def test_range_header(self):
1393 # Valid ranges1393 # Valid ranges
1394 map(self.assertEqual,['0', '234'],1394 self.assertEqual(
1395 list(self._file_contents('a', [(0,0), (2,4)])),)1395 ['0', '234'], list(self._file_contents('a', [(0,0), (2,4)])))
13961396
1397 def test_range_header_tail(self):1397 def test_range_header_tail(self):
1398 self.assertEqual('789', self._file_tail('a', 3))1398 self.assertEqual('789', self._file_tail('a', 3))
13991399
=== modified file 'breezy/tests/test_rio.py'
--- breezy/tests/test_rio.py 2017-05-21 18:10:28 +0000
+++ breezy/tests/test_rio.py 2017-05-24 23:42:41 +0000
@@ -130,8 +130,8 @@
130 s.add(k, v)130 s.add(k, v)
131 s2 = read_stanza(s.to_lines())131 s2 = read_stanza(s.to_lines())
132 self.assertEqual(s, s2)132 self.assertEqual(s, s2)
133 self.assertEqual(s.get_all('a'), map(str, [10, 100, 1000]))133 self.assertEqual(s.get_all('a'), ['10', '100', '1000'])
134 self.assertEqual(s.get_all('b'), map(str, [20, 200, 2000]))134 self.assertEqual(s.get_all('b'), ['20', '200', '2000'])
135135
136 def test_backslash(self):136 def test_backslash(self):
137 s = Stanza(q='\\')137 s = Stanza(q='\\')
138138
=== modified file 'breezy/transport/memory.py'
--- breezy/transport/memory.py 2017-05-22 00:56:52 +0000
+++ breezy/transport/memory.py 2017-05-24 23:42:41 +0000
@@ -193,8 +193,8 @@
193 if path.startswith(_abspath):193 if path.startswith(_abspath):
194 trailing = path[len(_abspath):]194 trailing = path[len(_abspath):]
195 if trailing and '/' not in trailing:195 if trailing and '/' not in trailing:
196 result.append(trailing)196 result.append(urlutils.escape(trailing))
197 return map(urlutils.escape, result)197 return result
198198
199 def rename(self, rel_from, rel_to):199 def rename(self, rel_from, rel_to):
200 """Rename a file or directory; fail if the destination exists"""200 """Rename a file or directory; fail if the destination exists"""
201201
=== modified file 'breezy/transport/sftp.py'
--- breezy/transport/sftp.py 2017-05-24 23:30:47 +0000
+++ breezy/transport/sftp.py 2017-05-24 23:42:41 +0000
@@ -282,7 +282,7 @@
282 if data_chunks:282 if data_chunks:
283 if 'sftp' in debug.debug_flags:283 if 'sftp' in debug.debug_flags:
284 mutter('SFTP readv left with %d out-of-order bytes',284 mutter('SFTP readv left with %d out-of-order bytes',
285 sum(map(lambda x: len(x[1]), data_chunks)))285 sum(len(x[1]) for x in data_chunks))
286 # We've processed all the readv data, at this point, anything we286 # We've processed all the readv data, at this point, anything we
287 # couldn't process is in data_chunks. This doesn't happen often, so287 # couldn't process is in data_chunks. This doesn't happen often, so
288 # this code path isn't optimized288 # this code path isn't optimized
289289
=== modified file 'breezy/util/simplemapi.py'
--- breezy/util/simplemapi.py 2017-02-05 16:35:58 +0000
+++ breezy/util/simplemapi.py 2017-05-24 23:42:41 +0000
@@ -233,10 +233,9 @@
233233
234 attach = []234 attach = []
235 AttachWork = attachfiles.split(';')235 AttachWork = attachfiles.split(';')
236 for file in AttachWork:236 for f in AttachWork:
237 if os.path.exists(file):237 if os.path.exists(f):
238 attach.append(file)238 attach.append(os.path.abspath(f))
239 attach = map(os.path.abspath, attach)
240239
241 restore = os.getcwd()240 restore = os.getcwd()
242 try:241 try:
243242
=== modified file 'breezy/versionedfile.py'
--- breezy/versionedfile.py 2017-05-24 23:42:40 +0000
+++ breezy/versionedfile.py 2017-05-24 23:42:41 +0000
@@ -1093,9 +1093,9 @@
1093 while pending:1093 while pending:
1094 this_parent_map = self.get_parent_map(pending)1094 this_parent_map = self.get_parent_map(pending)
1095 parent_map.update(this_parent_map)1095 parent_map.update(this_parent_map)
1096 pending = set()1096 pending = set(itertools.chain.from_iterable(
1097 map(pending.update, this_parent_map.itervalues())1097 this_parent_map.itervalues()))
1098 pending = pending.difference(parent_map)1098 pending.difference_update(parent_map)
1099 kg = _mod_graph.KnownGraph(parent_map)1099 kg = _mod_graph.KnownGraph(parent_map)
1100 return kg1100 return kg
11011101
11021102
=== modified file 'breezy/vf_repository.py'
--- breezy/vf_repository.py 2017-05-22 00:56:52 +0000
+++ breezy/vf_repository.py 2017-05-24 23:42:41 +0000
@@ -1516,8 +1516,8 @@
1516 revision_keys1516 revision_keys
1517 """1517 """
1518 parent_map = self.revisions.get_parent_map(revision_keys)1518 parent_map = self.revisions.get_parent_map(revision_keys)
1519 parent_keys = set()1519 parent_keys = set(itertools.chain.from_iterable(
1520 map(parent_keys.update, parent_map.itervalues())1520 parent_map.itervalues()))
1521 parent_keys.difference_update(revision_keys)1521 parent_keys.difference_update(revision_keys)
1522 parent_keys.discard(_mod_revision.NULL_REVISION)1522 parent_keys.discard(_mod_revision.NULL_REVISION)
1523 return parent_keys1523 return parent_keys
15241524
=== modified file 'breezy/weave.py'
--- breezy/weave.py 2017-05-22 00:56:52 +0000
+++ breezy/weave.py 2017-05-24 23:42:41 +0000
@@ -393,7 +393,7 @@
393 def _add_lines(self, version_id, parents, lines, parent_texts,393 def _add_lines(self, version_id, parents, lines, parent_texts,
394 left_matching_blocks, nostore_sha, random_id, check_content):394 left_matching_blocks, nostore_sha, random_id, check_content):
395 """See VersionedFile.add_lines."""395 """See VersionedFile.add_lines."""
396 idx = self._add(version_id, lines, map(self._lookup, parents),396 idx = self._add(version_id, lines, list(map(self._lookup, parents)),
397 nostore_sha=nostore_sha)397 nostore_sha=nostore_sha)
398 return sha_strings(lines), sum(map(len, lines)), idx398 return sha_strings(lines), sum(map(len, lines)), idx
399399
400400
=== modified file 'breezy/weavefile.py'
--- breezy/weavefile.py 2017-05-22 00:56:52 +0000
+++ breezy/weavefile.py 2017-05-24 23:42:41 +0000
@@ -135,7 +135,7 @@
135 l = lines.next()135 l = lines.next()
136 if l[0] == 'i':136 if l[0] == 'i':
137 if len(l) > 2:137 if len(l) > 2:
138 w._parents.append(map(int, l[2:].split(' ')))138 w._parents.append(list(map(int, l[2:].split(' '))))
139 else:139 else:
140 w._parents.append([])140 w._parents.append([])
141 l = lines.next()[:-1]141 l = lines.next()[:-1]

Subscribers

People subscribed via source and target branches