Merge lp:~vila/bzr-loom/528472-depreation-warnings into lp:bzr-loom

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vila/bzr-loom/528472-depreation-warnings
Merge into: lp:bzr-loom
Diff against target: 75 lines (+20/-17)
2 files modified
NEWS (+4/-0)
tree.py (+16/-17)
To merge this branch: bzr merge lp:~vila/bzr-loom/528472-depreation-warnings
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+20222@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

This patch fixes some 2.1.0 deprecation warnings related to merge progress bars and trace.info usage.

Revision history for this message
Robert Collins (lifeless) wrote :

 review: +1

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-09-22 03:43:00 +0000
3+++ NEWS 2010-02-26 14:36:18 +0000
4@@ -17,6 +17,10 @@
5
6 BUGFIXES:
7
8+ * Stop using APIs deprecated for 2.1.0 (child progress bars for
9+ merge and trace.info).
10+ (Vincent Ladeuil, #528472)
11+
12 API BREAKS:
13
14 TESTING:
15
16=== modified file 'tree.py'
17--- tree.py 2009-06-18 06:28:18 +0000
18+++ tree.py 2010-02-26 14:36:18 +0000
19@@ -24,7 +24,10 @@
20 __all__ = ['LoomTreeDecorator']
21
22
23-from bzrlib import ui
24+from bzrlib import (
25+ trace,
26+ ui,
27+ )
28 from bzrlib.decorators import needs_write_lock
29 import bzrlib.errors
30 import bzrlib.revision
31@@ -87,19 +90,15 @@
32 # merge the tree up into the new patch:
33 if merge_type is None:
34 merge_type = bzrlib.merge.Merge3Merger
35- pb = ui.ui_factory.nested_progress_bar()
36 try:
37- try:
38- merge_controller = bzrlib.merge.Merger.from_revision_ids(
39- pb, self.tree, new_thread_rev, revision_graph=graph)
40- except bzrlib.errors.UnrelatedBranches:
41- raise bzrlib.errors.BzrCommandError('corrupt loom: thread %s'
42- ' has no common ancestor with thread %s'
43- % (new_thread_name, threadname))
44- merge_controller.merge_type = merge_type
45- result = merge_controller.do_merge()
46- finally:
47- pb.finished()
48+ merge_controller = bzrlib.merge.Merger.from_revision_ids(
49+ None, self.tree, new_thread_rev, revision_graph=graph)
50+ except bzrlib.errors.UnrelatedBranches:
51+ raise bzrlib.errors.BzrCommandError('corrupt loom: thread %s'
52+ ' has no common ancestor with thread %s'
53+ % (new_thread_name, threadname))
54+ merge_controller.merge_type = merge_type
55+ result = merge_controller.do_merge()
56 # change the tree to the revision of the new thread.
57 parent_trees = []
58 if new_thread_rev != bzrlib.revision.NULL_REVISION:
59@@ -127,12 +126,12 @@
60 self.tree.branch.generate_revision_history(new_thread_rev)
61 # update the branch nick.
62 self.tree.branch.nick = new_thread_name
63- bzrlib.trace.note("Moved to thread '%s'." % new_thread_name)
64- if (basis_tree is not None and
65+ trace.note("Moved to thread '%s'." % new_thread_name)
66+ if (basis_tree is not None and
67 not result and not
68 self.tree.changes_from(basis_tree).has_changed()):
69- bzrlib.trace.info("This thread is now empty, you may wish to "
70- 'run "bzr combine-thread" to remove it.')
71+ trace.note("This thread is now empty, you may wish to "
72+ 'run "bzr combine-thread" to remove it.')
73 if result != 0:
74 return 1
75 else:

Subscribers

People subscribed via source and target branches