Merge lp:~lifeless/bzr/update into lp:bzr

Proposed by Robert Collins
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr/update
Merge into: lp:bzr
Diff against target: 80 lines (+47/-1)
3 files modified
NEWS (+4/-0)
bzrlib/builtins.py (+2/-1)
bzrlib/tests/blackbox/test_update.py (+41/-0)
To merge this branch: bzr merge lp:~lifeless/bzr/update
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+23372@code.launchpad.net

Commit message

(robertc) Do not warn when updating if a pending merge was merged into trunk. (Robert Collins, bug 562079)

Description of the change

This should go into 2.2 I think. I had thought it was a regression, but its not, however a partial fix is very simple - attached. A more comprehensive fix would need changed apis or history analysis, neither of which is worth it at the moment, I think.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

Looks good. Doesn't seem like this would be a regression, but it is a positive improvement.

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

Queued on 2010-04-14 04:57:09.021514+00:00 now submitted to PQM.

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

Queued on 2010-04-14 04:57:09.021514+00:00 now submitted to PQM.

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

Sorry for the spam, was testing-live a tweak.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-04-14 04:35:47 +0000
+++ NEWS 2010-04-14 04:51:18 +0000
@@ -28,6 +28,10 @@
28 True explicitly to get the previous behaviour. 28 True explicitly to get the previous behaviour.
29 (Vincent Ladeuil, #519319)29 (Vincent Ladeuil, #519319)
3030
31* ``bzr update`` when a pending merge in the working tree has been merged
32 into the master branch will no longer claim that old commits have become
33 pending merges. (Robert Collins, #562079)
34
31* ``bzrlib.mutabletree.MutableTree.commit`` will now support a passed in35* ``bzrlib.mutabletree.MutableTree.commit`` will now support a passed in
32 config as in previous versions of bzrlib. (Robert Collins)36 config as in previous versions of bzrlib. (Robert Collins)
3337
3438
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2010-04-14 04:35:47 +0000
+++ bzrlib/builtins.py 2010-04-14 04:51:18 +0000
@@ -1462,7 +1462,8 @@
1462 _mod_revision.ensure_null(tree.last_revision()))1462 _mod_revision.ensure_null(tree.last_revision()))
1463 note('Updated to revision %s of branch %s' %1463 note('Updated to revision %s of branch %s' %
1464 ('.'.join(map(str, revno)), branch_location))1464 ('.'.join(map(str, revno)), branch_location))
1465 if tree.get_parent_ids()[1:] != existing_pending_merges:1465 parent_ids = tree.get_parent_ids()
1466 if parent_ids[1:] and parent_ids[1:] != existing_pending_merges:
1466 note('Your local commits will now show as pending merges with '1467 note('Your local commits will now show as pending merges with '
1467 "'bzr status', and can be committed with 'bzr commit'.")1468 "'bzr status', and can be committed with 'bzr commit'.")
1468 if conflicts != 0:1469 if conflicts != 0:
14691470
=== modified file 'bzrlib/tests/blackbox/test_update.py'
--- bzrlib/tests/blackbox/test_update.py 2010-03-31 18:11:51 +0000
+++ bzrlib/tests/blackbox/test_update.py 2010-04-14 04:51:18 +0000
@@ -241,6 +241,47 @@
241 tree.commit('empty commit')241 tree.commit('empty commit')
242 self.run_bzr('update checkout')242 self.run_bzr('update checkout')
243243
244 def test_update_with_merge_merged_to_master(self):
245 # Test that 'bzr update' works correctly when you have
246 # an update in the master tree, and a [lightweight or otherwise]
247 # checkout which has merge a revision merged to master already.
248 master = self.make_branch_and_tree('master')
249 self.build_tree(['master/file'])
250 master.add(['file'])
251 master.commit('one', rev_id='m1')
252
253 self.build_tree(['checkout1/'])
254 checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1')
255 branch.BranchReferenceFormat().initialize(checkout_dir,
256 target_branch=master.branch)
257 checkout1 = checkout_dir.create_workingtree('m1')
258
259 # Create a second branch, with an extra commit
260 other = master.bzrdir.sprout('other').open_workingtree()
261 self.build_tree(['other/file2'])
262 other.add(['file2'])
263 other.commit('other2', rev_id='o2')
264
265 # Merge the other branch into checkout - 'start reviewing a patch'
266 checkout1.merge_from_branch(other.branch)
267 self.assertEqual(['o2'], checkout1.get_parent_ids()[1:])
268
269 # Create a new commit in the master branch - 'someone else lands its'
270 master.merge_from_branch(other.branch)
271 master.commit('f3', rev_id='m2')
272
273 # This should not report about local commits being pending
274 # merges, because they were real merges (but are now gone).
275 # It should perhaps report on them.
276 out, err = self.run_bzr('update', working_dir='checkout1')
277 self.assertEqual('', out)
278 self.assertEqualDiff('''All changes applied successfully.
279Updated to revision 2 of branch %s
280''' % osutils.pathjoin(self.test_dir, 'master',),
281 err)
282 # The pending merges should still be there
283 self.assertEqual([], checkout1.get_parent_ids()[1:])
284
244 def test_update_dash_r(self):285 def test_update_dash_r(self):
245 master = self.make_branch_and_tree('master')286 master = self.make_branch_and_tree('master')
246 os.chdir('master')287 os.chdir('master')