Merge lp:~jelmer/brz/3.0-fix-sphinx 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/3.0-fix-sphinx
Merge into: lp:brz/3.0
Diff against target: 122 lines (+41/-12)
5 files modified
breezy/git/tests/test_blackbox.py (+3/-3)
breezy/git/tests/test_workingtree.py (+2/-1)
breezy/git/tree.py (+9/-2)
breezy/tests/test_source.py (+25/-4)
byov.conf (+2/-2)
To merge this branch: bzr merge lp:~jelmer/brz/3.0-fix-sphinx
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+368018@code.launchpad.net

Commit message

Cherry-pick fix for running with newer versions of sphinx, dulwich and flake8.

Description of the change

Cherry-pick fix for running with newer versions of sphinx, dulwich and flake8.

To post a comment you must log in.
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
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
1=== modified file 'breezy/git/tests/test_blackbox.py'
2--- breezy/git/tests/test_blackbox.py 2019-02-17 04:08:56 +0000
3+++ breezy/git/tests/test_blackbox.py 2019-05-28 21:58:16 +0000
4@@ -197,9 +197,9 @@
5 output, error = self.run_bzr(['diff', '--format=git'], retcode=1)
6 self.assertEqual(error, '')
7 self.assertEqual(output,
8- 'diff --git /dev/null b/a\n'
9- 'old mode 0\n'
10- 'new mode 100644\n'
11+ 'diff --git a/a b/a\n'
12+ 'old file mode 0\n'
13+ 'new file mode 100644\n'
14 'index 0000000..c197bd8 100644\n'
15 '--- /dev/null\n'
16 '+++ b/a\n'
17
18=== modified file 'breezy/git/tests/test_workingtree.py'
19--- breezy/git/tests/test_workingtree.py 2019-02-04 17:10:54 +0000
20+++ breezy/git/tests/test_workingtree.py 2019-05-28 21:58:16 +0000
21@@ -268,8 +268,9 @@
22 ], [b'a'], want_unversioned=True)
23
24 def test_submodule(self):
25- self.build_tree(['a/'])
26+ self.subtree = self.make_branch_and_tree('a', format="git")
27 a = Blob.from_string(b'irrelevant\n')
28+ self.build_tree_contents([('a/.git/HEAD', a.id)])
29 with self.wt.lock_tree_write():
30 (index, index_path) = self.wt._lookup_index(b'a')
31 index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0)
32
33=== modified file 'breezy/git/tree.py'
34--- breezy/git/tree.py 2018-12-18 20:55:37 +0000
35+++ breezy/git/tree.py 2019-05-28 21:58:16 +0000
36@@ -1455,7 +1455,9 @@
37 # Entry was removed; keep it listed, but mark it as gone.
38 blobs[path] = (ZERO_SHA, 0)
39 elif e.errno == errno.EISDIR:
40- # TODO(jelmer): Only do this if 'path' appears in .gitmodules?
41+ # Backwards compatibility with Dulwich < 0.19.12;
42+ # newer versions of Dulwich return either an entry for the
43+ # submodule or None for directories.
44 if S_ISGITLINK(index_entry.mode):
45 blobs[path] = (index_entry.sha, index_entry.mode)
46 else:
47@@ -1465,7 +1467,12 @@
48 else:
49 raise
50 else:
51- blobs[path] = (live_entry.sha, cleanup_mode(live_entry.mode))
52+ if live_entry is None:
53+ # Entry was turned into a directory
54+ dirified.append((path, Tree().id, stat.S_IFDIR))
55+ store.add_object(Tree())
56+ else:
57+ blobs[path] = (live_entry.sha, cleanup_mode(live_entry.mode))
58 if want_unversioned:
59 for e in target.extras():
60 st = target._lstat(e)
61
62=== modified file 'breezy/tests/test_source.py'
63--- breezy/tests/test_source.py 2018-11-16 19:10:17 +0000
64+++ breezy/tests/test_source.py 2019-05-28 21:58:16 +0000
65@@ -332,10 +332,31 @@
66 new_path.insert(
67 0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools'))
68 self.overrideAttr(sys, 'path', new_path)
69- from flake8.api import legacy as flake8
70- style_guide = flake8.get_style_guide(config=u'setup.cfg', jobs="1")
71- report = style_guide.check_files(list(self.get_source_files()))
72- self.assertEqual([], report.get_statistics(''))
73+ from flake8.main.application import Application
74+ from flake8.formatting.base import BaseFormatter
75+ app = Application()
76+ app.config = u'setup.cfg'
77+ app.jobs = 1
78+
79+ class Formatter(BaseFormatter):
80+
81+ def __init__(self):
82+ self.errors = []
83+
84+ def start(self):
85+ pass
86+
87+ def stop(self):
88+ app.file_checker_manager.report()
89+
90+ def handle(self, error):
91+ self.errors.append(error)
92+
93+ app.formatter = Formatter()
94+ app.initialize([])
95+ app.run_checks()
96+ app.report()
97+ self.assertEqual(app.formatter.errors, [])
98
99 def test_no_asserts(self):
100 """bzr shouldn't use the 'assert' statement."""
101
102=== modified file 'byov.conf'
103--- byov.conf 2019-03-04 10:18:17 +0000
104+++ byov.conf 2019-05-28 21:58:16 +0000
105@@ -34,7 +34,7 @@
106 vm.release = xenial
107 byoci.setup.command = ({dulwich.clone} && {dulwich.install} && {dulwich.install3} && {fastimport.clone} && {fastimport.install} && {fastimport.install3} && {subunit.clone} && {flake8.install} && {flake8.install3} && {sphinx_epytext.install} && {sphinx_epytext.install3} && {cython.install} && {cython.install3})
108 # FIXME: bzr log -l2 should be by default -- vila 2018-03-09
109-byoci.tests.command = bash -o pipefail -c "bzr log -l2 && PYTHONPATH=../subunit/python:$PYTHONPATH PATH=../subunit/filters:$PATH make check-ci | subunit2junitxml -o ../results.xml -f | subunit2pyunit"
110+byoci.tests.command = bash -o pipefail -c "bzr log -l2 && PYTHONPATH=../subunit/python:$PYTHONPATH PATH=../subunit/filters:$HOME/.local/bin:$PATH make check-ci | subunit2junitxml -o ../results.xml -f | subunit2pyunit"
111 [brz-bionic]
112 vm.release = bionic
113 [brz-cosmic]
114@@ -45,7 +45,7 @@
115 vm.release = buster
116 vm.packages = {brz.build_deps}, {subunit.build_deps}, bzr, git, python-dulwich, python3-dulwich, python-junitxml
117 byoci.setup.command = ({subunit.clone})
118-byoci.tests.command = bash -o pipefail -c "bzr log -l2 && (PYTHONPATH=../subunit/python:$PYTHONPATH PATH=../subunit/filters:$PATH make check-ci | subunit2junitxml -o ../results.xml -f | subunit2pyunit)"
119+byoci.tests.command = bash -o pipefail -c "bzr log -l2 && (PYTHONPATH=../subunit/python:$PYTHONPATH PATH=../subunit/filters:$HOME/.local/bin:$PATH make check-ci | subunit2junitxml -o ../results.xml -f | subunit2pyunit)"
120 [brz-sid]
121 vm.distribution = debian
122 vm.release = sid

Subscribers

People subscribed via source and target branches