[MERGE][Bug #52479] Message at the end of commit for bound branches

Andrew Bennetts andrew at canonical.com
Sun Aug 26 01:41:23 BST 2007


Daniel Watkins wrote:
> If a branch is bound, this bundle adds details of its master branch to
> the 'Committed revision...' message.
> 

I like this change.  The test could be a little neater though.

bb:tweak

> === modified file 'bzrlib/tests/blackbox/test_commit.py'
> --- bzrlib/tests/blackbox/test_commit.py	2007-08-07 14:57:35 +0000
> +++ bzrlib/tests/blackbox/test_commit.py	2007-08-25 19:02:06 +0000
> @@ -152,6 +152,20 @@
>                           'Committed revision 2.\n',
>                           err)
>  
> +    def test_verbose_bound_commit_includes_master_location(self):
> +        """Location of master is included when committing to bound branch"""

I think “is displayed” would be clearer here than “is included”.  “is included”
makes me wonder “included where?  In the revision data?”.

> +        a_tree = self.make_branch_and_tree('a')
> +        self.build_tree(['a/b'])
> +        a_tree.add('b')
> +        a_tree.commit(message='Initial message')
> +
> +        b_tree = a_tree.branch.create_checkout('b')
> +        self.build_tree_contents([('a/b', 'foo')])

Why do you call “self.build_tree_contents([('a/b', 'foo')])”?  It seems to have
no relevance to the rest of the test.

> +        expected = "file://" + os.getcwd() + "/a/"

You can just use “expected = self.get_url('a')” here.

> +        os.chdir('b')
> +        out, err = self.run_bzr('commit -m blah --unchanged')
> +        self.assertEqual(err, 'Committed revision 2 to "%s".\n' % expected)
> +

Also, you can use “self.run_bzr(..., working_dir='b')” rather than calling
os.chdir.

-Andrew.




More information about the bazaar mailing list