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

Proposed by Jelmer Vernooij on 2019-02-27
Status: Merged
Approved by: Jelmer Vernooij on 2019-03-03
Approved revision: 7291
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/cat-revision-git
Merge into: lp:brz/3.0
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
Martin Packman 2019-02-27 Approve on 2019-03-03
Review via email: mp+363694@code.launchpad.net

This proposal supersedes a proposal from 2019-02-17.

Commit message

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

Description of the change

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

To post a comment you must log in.
Martin Packman (gz) wrote :

Thanks!

review: Approve

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-27 01:43:55 +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-27 01:43:55 +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