Merge lp:~jelmer/brz/cat-revision-git into lp:brz

Proposed by Jelmer Vernooij
Status: Superseded
Proposed branch: lp:~jelmer/brz/cat-revision-git
Merge into: lp:brz
Diff against target: 37 lines (+11/-2)
2 files modified
breezy/builtins.py (+2/-2)
breezy/git/tests/test_blackbox.py (+9/-0)
To merge this branch: bzr merge lp:~jelmer/brz/cat-revision-git
Reviewer Review Type Date Requested Status
Breezy developers Pending
Review via email: mp+363290@code.launchpad.net

This proposal has been superseded by a proposal from 2019-02-27.

Description of the change

Print proper error when running `brz cat-revision` on Git repositories.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/builtins.py'
2--- breezy/builtins.py 2019-02-09 03:23:20 +0000
3+++ breezy/builtins.py 2019-02-17 04:20:43 +0000
4@@ -454,11 +454,11 @@
5
6 b = controldir.ControlDir.open_containing_tree_or_branch(directory)[1]
7
8- revisions = b.repository.revisions
9+ revisions = getattr(b.repository, "revisions", None)
10 if revisions is None:
11 raise errors.BzrCommandError(
12 gettext('Repository %r does not support '
13- 'access to raw revision texts'))
14+ 'access to raw revision texts') % b.repository)
15
16 with b.repository.lock_read():
17 # TODO: jam 20060112 should cat-revision always output utf-8?
18
19=== modified file 'breezy/git/tests/test_blackbox.py'
20--- breezy/git/tests/test_blackbox.py 2019-02-14 04:20:37 +0000
21+++ breezy/git/tests/test_blackbox.py 2019-02-17 04:20:43 +0000
22@@ -78,6 +78,15 @@
23 self.assertEqual(output, '')
24 self.assertFileEqual("foo\n", ".gitignore")
25
26+ def test_cat_revision(self):
27+ self.simple_commit()
28+ output, error = self.run_bzr(['cat-revision', '-r-1'], retcode=3)
29+ self.assertContainsRe(
30+ error,
31+ 'brz: ERROR: Repository .* does not support access to raw '
32+ 'revision texts')
33+ self.assertEqual(output, '')
34+
35 def test_branch(self):
36 os.mkdir("gitbranch")
37 GitRepo.init(os.path.join(self.test_dir, "gitbranch"))

Subscribers

People subscribed via source and target branches