Rev 5152: ``bzr update`` when a pending merge in the working tree has been merged in http://bazaar.launchpad.net/~lifeless/bzr/update
Robert Collins
robertc at robertcollins.net
Wed Apr 14 05:48:08 BST 2010
At http://bazaar.launchpad.net/~lifeless/bzr/update
------------------------------------------------------------
revno: 5152
revision-id: robertc at robertcollins.net-20100414044800-wda5phry84h497pn
parent: pqm at pqm.ubuntu.com-20100413091953-ow6ds0g52xn734v5
committer: Robert Collins <robertc at robertcollins.net>
branch nick: update
timestamp: Wed 2010-04-14 14:48:00 +1000
message:
``bzr update`` when a pending merge in the working tree has been merged
into the master branch will no longer claim that old commits have become
pending merges. (Robert Collins, #562079)
=== modified file 'NEWS'
--- a/NEWS 2010-04-13 09:19:53 +0000
+++ b/NEWS 2010-04-14 04:48:00 +0000
@@ -28,6 +28,10 @@
True explicitly to get the previous behaviour.
(Vincent Ladeuil, #519319)
+* ``bzr update`` when a pending merge in the working tree has been merged
+ into the master branch will no longer claim that old commits have become
+ pending merges. (Robert Collins, #562079)
+
* ``bzrlib.mutabletree.MutableTree.commit`` will now support a passed in
config as in previous versions of bzrlib. (Robert Collins)
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2010-04-13 09:19:53 +0000
+++ b/bzrlib/builtins.py 2010-04-14 04:48:00 +0000
@@ -1462,7 +1462,8 @@
_mod_revision.ensure_null(tree.last_revision()))
note('Updated to revision %s of branch %s' %
('.'.join(map(str, revno)), branch_location))
- if tree.get_parent_ids()[1:] != existing_pending_merges:
+ parent_ids = tree.get_parent_ids()
+ if parent_ids[1:] and parent_ids[1:] != existing_pending_merges:
note('Your local commits will now show as pending merges with '
"'bzr status', and can be committed with 'bzr commit'.")
if conflicts != 0:
=== modified file 'bzrlib/tests/blackbox/test_update.py'
--- a/bzrlib/tests/blackbox/test_update.py 2010-03-31 18:11:51 +0000
+++ b/bzrlib/tests/blackbox/test_update.py 2010-04-14 04:48:00 +0000
@@ -241,6 +241,47 @@
tree.commit('empty commit')
self.run_bzr('update checkout')
+ def test_update_with_merge_merged_to_master(self):
+ # Test that 'bzr update' works correctly when you have
+ # an update in the master tree, and a [lightweight or otherwise]
+ # checkout which has merge a revision merged to master already.
+ master = self.make_branch_and_tree('master')
+ self.build_tree(['master/file'])
+ master.add(['file'])
+ master.commit('one', rev_id='m1')
+
+ self.build_tree(['checkout1/'])
+ checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1')
+ branch.BranchReferenceFormat().initialize(checkout_dir,
+ target_branch=master.branch)
+ checkout1 = checkout_dir.create_workingtree('m1')
+
+ # Create a second branch, with an extra commit
+ other = master.bzrdir.sprout('other').open_workingtree()
+ self.build_tree(['other/file2'])
+ other.add(['file2'])
+ other.commit('other2', rev_id='o2')
+
+ # Merge the other branch into checkout - 'start reviewing a patch'
+ checkout1.merge_from_branch(other.branch)
+ self.assertEqual(['o2'], checkout1.get_parent_ids()[1:])
+
+ # Create a new commit in the master branch - 'someone else lands its'
+ master.merge_from_branch(other.branch)
+ master.commit('f3', rev_id='m2')
+
+ # This should not report about local commits being pending
+ # merges, because they were real merges (but are now gone).
+ # It should perhaps report on them.
+ out, err = self.run_bzr('update', working_dir='checkout1')
+ self.assertEqual('', out)
+ self.assertEqualDiff('''All changes applied successfully.
+Updated to revision 2 of branch %s
+''' % osutils.pathjoin(self.test_dir, 'master',),
+ err)
+ # The pending merges should still be there
+ self.assertEqual([], checkout1.get_parent_ids()[1:])
+
def test_update_dash_r(self):
master = self.make_branch_and_tree('master')
os.chdir('master')
More information about the bazaar-commits
mailing list