[patch] new merge tests suggested by Aaron
John Arbash Meinel
john at arbash-meinel.com
Wed Dec 21 15:38:30 GMT 2005
duchier at ps.uni-sb.de wrote:
> Hi Martin,
>
> Please consider applying this patch to bzr.dev. It provides
> additional merge tests suggested by Aaron. It differs from my
> previous [rfc] post in that docstrings have been revised to follow
> conventions (as suggested by John) and redundant test 5 (spotted by
> Aaron) was removed.
>
>
Actually, PEP8 states that single line comments are meant to have the
""" on the same line.
So you have:
def function(foo):
"""single line comment"""
def function2(baz):
"""summary comment.
And this is the rest of the
multiline comment.
"""
I really liked the more verbose comments, since they described what was
going on, and what the motivation was.
I just wanted the single-line summary at the top.
Otherwise I am +1 on the new tests. As I believe Martin was. As I recall
he just wanted the reformatting done.
So if you can reformat it one more time, I'll apply it to my integration
branch.
John
=:->
>
> ------------------------------------------------------------------------
>
> === modified file 'bzrlib/tests/test_merge_core.py'
> --- bzrlib/tests/test_merge_core.py
> +++ bzrlib/tests/test_merge_core.py
> @@ -712,3 +712,79 @@
> merge(['b', -1],['b', 1],this_dir='a')
> self.assert_(os.path.exists('a/file'))
> self.assertEqual(file('a/file').read(),'THAT')
> +
> + def test_merge_abentley_1(self):
> + """rename before create
> + """
> + os.mkdir('a')
> + a = Branch.initialize('a')
> + file('a/foo', 'wb').write('A/FOO')
> + a_wt = a.working_tree()
> + a_wt.add('foo')
> + a_wt.commit('added foo')
> + copy_branch(a, 'b')
> + b = Branch.open('b')
> + b_wt = b.working_tree()
> + b_wt.rename_one('foo', 'bar')
> + file('b/foo', 'wb').write('B/FOO')
> + b_wt.add('foo')
> + b_wt.commit('moved foo to bar, added new foo')
> + merge(['b', -1],['b', 1],this_dir='a')
> +
> + def test_merge_abentley_2(self):
> + """create before rename, target parents before children
> + """
> + os.mkdir('a')
> + a = Branch.initialize('a')
> + file('a/foo', 'wb').write('A/FOO')
> + a_wt = a.working_tree()
> + a_wt.add('foo')
> + a_wt.commit('added foo')
> + copy_branch(a, 'b')
> + b = Branch.open('b')
> + b_wt = b.working_tree()
> + os.mkdir('b/bar')
> + b_wt.add('bar')
> + b_wt.rename_one('foo', 'bar/foo')
> + b_wt.commit('created bar dir, moved foo into bar')
> + merge(['b', -1],['b', 1],this_dir='a')
> +
> + def test_merge_abentley_3(self):
> + """rename to temp before delete, source children before parents
> + """
> + os.mkdir('a')
> + a = Branch.initialize('a')
> + os.mkdir('a/foo')
> + file('a/foo/bar', 'wb').write('A/FOO/BAR')
> + a_wt = a.working_tree()
> + a_wt.add('foo')
> + a_wt.add('foo/bar')
> + a_wt.commit('added foo/bar')
> + copy_branch(a, 'b')
> + b = Branch.open('b')
> + b_wt = b.working_tree()
> + b_wt.rename_one('foo/bar', 'bar')
> + os.rmdir('b/foo')
> + b_wt.remove('foo')
> + b_wt.commit('moved foo/bar to bar, deleted foo')
> + merge(['b', -1],['b', 1],this_dir='a')
> +
> + def test_merge_abentley_4(self):
> + """delete before rename to temp
> + """
> + os.mkdir('a')
> + a = Branch.initialize('a')
> + file('a/foo', 'wb').write('A/FOO')
> + file('a/bar', 'wb').write('A/BAR')
> + a_wt = a.working_tree()
> + a_wt.add('foo')
> + a_wt.add('bar')
> + a_wt.commit('added foo and bar')
> + copy_branch(a, 'b')
> + b = Branch.open('b')
> + b_wt = b.working_tree()
> + os.unlink('b/foo')
> + b_wt.remove('foo')
> + b_wt.rename_one('bar', 'foo')
> + b_wt.commit('deleted foo, renamed bar to foo')
> + merge(['b', -1],['b', 1],this_dir='a')
>
>
>
> ------------------------------------------------------------------------
>
>
> --Denys
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051221/9186dd89/attachment.pgp
More information about the bazaar
mailing list