[PATCH] fix for bzr rm -v
Wouter van Heyst
larstiq at larstiq.dyndns.org
Fri Dec 9 18:41:21 GMT 2005
Attached is a testcase and oneline fix for 'bzr rm -v hello.txt' (as
suggested in http://bazaar.canonical.com/IntroductionToBzr) failing
because show_status is not known.
My first guess was to use bzrlib.status.show_status. Wrong idea,
the code actually wants to use bzrlib.textui.show_status. Now, this does
make it work again, but I'm not sure textui should be used from
WorkingTree. What do others think?
Wouter van Heyst
-------------- next part --------------
=== added file 'bzrlib/tests/test_remove.py'
--- /dev/null
+++ bzrlib/tests/test_remove.py
@@ -0,0 +1,12 @@
+from bzrlib.tests import TestCaseInTempDir
+from bzrlib.branch import Branch
+
+class TestRemove(TestCaseInTempDir):
+ def test_remove_verbose(self):
+ b = Branch.initialize(u'.')
+ self.build_tree(['hello'])
+ wt = b.working_tree()
+ wt.add(['hello'])
+ wt.commit(message='add hello')
+ eq = self.assertEquals
+ wt.remove(['hello'], verbose=True)
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py
+++ bzrlib/tests/__init__.py
@@ -657,6 +657,7 @@
'bzrlib.tests.test_rio',
'bzrlib.tests.test_msgeditor',
'bzrlib.tests.test_selftest',
+ 'bzrlib.tests.test_remove',
]
print '%10s: %s' % ('bzr', os.path.realpath(sys.argv[0]))
=== modified file 'bzrlib/workingtree.py'
--- bzrlib/workingtree.py
+++ bzrlib/workingtree.py
@@ -69,6 +69,7 @@
realpath,
relpath,
rename)
+from bzrlib.textui import show_status
import bzrlib.tree
from bzrlib.trace import mutter
import bzrlib.xml5
More information about the bazaar
mailing list