Rev 4882: Drive-by review tweaks. in file:///home/vila/src/bzr/reviews/update-feedback/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Dec 14 13:16:21 GMT 2009
At file:///home/vila/src/bzr/reviews/update-feedback/
------------------------------------------------------------
revno: 4882
revision-id: v.ladeuil+lp at free.fr-20091214131621-jq2lv1nsomu31whb
parent: nmb at wartburg.edu-20091214030108-xvyzwqptc1136fxy
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: update-feedback
timestamp: Mon 2009-12-14 14:16:21 +0100
message:
Drive-by review tweaks.
* bzrlib/tests/commands/test_update.py:
Fix imports.
* bzrlib/tests/blackbox/test_filtered_view_ops.py:
Fix imports and strange access to base class methods.
(TestViewTreeOperations.test_view_on_update): Avoid os.chdir()
call, simplify string matching assertions.
* bzrlib/builtins.py:
(cmd_update.run): Fix spurious space.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2009-12-12 20:07:06 +0000
+++ b/bzrlib/builtins.py 2009-12-14 13:16:21 +0000
@@ -1415,8 +1415,8 @@
if master is None or last_rev == _mod_revision.ensure_null(
master.last_revision()):
revno = tree.branch.revision_id_to_revno(last_rev)
- note("Tree is up to date at revision %d of branch %s." %
- (revno, branch_location))
+ note("Tree is up to date at revision %d of branch %s"
+ % (revno, branch_location))
return 0
view_info = _get_view_info_for_change_reporter(tree)
conflicts = tree.update(
=== modified file 'bzrlib/tests/blackbox/test_filtered_view_ops.py'
--- a/bzrlib/tests/blackbox/test_filtered_view_ops.py 2009-12-12 20:07:06 +0000
+++ b/bzrlib/tests/blackbox/test_filtered_view_ops.py 2009-12-14 13:16:21 +0000
@@ -18,19 +18,19 @@
import os
-from bzrlib import bzrdir
-from bzrlib.tests import TestCaseWithTransport
-from bzrlib.workingtree import WorkingTree
-
-
-class TestViewFileOperations(TestCaseWithTransport):
+from bzrlib import (
+ bzrdir,
+ tests,
+ )
+
+
+class TestViewFileOperations(tests.TestCaseWithTransport):
def make_abc_tree_with_ab_view(self):
# we need to use a specific format because the default format
# doesn't support views yet
format = bzrdir.format_registry.make_bzrdir('development6-rich-root')
- wt = TestCaseWithTransport.make_branch_and_tree(self, '.',
- format=format)
+ wt = self.make_branch_and_tree( '.', format=format)
self.build_tree(['a', 'b', 'c'])
wt.views.set_view('my', ['a', 'b'])
return wt
@@ -152,15 +152,14 @@
self.assertEquals('b', out_lines[1])
-class TestViewTreeOperationss(TestCaseWithTransport):
+class TestViewTreeOperations(tests.TestCaseWithTransport):
def make_abc_tree_and_clone_with_ab_view(self):
# we need to use a specific format because the default format
# doesn't support views yet
format = bzrdir.format_registry.make_bzrdir('development6-rich-root')
# Build the first tree
- wt1 = TestCaseWithTransport.make_branch_and_tree(self, 'tree_1',
- format=format)
+ wt1 = self.make_branch_and_tree('tree_1', format=format)
self.build_tree(['tree_1/a', 'tree_1/b', 'tree_1/c'])
wt1.add(['a', 'b', 'c'])
wt1.commit("adding a b c")
@@ -186,14 +185,15 @@
def test_view_on_update(self):
tree_1, tree_2 = self.make_abc_tree_and_clone_with_ab_view()
- os.chdir("tree_2")
- self.run_bzr("bind ../tree_1")
- out, err = self.run_bzr('update')
- self.assertStartsWith(err,
- "Operating on whole tree but only reporting on 'my' view.\n"
- " M a\n"
- "All changes applied successfully.\n")
- self.assertContainsRe(err, "Updated to revision 2 of branch .*.")
+ self.run_bzr("bind ../tree_1", working_dir='tree_2')
+ out, err = self.run_bzr('update', working_dir='tree_2')
+ err_lines = err.split('\n')
+ self.assertStartsWith(
+ err,
+ """Operating on whole tree but only reporting on 'my' view.
+ M a
+All changes applied successfully.
+Updated to revision 2 of branch """)
self.assertEqualDiff("", out)
def test_view_on_merge(self):
=== modified file 'bzrlib/tests/commands/test_update.py'
--- a/bzrlib/tests/commands/test_update.py 2009-12-12 20:07:06 +0000
+++ b/bzrlib/tests/commands/test_update.py 2009-12-14 13:16:21 +0000
@@ -18,8 +18,9 @@
from bzrlib import (
branch,
builtins,
+ tests,
)
-from bzrlib.tests import transport_util, StringIOWrapper
+from bzrlib.tests import transport_util
class TestUpdate(transport_util.TestCaseWithConnectionHookedTransport):
@@ -37,7 +38,7 @@
update = builtins.cmd_update()
# update needs the encoding from outf to print URLs
- update.outf = StringIOWrapper()
+ update.outf = tests.StringIOWrapper()
# update calls it 'dir' where other commands calls it 'directory'
update.run(dir='local')
self.assertEquals(1, len(self.connections))
More information about the bazaar-commits
mailing list