Rev 5876: (vila) ``bzr merge --no-remember location`` never sets ``submit_branch`` in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Tue May 17 01:55:25 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5876 [merge]
revision-id: pqm at pqm.ubuntu.com-20110517015521-96ie5w6ix04utat2
parent: pqm at pqm.ubuntu.com-20110517001147-1rxbyu7x5sr2q1fz
parent: v.ladeuil+lp at free.fr-20110516174858-5upoy1v4t6iasgso
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2011-05-17 01:55:21 +0000
message:
(vila) ``bzr merge --no-remember location`` never sets ``submit_branch``
(Vincent Ladeuil)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_merge.py test_merge.py-20060323225809-9bc0459c19917f41
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
doc/en/user-guide/merging_changes.txt merging_changes.txt-20071122141511-0knao2lklsdsvb1q-3
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2011-05-16 22:28:36 +0000
+++ b/bzrlib/builtins.py 2011-05-17 01:55:21 +0000
@@ -3857,10 +3857,10 @@
Use bzr resolve when you have fixed a problem. See also bzr conflicts.
- If there is no default branch set, the first merge will set it. After
- that, you can omit the branch to use the default. To change the
- default, use --remember. The value will only be saved if the remote
- location can be accessed.
+ If there is no default branch set, the first merge will set it (use
+ --no-remember to *not* set it). After that, you can omit the branch to use
+ the default. To change the default, use --remember. The value will only be
+ saved if the remote location can be accessed.
The results of the merge are placed into the destination working
directory, where they can be reviewed (with bzr diff), tested, and then
@@ -3931,7 +3931,7 @@
]
def run(self, location=None, revision=None, force=False,
- merge_type=None, show_base=False, reprocess=None, remember=False,
+ merge_type=None, show_base=False, reprocess=None, remember=None,
uncommitted=False, pull=False,
directory=None,
preview=False,
@@ -4114,9 +4114,15 @@
if other_revision_id is None:
other_revision_id = _mod_revision.ensure_null(
other_branch.last_revision())
- # Remember where we merge from
- if ((remember or tree.branch.get_submit_branch() is None) and
- user_location is not None):
+ # Remember where we merge from. We need to remember if:
+ # - user specify a location (and we don't merge from the parent
+ # branch)
+ # - user ask to remember or there is no previous location set to merge
+ # from and user didn't ask to *not* remember
+ if (user_location is not None
+ and ((remember
+ or (remember is None
+ and tree.branch.get_submit_branch() is None)))):
tree.branch.set_submit_branch(other_branch.base)
# Merge tags (but don't set them in the master branch yet, the user
# might revert this merge). Commit will propagate them.
=== modified file 'bzrlib/tests/blackbox/test_merge.py'
--- a/bzrlib/tests/blackbox/test_merge.py 2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/blackbox/test_merge.py 2011-05-14 14:09:09 +0000
@@ -555,6 +555,20 @@
self.assertEqual(tree_b.branch.get_submit_branch(),
tree_a.bzrdir.root_transport.base)
+ def test_no_remember_dont_set_submit(self):
+ tree_a = self.make_branch_and_tree('a')
+ tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
+ self.assertIs(tree_b.branch.get_submit_branch(), None)
+
+ # Remember should not happen if using default from parent
+ out, err = self.run_bzr(['merge', '-d', 'b', '--no-remember'])
+ self.assertEquals(None, tree_b.branch.get_submit_branch())
+
+ # Remember should not happen if user supplies location but ask for not
+ # remembering it
+ out, err = self.run_bzr(['merge', '-d', 'b', '--no-remember', 'a'])
+ self.assertEqual(None, tree_b.branch.get_submit_branch())
+
def test_weave_cherrypick(self):
this_tree = self.make_branch_and_tree('this')
self.build_tree_contents([('this/file', "a\n")])
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-05-17 00:11:47 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-05-17 01:55:21 +0000
@@ -70,6 +70,9 @@
* All Tree types can now be exported as tar.*, zip or directories.
(Aaron Bentley)
+* ``bzr merge --no-remember location`` never sets ``submit_branch``.
+ (Vincent Ladeuil, #782169)
+
* Correct parent is now set when using 'switch -b' with bound branches.
(A. S. Budden, #513709)
=== modified file 'doc/en/user-guide/merging_changes.txt'
--- a/doc/en/user-guide/merging_changes.txt 2011-04-06 04:58:43 +0000
+++ b/doc/en/user-guide/merging_changes.txt 2011-05-16 17:48:58 +0000
@@ -31,8 +31,9 @@
bzr merge bzr+ssh://mary@bill-laptop/cool-repo/cool-trunk
-This sets the default merge branch if one is not already set. To change the
-default after it is set, use the ``--remember`` option.
+This sets the default merge branch if one is not already set. Use
+``--no-remember`` to avoid setting it. To change the default after it is set,
+use the ``--remember`` option.
How does merging work?
----------------------
More information about the bazaar-commits
mailing list