Merge lp:~mbp/bzr/408201-testuifactory into lp:~bzr/bzr/trunk-old

Proposed by Martin Pool
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/408201-testuifactory
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 121 lines
To merge this branch: bzr merge lp:~mbp/bzr/408201-testuifactory
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+9572@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Very satisfying - this bug can be fixed by just deleting some cruft.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/408201-testuifactory into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> Very satisfying - this bug can be fixed by just deleting some cruft.
>

 review: approve
 merge: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkp256IACgkQJdeBCYSNAAOzlQCeMq58CBdEzN7MpZ7Od16RGFv+
H8cAoK89mMvRuNx8L9LoXatRqza01zpN
=9N9y
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-08-03 06:12:10 +0000
+++ NEWS 2009-08-03 13:35:20 +0000
@@ -38,13 +38,6 @@
38* BranchBuilder now accepts timezone to avoid test failures in countries far38* BranchBuilder now accepts timezone to avoid test failures in countries far
39 from GMT. (Vincent Ladeuil, #397716)39 from GMT. (Vincent Ladeuil, #397716)
4040
41* The environment variable ``BZR_PROGRESS_BAR`` set to either ``text`` or ``none``
42 always forces progress bars either on or off respectively. Otherwise,
43 they're turned on if ``TERM`` is not ``dumb`` and stderr is a terminal.
44 bzr always uses the 'text' user interface when run as a command, so
45 ``BZR_USE_TEXT_UI`` is no longer needed.
46 (Martin Pool, #339385, #387717)
47
48* ``bzr commit`` no longer saves the unversioning of missing files until41* ``bzr commit`` no longer saves the unversioning of missing files until
49 the commit has completed on the branch. This means that aborting a42 the commit has completed on the branch. This means that aborting a
50 commit that found a missing file will leave the tree unedited.43 commit that found a missing file will leave the tree unedited.
@@ -69,6 +62,10 @@
69* Fixed a NameError that occurs when merging or pulling from a URL that62* Fixed a NameError that occurs when merging or pulling from a URL that
70 causes a redirection loop when bzr tries to read a URL as a bundle.63 causes a redirection loop when bzr tries to read a URL as a bundle.
71 (Andrew Bennetts, #400847)64 (Andrew Bennetts, #400847)
65
66* Fix ``AttributeError: 'TestUIFactory' object has no attribute 'tick'``
67 running send and similar commands on 2a formats.
68 (Martin Pool, #408201)
72 69
73* Fixed export to existing directory: if directory is empty then export 70* Fixed export to existing directory: if directory is empty then export
74 will succeed, otherwise it fails with error.71 will succeed, otherwise it fails with error.
@@ -91,6 +88,13 @@
91* Streaming from bzr servers where there is a chain of stacked branches88* Streaming from bzr servers where there is a chain of stacked branches
92 (A stacked on B stacked on C) will now work. (Robert Collins, #406597)89 (A stacked on B stacked on C) will now work. (Robert Collins, #406597)
9390
91* The environment variable ``BZR_PROGRESS_BAR`` set to either ``text`` or ``none``
92 always forces progress bars either on or off respectively. Otherwise,
93 they're turned on if ``TERM`` is not ``dumb`` and stderr is a terminal.
94 bzr always uses the 'text' user interface when run as a command, so
95 ``BZR_USE_TEXT_UI`` is no longer needed.
96 (Martin Pool, #339385, #387717)
97
94* The optional ``_knit_load_data_pyx`` C extension was never being98* The optional ``_knit_load_data_pyx`` C extension was never being
95 imported. This caused significant slowdowns when reading data from99 imported. This caused significant slowdowns when reading data from
96 repositories. (Andrew Bennetts, #405653)100 repositories. (Andrew Bennetts, #405653)
97101
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py 2009-08-03 03:44:32 +0000
+++ bzrlib/tests/__init__.py 2009-08-03 13:35:20 +0000
@@ -102,6 +102,7 @@
102 TestLoader,102 TestLoader,
103 )103 )
104from bzrlib.tests.treeshape import build_tree_contents104from bzrlib.tests.treeshape import build_tree_contents
105from bzrlib.ui import NullProgressView
105from bzrlib.ui.text import TextUIFactory106from bzrlib.ui.text import TextUIFactory
106import bzrlib.version_info_formats.format_custom107import bzrlib.version_info_formats.format_custom
107from bzrlib.workingtree import WorkingTree, WorkingTreeFormat2108from bzrlib.workingtree import WorkingTree, WorkingTreeFormat2
@@ -719,7 +720,14 @@
719 Hide the progress bar but emit note()s.720 Hide the progress bar but emit note()s.
720 Redirect stdin.721 Redirect stdin.
721 Allows get_password to be tested without real tty attached.722 Allows get_password to be tested without real tty attached.
723
724 See also CannedInputUIFactory which lets you provide programmatic input in
725 a structured way.
722 """726 """
727 # XXX: Should probably unify more with CannedInputUIFactory or a
728 # particular configuration of TextUIFactory, or otherwise have a clearer
729 # idea of how they're supposed to be different.
730 # See https://bugs.edge.launchpad.net/bzr/+bug/408213
723731
724 def __init__(self, stdout=None, stderr=None, stdin=None):732 def __init__(self, stdout=None, stderr=None, stdin=None):
725 if stdin is not None:733 if stdin is not None:
@@ -730,26 +738,8 @@
730 stdin = StringIOWrapper(stdin)738 stdin = StringIOWrapper(stdin)
731 super(TestUIFactory, self).__init__(stdin, stdout, stderr)739 super(TestUIFactory, self).__init__(stdin, stdout, stderr)
732740
733 def clear(self):741 def make_progress_view(self):
734 """See progress.ProgressBar.clear()."""742 return NullProgressView()
735
736 def clear_term(self):
737 """See progress.ProgressBar.clear_term()."""
738
739 def finished(self):
740 """See progress.ProgressBar.finished()."""
741
742 def note(self, fmt_string, *args):
743 """See progress.ProgressBar.note()."""
744 if args:
745 fmt_string = fmt_string % args
746 self.stdout.write(fmt_string + "\n")
747
748 def progress_bar(self):
749 return self
750
751 def nested_progress_bar(self):
752 return self
753743
754 def update(self, message, count=None, total=None):744 def update(self, message, count=None, total=None):
755 """See progress.ProgressBar.update()."""745 """See progress.ProgressBar.update()."""
756746
=== modified file 'bzrlib/tests/test_ui.py'
--- bzrlib/tests/test_ui.py 2009-07-22 06:00:45 +0000
+++ bzrlib/tests/test_ui.py 2009-08-03 13:35:20 +0000
@@ -334,6 +334,18 @@
334 None, stdout, stdout, factory.get_boolean, "foo")334 None, stdout, stdout, factory.get_boolean, "foo")
335335
336336
337class TestUIFactoryTests(TestCase):
338
339 def test_test_ui_factory_progress(self):
340 # there's no output; we just want to make sure this doesn't crash -
341 # see https://bugs.edge.launchpad.net/bzr/+bug/408201
342 ui = TestUIFactory()
343 pb = ui.nested_progress_bar()
344 pb.update('hello')
345 pb.tick()
346 pb.finished()
347
348
337class CannedInputUIFactoryTests(TestCase):349class CannedInputUIFactoryTests(TestCase):
338 350
339 def test_canned_input_get_input(self):351 def test_canned_input_get_input(self):