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
1=== modified file 'NEWS'
2--- NEWS 2009-08-03 06:12:10 +0000
3+++ NEWS 2009-08-03 13:35:20 +0000
4@@ -38,13 +38,6 @@
5 * BranchBuilder now accepts timezone to avoid test failures in countries far
6 from GMT. (Vincent Ladeuil, #397716)
7
8-* The environment variable ``BZR_PROGRESS_BAR`` set to either ``text`` or ``none``
9- always forces progress bars either on or off respectively. Otherwise,
10- they're turned on if ``TERM`` is not ``dumb`` and stderr is a terminal.
11- bzr always uses the 'text' user interface when run as a command, so
12- ``BZR_USE_TEXT_UI`` is no longer needed.
13- (Martin Pool, #339385, #387717)
14-
15 * ``bzr commit`` no longer saves the unversioning of missing files until
16 the commit has completed on the branch. This means that aborting a
17 commit that found a missing file will leave the tree unedited.
18@@ -69,6 +62,10 @@
19 * Fixed a NameError that occurs when merging or pulling from a URL that
20 causes a redirection loop when bzr tries to read a URL as a bundle.
21 (Andrew Bennetts, #400847)
22+
23+* Fix ``AttributeError: 'TestUIFactory' object has no attribute 'tick'``
24+ running send and similar commands on 2a formats.
25+ (Martin Pool, #408201)
26
27 * Fixed export to existing directory: if directory is empty then export
28 will succeed, otherwise it fails with error.
29@@ -91,6 +88,13 @@
30 * Streaming from bzr servers where there is a chain of stacked branches
31 (A stacked on B stacked on C) will now work. (Robert Collins, #406597)
32
33+* The environment variable ``BZR_PROGRESS_BAR`` set to either ``text`` or ``none``
34+ always forces progress bars either on or off respectively. Otherwise,
35+ they're turned on if ``TERM`` is not ``dumb`` and stderr is a terminal.
36+ bzr always uses the 'text' user interface when run as a command, so
37+ ``BZR_USE_TEXT_UI`` is no longer needed.
38+ (Martin Pool, #339385, #387717)
39+
40 * The optional ``_knit_load_data_pyx`` C extension was never being
41 imported. This caused significant slowdowns when reading data from
42 repositories. (Andrew Bennetts, #405653)
43
44=== modified file 'bzrlib/tests/__init__.py'
45--- bzrlib/tests/__init__.py 2009-08-03 03:44:32 +0000
46+++ bzrlib/tests/__init__.py 2009-08-03 13:35:20 +0000
47@@ -102,6 +102,7 @@
48 TestLoader,
49 )
50 from bzrlib.tests.treeshape import build_tree_contents
51+from bzrlib.ui import NullProgressView
52 from bzrlib.ui.text import TextUIFactory
53 import bzrlib.version_info_formats.format_custom
54 from bzrlib.workingtree import WorkingTree, WorkingTreeFormat2
55@@ -719,7 +720,14 @@
56 Hide the progress bar but emit note()s.
57 Redirect stdin.
58 Allows get_password to be tested without real tty attached.
59+
60+ See also CannedInputUIFactory which lets you provide programmatic input in
61+ a structured way.
62 """
63+ # XXX: Should probably unify more with CannedInputUIFactory or a
64+ # particular configuration of TextUIFactory, or otherwise have a clearer
65+ # idea of how they're supposed to be different.
66+ # See https://bugs.edge.launchpad.net/bzr/+bug/408213
67
68 def __init__(self, stdout=None, stderr=None, stdin=None):
69 if stdin is not None:
70@@ -730,26 +738,8 @@
71 stdin = StringIOWrapper(stdin)
72 super(TestUIFactory, self).__init__(stdin, stdout, stderr)
73
74- def clear(self):
75- """See progress.ProgressBar.clear()."""
76-
77- def clear_term(self):
78- """See progress.ProgressBar.clear_term()."""
79-
80- def finished(self):
81- """See progress.ProgressBar.finished()."""
82-
83- def note(self, fmt_string, *args):
84- """See progress.ProgressBar.note()."""
85- if args:
86- fmt_string = fmt_string % args
87- self.stdout.write(fmt_string + "\n")
88-
89- def progress_bar(self):
90- return self
91-
92- def nested_progress_bar(self):
93- return self
94+ def make_progress_view(self):
95+ return NullProgressView()
96
97 def update(self, message, count=None, total=None):
98 """See progress.ProgressBar.update()."""
99
100=== modified file 'bzrlib/tests/test_ui.py'
101--- bzrlib/tests/test_ui.py 2009-07-22 06:00:45 +0000
102+++ bzrlib/tests/test_ui.py 2009-08-03 13:35:20 +0000
103@@ -334,6 +334,18 @@
104 None, stdout, stdout, factory.get_boolean, "foo")
105
106
107+class TestUIFactoryTests(TestCase):
108+
109+ def test_test_ui_factory_progress(self):
110+ # there's no output; we just want to make sure this doesn't crash -
111+ # see https://bugs.edge.launchpad.net/bzr/+bug/408201
112+ ui = TestUIFactory()
113+ pb = ui.nested_progress_bar()
114+ pb.update('hello')
115+ pb.tick()
116+ pb.finished()
117+
118+
119 class CannedInputUIFactoryTests(TestCase):
120
121 def test_canned_input_get_input(self):