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
=== modified file 'NEWS'
--- NEWS 2009-09-22 03:43:00 +0000
+++ NEWS 2010-02-26 14:36:18 +0000
@@ -17,6 +17,10 @@
1717
18 BUGFIXES:18 BUGFIXES:
1919
20 * Stop using APIs deprecated for 2.1.0 (child progress bars for
21 merge and trace.info).
22 (Vincent Ladeuil, #528472)
23
20 API BREAKS:24 API BREAKS:
2125
22 TESTING:26 TESTING:
2327
=== modified file 'tree.py'
--- tree.py 2009-06-18 06:28:18 +0000
+++ tree.py 2010-02-26 14:36:18 +0000
@@ -24,7 +24,10 @@
24__all__ = ['LoomTreeDecorator']24__all__ = ['LoomTreeDecorator']
2525
2626
27from bzrlib import ui27from bzrlib import (
28 trace,
29 ui,
30 )
28from bzrlib.decorators import needs_write_lock31from bzrlib.decorators import needs_write_lock
29import bzrlib.errors32import bzrlib.errors
30import bzrlib.revision33import bzrlib.revision
@@ -87,19 +90,15 @@
87 # merge the tree up into the new patch:90 # merge the tree up into the new patch:
88 if merge_type is None:91 if merge_type is None:
89 merge_type = bzrlib.merge.Merge3Merger92 merge_type = bzrlib.merge.Merge3Merger
90 pb = ui.ui_factory.nested_progress_bar()
91 try:93 try:
92 try:94 merge_controller = bzrlib.merge.Merger.from_revision_ids(
93 merge_controller = bzrlib.merge.Merger.from_revision_ids(95 None, self.tree, new_thread_rev, revision_graph=graph)
94 pb, self.tree, new_thread_rev, revision_graph=graph)96 except bzrlib.errors.UnrelatedBranches:
95 except bzrlib.errors.UnrelatedBranches:97 raise bzrlib.errors.BzrCommandError('corrupt loom: thread %s'
96 raise bzrlib.errors.BzrCommandError('corrupt loom: thread %s'98 ' has no common ancestor with thread %s'
97 ' has no common ancestor with thread %s'99 % (new_thread_name, threadname))
98 % (new_thread_name, threadname))100 merge_controller.merge_type = merge_type
99 merge_controller.merge_type = merge_type101 result = merge_controller.do_merge()
100 result = merge_controller.do_merge()
101 finally:
102 pb.finished()
103 # change the tree to the revision of the new thread.102 # change the tree to the revision of the new thread.
104 parent_trees = []103 parent_trees = []
105 if new_thread_rev != bzrlib.revision.NULL_REVISION:104 if new_thread_rev != bzrlib.revision.NULL_REVISION:
@@ -127,12 +126,12 @@
127 self.tree.branch.generate_revision_history(new_thread_rev)126 self.tree.branch.generate_revision_history(new_thread_rev)
128 # update the branch nick.127 # update the branch nick.
129 self.tree.branch.nick = new_thread_name128 self.tree.branch.nick = new_thread_name
130 bzrlib.trace.note("Moved to thread '%s'." % new_thread_name)129 trace.note("Moved to thread '%s'." % new_thread_name)
131 if (basis_tree is not None and 130 if (basis_tree is not None and
132 not result and not131 not result and not
133 self.tree.changes_from(basis_tree).has_changed()):132 self.tree.changes_from(basis_tree).has_changed()):
134 bzrlib.trace.info("This thread is now empty, you may wish to "133 trace.note("This thread is now empty, you may wish to "
135 'run "bzr combine-thread" to remove it.')134 'run "bzr combine-thread" to remove it.')
136 if result != 0:135 if result != 0:
137 return 1136 return 1
138 else:137 else:

Subscribers

People subscribed via source and target branches