Rev 6531: (jelmer) Remove deprecated Branch.import_last_revision. (Jelmer Vernooij) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jun 26 16:06:49 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6531 [merge]
revision-id: pqm at pqm.ubuntu.com-20120626160649-9ye58ozs6qgiuhkt
parent: pqm at pqm.ubuntu.com-20120626150648-fhoktppleqft0ji5
parent: jelmer at samba.org-20120626154044-leofcn0n8zr68a1l
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2012-06-26 16:06:49 +0000
message:
  (jelmer) Remove deprecated Branch.import_last_revision. (Jelmer Vernooij)
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/tests/per_branch/test_last_revision_info.py test_last_revision_i-20070201133317-51mzi40m8hv1i0i9-1
  doc/en/release-notes/bzr-2.6.txt bzr2.6.txt-20120116134316-8w1xxom1c7vcu1t5-1
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2012-06-26 12:58:22 +0000
+++ b/bzrlib/branch.py	2012-06-26 15:33:56 +0000
@@ -1034,18 +1034,6 @@
     def _read_last_revision_info(self):
         raise NotImplementedError(self._read_last_revision_info)
 
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def import_last_revision_info(self, source_repo, revno, revid):
-        """Set the last revision info, importing from another repo if necessary.
-
-        :param source_repo: Source repository to optionally fetch from
-        :param revno: Revision number of the new tip
-        :param revid: Revision id of the new tip
-        """
-        if not self.repository.has_same_location(source_repo):
-            self.repository.fetch(source_repo, revision_id=revid)
-        self.set_last_revision_info(revno, revid)
-
     def import_last_revision_info_and_tags(self, source, revno, revid,
                                            lossy=False):
         """Set the last revision info, importing from another repo if necessary.

=== modified file 'bzrlib/tests/per_branch/test_last_revision_info.py'
--- a/bzrlib/tests/per_branch/test_last_revision_info.py	2011-04-12 00:44:43 +0000
+++ b/bzrlib/tests/per_branch/test_last_revision_info.py	2012-06-26 12:26:45 +0000
@@ -17,7 +17,6 @@
 """Tests for branch.last_revision_info."""
 
 from bzrlib.revision import NULL_REVISION
-from bzrlib.symbol_versioning import deprecated_in
 from bzrlib.tests import TestCaseWithTransport
 
 
@@ -35,27 +34,6 @@
         revid = tree.commit('2st post', allow_pointless=True)
         self.assertEqual((2, revid), tree.branch.last_revision_info())
 
-    def test_import_deprecated(self):
-        # importing and setting last revision
-        tree1 = self.make_branch_and_tree('branch1')
-        tree1.commit('1st post')
-        revid = tree1.commit('2st post', allow_pointless=True)
-        branch2 = self.make_branch('branch2')
-        self.applyDeprecated(deprecated_in((2, 4, 0)),
-            branch2.import_last_revision_info, tree1.branch.repository, 2, revid)
-        self.assertEqual((2, revid), branch2.last_revision_info())
-        self.assertTrue(branch2.repository.has_revision(revid))
-
-    def test_same_repo_deprecated(self):
-        # importing and setting last revision within the same repo
-        tree = self.make_branch_and_tree('branch1')
-        tree.commit('1st post')
-        revid = tree.commit('2st post', allow_pointless=True)
-        tree.branch.set_last_revision_info(0, NULL_REVISION)
-        self.applyDeprecated(deprecated_in((2, 4, 0)),
-            tree.branch.import_last_revision_info, tree.branch.repository, 2, revid)
-        self.assertEqual((2, revid), tree.branch.last_revision_info())
-
     def test_import(self):
         # importing and setting last revision
         tree1 = self.make_branch_and_tree('branch1')

=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt	2012-06-26 14:26:44 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt	2012-06-26 15:40:44 +0000
@@ -58,6 +58,8 @@
 .. Changes that may require updates in plugins or other code that uses
    bzrlib.
 
+* Remove deprecated Branch.import_last_revision(). (Jelmer Vernooij)
+
 * Remove deprecated Repository.iter_reverse_revision_history().
   (Jelmer Vernooij)
 




More information about the bazaar-commits mailing list