Rev 3465: (jam) Deprecate branch.missing_revisions() in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Jun 2 23:27:49 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3465
revision-id:pqm at pqm.ubuntu.com-20080602222734-9ojr7ubruggqcjau
parent: pqm at pqm.ubuntu.com-20080601233619-di6or8d3o26n917q
parent: john at arbash-meinel.com-20080528223048-dbrnob3nzv7wdp02
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2008-06-02 23:27:34 +0100
message:
(jam) Deprecate branch.missing_revisions()
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/test_branch.py test_branch.py-20060116013032-97819aa07b8ab3b5
bzrlib/tests/test_switch.py test_switch.py-20071116011000-v5lnw7d2wkng9eux-2
------------------------------------------------------------
revno: 3445.2.3
revision-id:john at arbash-meinel.com-20080528223048-dbrnob3nzv7wdp02
parent: john at arbash-meinel.com-20080521154556-2d5q6xqlailg6d1j
parent: pqm at pqm.ubuntu.com-20080527013230-8qjaju10duxpy3e2
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: missing
timestamp: Wed 2008-05-28 17:30:48 -0500
message:
merge bzr.dev
added:
bzrlib/tests/file_utils.py file_utils.py-20080506145406-a1h3ydg2lsh2iriy-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/config.py config.py-20051011043216-070c74f4e9e338e8
bzrlib/lockable_files.py control_files.py-20051111201905-bb88546e799d669f
bzrlib/merge.py merge.py-20050513021216-953b65a438527106
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repofmt/weaverepo.py presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/smart/branch.py branch.py-20061124031907-mzh3pla28r83r97f-1
bzrlib/smart/protocol.py protocol.py-20061108035435-ot0lstk2590yqhzr-1
bzrlib/smart/repository.py repository.py-20061128022038-vr5wy5bubyb8xttk-1
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/branch_implementations/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
bzrlib/tests/repository_implementations/test_has_same_location.py test_has_same_locati-20070807074648-2i2ah82fbe83iys7-1
bzrlib/tests/test_config.py testconfig.py-20051011041908-742d0c15d8d8c8eb
bzrlib/tests/test_http_response.py test_http_response.py-20060628233143-950b2a482a32505d
bzrlib/tests/test_lockable_files.py test_lockable_files.py-20051225183927-365c7fd99591caf1
bzrlib/tests/test_merge_core.py test_merge_core.py-20050824132511-eb99b23a0eec641b
bzrlib/tests/test_osutils.py test_osutils.py-20051201224856-e48ee24c12182989
bzrlib/tests/test_osutils_encodings.py test_osutils_encodin-20061226013130-kkp732tpt3lm91vv-1
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
bzrlib/tests/test_smart.py test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
bzrlib/tests/test_workingtree.py testworkingtree.py-20051004024258-b88d0fe8f101d468
bzrlib/tests/workingtree_implementations/test_basis_inventory.py test_basis_inventory.py-20051218151655-3650468941091309
bzrlib/tests/workingtree_implementations/test_workingtree.py test_workingtree.py-20060203003124-817757d3e31444fb
bzrlib/transform.py transform.py-20060105172343-dd99e54394d91687
bzrlib/transport/fakenfs.py fakenfs.py-20060402223312-0e29c7275aa384dd
bzrlib/transport/http/response.py _response.py-20060613154423-a2ci7hd4iw5c7fnt-1
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
doc/developers/tortoise-strategy.txt tortoisestrategy.txt-20080403024510-2ahdqrvnwqrb5p5t-1
------------------------------------------------------------
revno: 3445.2.2
revision-id:john at arbash-meinel.com-20080521154556-2d5q6xqlailg6d1j
parent: john at arbash-meinel.com-20080521154247-sqpkv9um9grku9e1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: missing
timestamp: Wed 2008-05-21 10:45:56 -0500
message:
Move the test to a branch_implementations test
modified:
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/test_branch.py test_branch.py-20060116013032-97819aa07b8ab3b5
------------------------------------------------------------
revno: 3445.2.1
revision-id:john at arbash-meinel.com-20080521154247-sqpkv9um9grku9e1
parent: pqm at pqm.ubuntu.com-20080521104134-beoquporep2cpghs
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: missing
timestamp: Wed 2008-05-21 10:42:47 -0500
message:
Add tests for Branch.missing_revisions and deprecate it.
The api uses a 'stop_revision' but it is supposed to be a revno, not a
revision_id. The code itself is very crufty and slow (and doesn't take
a read_lock). But rather than fix it, just nuke the function.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/tests/test_branch.py test_branch.py-20060116013032-97819aa07b8ab3b5
bzrlib/tests/test_switch.py test_switch.py-20071116011000-v5lnw7d2wkng9eux-2
=== modified file 'NEWS'
--- a/NEWS 2008-05-30 21:44:30 +0000
+++ b/NEWS 2008-06-02 22:27:34 +0000
@@ -126,6 +126,11 @@
INTERNALS:
+ * ``Branch.missing_revisions`` has been deprecated. Similar functionality
+ can be obtained using ``bzrlib.missing.find_unmerged``. The api was
+ fairly broken, and the function was unused, so we are getting rid of it.
+ (John Arbash Meinel)
+
API CHANGES:
* ``Branch.abspath`` is deprecated; use the Tree or Transport
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2008-05-29 20:17:37 +0000
+++ b/bzrlib/branch.py 2008-06-02 22:27:34 +0000
@@ -425,6 +425,7 @@
else:
return (0, _mod_revision.NULL_REVISION)
+ @deprecated_method(deprecated_in((1, 6, 0)))
def missing_revisions(self, other, stop_revision=None):
"""Return a list of new revisions that would perfectly fit.
=== modified file 'bzrlib/tests/branch_implementations/test_branch.py'
--- a/bzrlib/tests/branch_implementations/test_branch.py 2008-05-12 02:48:08 +0000
+++ b/bzrlib/tests/branch_implementations/test_branch.py 2008-05-28 22:30:48 +0000
@@ -40,6 +40,7 @@
)
from bzrlib.osutils import getcwd
import bzrlib.revision
+from bzrlib.symbol_versioning import deprecated_in
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
from bzrlib.tests.branch_implementations import TestCaseWithBranch
from bzrlib.tests.http_server import HttpServer
@@ -304,6 +305,36 @@
self.assertEqual(repo.get_signature_text('A'),
d2.open_repository().get_signature_text('A'))
+ def test_missing_revisions(self):
+ t1 = self.make_branch_and_tree('b1')
+ rev1 = t1.commit('one')
+ t2 = t1.bzrdir.sprout('b2').open_workingtree()
+ rev2 = t1.commit('two')
+ rev3 = t1.commit('three')
+
+ self.assertEqual([rev2, rev3],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch))
+
+ self.assertEqual([],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=1))
+ self.assertEqual([rev2],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=2))
+ self.assertEqual([rev2, rev3],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=3))
+
+ self.assertRaises(errors.NoSuchRevision,
+ self.applyDeprecated, deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=4)
+
+ rev4 = t2.commit('four')
+ self.assertRaises(errors.DivergedBranches,
+ self.applyDeprecated, deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch)
+
def test_nicks(self):
"""Test explicit and implicit branch nicknames.
=== modified file 'bzrlib/tests/test_branch.py'
--- a/bzrlib/tests/test_branch.py 2008-04-09 03:09:58 +0000
+++ b/bzrlib/tests/test_branch.py 2008-05-21 15:45:56 +0000
@@ -53,6 +53,7 @@
from bzrlib.tests import TestCase, TestCaseWithTransport
from bzrlib.transport import get_transport
+
class TestDefaultFormat(TestCase):
def test_default_format(self):
@@ -294,6 +295,7 @@
self.assertEqual(warnings[0], 'Value "new" is masked by "old" from '
'locations.conf')
+
class TestBranchReference(TestCaseWithTransport):
"""Tests for the branch reference facility."""
=== modified file 'bzrlib/tests/test_switch.py'
--- a/bzrlib/tests/test_switch.py 2007-12-07 05:31:54 +0000
+++ b/bzrlib/tests/test_switch.py 2008-05-21 15:42:47 +0000
@@ -130,7 +130,5 @@
self.failIfExists('checkout/file-3')
self.failUnlessExists('checkout/file-4')
# Check that the checkout is a true mirror of the bound branch
- missing_in_checkout = checkout.branch.missing_revisions(to_branch)
- self.assertEqual([], missing_in_checkout)
- missing_in_remote = to_branch.missing_revisions(checkout.branch)
- self.assertEqual([], missing_in_remote)
+ self.assertEqual(to_branch.last_revision_info(),
+ checkout.branch.last_revision_info())
More information about the bazaar-commits
mailing list