Merge lp:~jelmer/brz/log-per-file 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/log-per-file
Merge into: lp:brz/3.0
Diff against target: 85 lines (+29/-3)
4 files modified
breezy/git/annotate.py (+2/-1)
breezy/git/filegraph.py (+2/-2)
breezy/git/tests/test_blackbox.py (+22/-0)
doc/en/release-notes/brz-3.0.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/log-per-file
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+374410@code.launchpad.net

Commit message

Fix filegraph operations on Git.

Description of the change

Fix filegraph operations on Git.

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
=== modified file 'breezy/git/annotate.py'
--- breezy/git/annotate.py 2018-11-11 14:23:06 +0000
+++ breezy/git/annotate.py 2019-11-17 23:21:06 +0000
@@ -100,11 +100,12 @@
100 self.change_scanner.repository.lookup_bzr_revision_id(100 self.change_scanner.repository.lookup_bzr_revision_id(
101 text_revision))101 text_revision))
102 text_parents = []102 text_parents = []
103 path = path.encode('utf-8')
103 for commit_parent in self.store[commit_id].parents:104 for commit_parent in self.store[commit_id].parents:
104 try:105 try:
105 (path, text_parent) = (106 (path, text_parent) = (
106 self.change_scanner.find_last_change_revision(107 self.change_scanner.find_last_change_revision(
107 path.encode('utf-8'), commit_parent))108 path, commit_parent))
108 except KeyError:109 except KeyError:
109 continue110 continue
110 if text_parent not in text_parents:111 if text_parent not in text_parents:
111112
=== modified file 'breezy/git/filegraph.py'
--- breezy/git/filegraph.py 2018-11-11 14:23:06 +0000
+++ breezy/git/filegraph.py 2019-11-17 23:21:06 +0000
@@ -84,7 +84,7 @@
84 self.change_scanner.repository.lookup_bzr_revision_id(84 self.change_scanner.repository.lookup_bzr_revision_id(
85 text_revision))85 text_revision))
86 try:86 try:
87 path = mapping.parse_file_id(file_id)87 path = mapping.parse_file_id(file_id).encode('utf-8')
88 except ValueError:88 except ValueError:
89 raise KeyError(file_id)89 raise KeyError(file_id)
90 text_parents = []90 text_parents = []
@@ -92,7 +92,7 @@
92 try:92 try:
93 (path, text_parent) = (93 (path, text_parent) = (
94 self.change_scanner.find_last_change_revision(94 self.change_scanner.find_last_change_revision(
95 path.encode('utf-8'), commit_parent))95 path, commit_parent))
96 except KeyError:96 except KeyError:
97 continue97 continue
98 if text_parent not in text_parents:98 if text_parent not in text_parents:
9999
=== modified file 'breezy/git/tests/test_blackbox.py'
--- breezy/git/tests/test_blackbox.py 2019-06-16 21:40:13 +0000
+++ breezy/git/tests/test_blackbox.py 2019-11-17 23:21:06 +0000
@@ -169,6 +169,28 @@
169 # Check that bzr log does not fail and includes the revision.169 # Check that bzr log does not fail and includes the revision.
170 output, error = self.run_bzr(['log', '-v'])170 output, error = self.run_bzr(['log', '-v'])
171171
172 def test_log_file(self):
173 # Smoke test for "bzr log" in a git repository.
174 repo = GitRepo.init(self.test_dir)
175 builder = tests.GitBranchBuilder()
176 builder.set_file('a', b'text for a\n', False)
177 r1 = builder.commit(b'Joe Foo <joe@foo.com>', u'First')
178 builder.set_file('a', b'text 3a for a\n', False)
179 r2a = builder.commit(b'Joe Foo <joe@foo.com>', u'Second a', base=r1)
180 builder.set_file('a', b'text 3b for a\n', False)
181 r2b = builder.commit(b'Joe Foo <joe@foo.com>', u'Second b', base=r1)
182 builder.set_file('a', b'text 4 for a\n', False)
183 builder.commit(b'Joe Foo <joe@foo.com>', u'Third', merge=[r2a], base=r2b)
184 builder.finish()
185
186 # Check that bzr log does not fail and includes the revision.
187 output, error = self.run_bzr(['log', '-n2', 'a'])
188 self.assertEqual(error, '')
189 self.assertIn('Second a', output)
190 self.assertIn('Second b', output)
191 self.assertIn('First', output)
192 self.assertIn('Third', output)
193
172 def test_tags(self):194 def test_tags(self):
173 git_repo, commit_sha1 = self.simple_commit()195 git_repo, commit_sha1 = self.simple_commit()
174 git_repo.refs[b"refs/tags/foo"] = commit_sha1196 git_repo.refs[b"refs/tags/foo"] = commit_sha1
175197
=== modified file 'doc/en/release-notes/brz-3.0.txt'
--- doc/en/release-notes/brz-3.0.txt 2019-11-17 21:06:21 +0000
+++ doc/en/release-notes/brz-3.0.txt 2019-11-17 23:21:06 +0000
@@ -36,6 +36,9 @@
36 significantly slow down startup on some platforms.36 significantly slow down startup on some platforms.
37 (Jelmer Vernooij, #1832868)37 (Jelmer Vernooij, #1832868)
3838
39 * Fix file graph operations on Git repositories.
40 (Jelmer Vernooij, #1847913)
41
39 * Allow running tests without launchpadlib installed.42 * Allow running tests without launchpadlib installed.
40 (Jelmer Vernooij, #1849988)43 (Jelmer Vernooij, #1849988)
4144

Subscribers

People subscribed via source and target branches