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
=== modified file 'breezy/builtins.py'
--- breezy/builtins.py 2019-02-09 03:23:20 +0000
+++ breezy/builtins.py 2019-02-27 01:43:55 +0000
@@ -454,11 +454,11 @@
454454
455 b = controldir.ControlDir.open_containing_tree_or_branch(directory)[1]455 b = controldir.ControlDir.open_containing_tree_or_branch(directory)[1]
456456
457 revisions = b.repository.revisions457 revisions = getattr(b.repository, "revisions", None)
458 if revisions is None:458 if revisions is None:
459 raise errors.BzrCommandError(459 raise errors.BzrCommandError(
460 gettext('Repository %r does not support '460 gettext('Repository %r does not support '
461 'access to raw revision texts'))461 'access to raw revision texts') % b.repository)
462462
463 with b.repository.lock_read():463 with b.repository.lock_read():
464 # TODO: jam 20060112 should cat-revision always output utf-8?464 # TODO: jam 20060112 should cat-revision always output utf-8?
465465
=== modified file 'breezy/git/tests/test_blackbox.py'
--- breezy/git/tests/test_blackbox.py 2019-02-14 04:20:37 +0000
+++ breezy/git/tests/test_blackbox.py 2019-02-27 01:43:55 +0000
@@ -78,6 +78,15 @@
78 self.assertEqual(output, '')78 self.assertEqual(output, '')
79 self.assertFileEqual("foo\n", ".gitignore")79 self.assertFileEqual("foo\n", ".gitignore")
8080
81 def test_cat_revision(self):
82 self.simple_commit()
83 output, error = self.run_bzr(['cat-revision', '-r-1'], retcode=3)
84 self.assertContainsRe(
85 error,
86 'brz: ERROR: Repository .* does not support access to raw '
87 'revision texts')
88 self.assertEqual(output, '')
89
81 def test_branch(self):90 def test_branch(self):
82 os.mkdir("gitbranch")91 os.mkdir("gitbranch")
83 GitRepo.init(os.path.join(self.test_dir, "gitbranch"))92 GitRepo.init(os.path.join(self.test_dir, "gitbranch"))

Subscribers

People subscribed via source and target branches