Rev 3451: Fix "bzr push --overwrite -r NNN". (Andrew Bennetts) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Sat May 24 12:41:35 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3451
revision-id:pqm at pqm.ubuntu.com-20080524114124-ubdyd5iqf7zxl2pn
parent: pqm at pqm.ubuntu.com-20080524081929-1p31juzzotqmozxu
parent: andrew.bennetts at canonical.com-20080523073305-3oxx653my3wn0469
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2008-05-24 12:41:24 +0100
message:
Fix "bzr push --overwrite -r NNN". (Andrew Bennetts)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/tests/branch_implementations/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
------------------------------------------------------------
revno: 3449.1.2
revision-id:andrew.bennetts at canonical.com-20080523073305-3oxx653my3wn0469
parent: andrew.bennetts at canonical.com-20080523071740-j0j21f8pr6xogzo8
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: unbreak-push-overwrite
timestamp: Fri 2008-05-23 17:33:05 +1000
message:
Add test and NEWS entry.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/branch_implementations/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
------------------------------------------------------------
revno: 3449.1.1
revision-id:andrew.bennetts at canonical.com-20080523071740-j0j21f8pr6xogzo8
parent: pqm at pqm.ubuntu.com-20080522125310-lneifpa40hzg4lu2
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: unbreak-push-overwrite
timestamp: Fri 2008-05-23 17:17:40 +1000
message:
Fix bug 234229 by deleting some code :)
modified:
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
=== modified file 'NEWS'
--- a/NEWS 2008-05-23 21:45:50 +0000
+++ b/NEWS 2008-05-24 11:41:24 +0000
@@ -39,6 +39,9 @@
BUGFIXES:
+ * ``bzr push`` with both ``--overwrite`` and ``-r NNN`` options no longer
+ fails. (Andrew Bennetts, #234229)
+
* Correctly track the base URL of a smart medium when using bzr+http://
URLs, which was causing spurious "No repository present" errors with
branches in shared repositories accessed over bzr+http.
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2008-05-22 05:48:22 +0000
+++ b/bzrlib/branch.py 2008-05-23 07:17:40 +0000
@@ -1670,13 +1670,7 @@
result.source_branch = self
result.target_branch = target
result.old_revno, result.old_revid = target.last_revision_info()
- try:
- target.update_revisions(self, stop_revision)
- except errors.DivergedBranches:
- if not overwrite:
- raise
- if overwrite:
- target.set_revision_history(self.revision_history())
+ target.update_revisions(self, stop_revision, overwrite)
result.tag_conflicts = self.tags.merge_to(target.tags, overwrite)
result.new_revno, result.new_revid = target.last_revision_info()
return result
=== modified file 'bzrlib/tests/branch_implementations/test_push.py'
--- a/bzrlib/tests/branch_implementations/test_push.py 2008-03-10 13:30:29 +0000
+++ b/bzrlib/tests/branch_implementations/test_push.py 2008-05-23 07:33:05 +0000
@@ -153,6 +153,22 @@
self.assertEqual(tree.branch.last_revision(),
to_branch.last_revision())
+ def test_push_overwrite_of_non_tip_with_stop_revision(self):
+ """Combining the stop_revision and overwrite options works.
+
+ This was <https://bugs.launchpad.net/bzr/+bug/234229>.
+ """
+ source = self.make_branch_and_tree('source')
+ target = self.make_branch('target')
+
+ source.commit('1st commit')
+ source.branch.push(target)
+ source.commit('2nd commit', rev_id='rev-2')
+ source.commit('3rd commit')
+
+ source.branch.push(target, stop_revision='rev-2', overwrite=True)
+ self.assertEqual('rev-2', target.last_revision())
+
class TestPushHook(TestCaseWithBranch):
More information about the bazaar-commits
mailing list