Merge lp:~jelmer/brz/fastimport-symlinks into lp:brz/3.0

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/fastimport-symlinks
Merge into: lp:brz/3.0
Diff against target: 71 lines (+16/-6)
4 files modified
breezy/plugins/fastimport/exporter.py (+1/-1)
breezy/plugins/fastimport/tests/test_commands.py (+11/-0)
breezy/plugins/fastimport/tests/test_generic_processor.py (+2/-5)
doc/en/release-notes/brz-3.0.txt (+2/-0)
To merge this branch: bzr merge lp:~jelmer/brz/fastimport-symlinks
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+376207@code.launchpad.net

Commit message

Fix symlink fastexporting on Python 3.

Description of the change

Fix symlink fastexporting on Python 3.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/fastimport/exporter.py'
2--- breezy/plugins/fastimport/exporter.py 2019-02-04 18:52:53 +0000
3+++ breezy/plugins/fastimport/exporter.py 2019-12-23 00:25:36 +0000
4@@ -513,7 +513,7 @@
5 yield commands.FileModifyCommand(
6 path.encode("utf-8"),
7 helpers.kind_to_mode('symlink', False),
8- None, tree_new.get_symlink_target(path))
9+ None, tree_new.get_symlink_target(path).encode('utf-8'))
10 elif kind == 'directory':
11 if not self.plain_format:
12 yield commands.FileModifyCommand(
13
14=== modified file 'breezy/plugins/fastimport/tests/test_commands.py'
15--- breezy/plugins/fastimport/tests/test_commands.py 2018-12-16 12:49:30 +0000
16+++ breezy/plugins/fastimport/tests/test_commands.py 2019-12-23 00:25:36 +0000
17@@ -23,6 +23,7 @@
18 import gzip
19
20 from .... import tests
21+from ....tests import features
22 from ....tests.blackbox import ExternalBase
23
24 from ..cmds import (
25@@ -155,6 +156,16 @@
26 self.assertEquals("", data)
27 self.assertPathExists("br.fi")
28
29+ def test_symlink(self):
30+ tree = self.make_branch_and_tree("br")
31+ self.requireFeature(features.SymlinkFeature)
32+ os.symlink('symlink-target', 'br/symlink')
33+ tree.add('symlink')
34+ tree.commit("add a symlink")
35+ data = self.run_bzr("fast-export br br.fi")[0]
36+ self.assertEquals("", data)
37+ self.assertPathExists("br.fi")
38+
39 def test_tag_rewriting(self):
40 tree = self.make_branch_and_tree("br")
41 tree.commit("pointless")
42
43=== modified file 'breezy/plugins/fastimport/tests/test_generic_processor.py'
44--- breezy/plugins/fastimport/tests/test_generic_processor.py 2018-11-11 04:08:32 +0000
45+++ breezy/plugins/fastimport/tests/test_generic_processor.py 2019-12-23 00:25:36 +0000
46@@ -39,11 +39,8 @@
47 ('pack-0.92', {'branch_format': 'pack-0.92'}),
48 ('1.9-rich-root', {'branch_format': '1.9-rich-root'}),
49 ]
50- try:
51- from ....bzr.groupcompress_repo import RepositoryFormat2a
52- scenarios.append(('2a', {'branch_format': '2a'}))
53- except ImportError:
54- pass
55+ from ....bzr.groupcompress_repo import RepositoryFormat2a
56+ scenarios.append(('2a', {'branch_format': '2a'}))
57 suite = loader.suiteClass()
58 result = tests.multiply_tests(standard_tests, scenarios, suite)
59 return result
60
61=== modified file 'doc/en/release-notes/brz-3.0.txt'
62--- doc/en/release-notes/brz-3.0.txt 2019-12-01 16:47:59 +0000
63+++ doc/en/release-notes/brz-3.0.txt 2019-12-23 00:25:36 +0000
64@@ -32,6 +32,8 @@
65 .. Fixes for situations where brz would previously crash or give incorrect
66 or undesirable results.
67
68+ * Fix fast-exporting of symlinks on Python 3. (Jelmer Vernooij, #1851478)
69+
70 * Don't rely on private transport attribute in fast-import.
71 (Jelmer Vernooij, #1854607)
72

Subscribers

People subscribed via source and target branches