Rev 5672: (jelmer) Remove any methods/arguments that were deprecated before 2.0. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Sun Feb 20 02:02:52 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5672 [merge]
revision-id: pqm at pqm.ubuntu.com-20110220020249-6gfgbgp9d03unw0e
parent: pqm at pqm.ubuntu.com-20110219175149-wtr5hzixht2x8kmh
parent: jelmer at samba.org-20110219173745-q05eth8vohf7g4k6
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sun 2011-02-20 02:02:49 +0000
message:
(jelmer) Remove any methods/arguments that were deprecated before 2.0.
(Jelmer Vernooij)
removed:
bzrlib/util/bencode.py bencode.py-20090609141817-jtvhqq6vyryjoeky-1
modified:
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/breakin.py breakin.py-20070417043829-so46nevf978u713k-1
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/check.py check.py-20050309040759-f3a679400c06bcc1
bzrlib/graph.py graph_walker.py-20070525030359-y852guab65d4wtn0-1
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/revisionspec.py revisionspec.py-20050907152633-17567659fd5c0ddb
bzrlib/tests/per_branch/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/test_graph.py test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
bzrlib/tree.py tree.py-20050309040759-9d5f2496be663e77
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2011-02-08 07:00:37 +0000
+++ b/bzrlib/branch.py 2011-02-19 17:37:45 +0000
@@ -662,13 +662,12 @@
raise errors.UnsupportedOperation(self.get_reference_info, self)
@needs_write_lock
- def fetch(self, from_branch, last_revision=None, pb=None, fetch_spec=None):
+ def fetch(self, from_branch, last_revision=None, fetch_spec=None):
"""Copy revisions from from_branch into this branch.
:param from_branch: Where to copy from.
:param last_revision: What revision to stop at (None for at the end
of the branch.
- :param pb: An optional progress bar to use.
:param fetch_spec: If specified, a SearchResult or
PendingAncestryResult that describes which revisions to copy. This
allows copying multiple heads at once. Mutually exclusive with
@@ -680,10 +679,6 @@
"fetch_spec and last_revision are mutually exclusive.")
if self.base == from_branch.base:
return (0, [])
- if pb is not None:
- symbol_versioning.warn(
- symbol_versioning.deprecated_in((1, 14, 0))
- % "pb parameter to fetch()")
from_branch.lock_read()
try:
if last_revision is None and fetch_spec is None:
@@ -691,7 +686,7 @@
last_revision = _mod_revision.ensure_null(last_revision)
return self.repository.fetch(from_branch.repository,
revision_id=last_revision,
- pb=pb, fetch_spec=fetch_spec)
+ fetch_spec=fetch_spec)
finally:
from_branch.unlock()
@@ -1006,29 +1001,6 @@
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.
-
- If self and other have not diverged, return a list of the revisions
- present in other, but missing from self.
- """
- self_history = self.revision_history()
- self_len = len(self_history)
- other_history = other.revision_history()
- other_len = len(other_history)
- common_index = min(self_len, other_len) -1
- if common_index >= 0 and \
- self_history[common_index] != other_history[common_index]:
- raise errors.DivergedBranches(self, other)
-
- if stop_revision is None:
- stop_revision = other_len
- else:
- if stop_revision > other_len:
- raise errors.NoSuchRevision(self, stop_revision)
- return other_history[self_len:stop_revision]
-
def update_revisions(self, other, stop_revision=None, overwrite=False,
graph=None, fetch_tags=True):
"""Pull in new perfect-fit revisions.
=== modified file 'bzrlib/breakin.py'
--- a/bzrlib/breakin.py 2010-06-17 09:23:19 +0000
+++ b/bzrlib/breakin.py 2011-02-19 17:37:45 +0000
@@ -41,19 +41,6 @@
signal.signal(_breakin_signal_number, _debug)
-def hook_sigquit():
- # We import this late because breakin.py is loaded as part of the main
- # 'bzr' script, so we want it to load as little as possible until things
- # are up and running
- from bzrlib import symbol_versioning, trace
- trace.mutter_callsite(2, 'Deprecated function called')
- symbol_versioning.warn(symbol_versioning.deprecation_string(
- hook_sigquit, symbol_versioning.deprecated_in((1, 18, 0))),
- DeprecationWarning, stacklevel=2)
-
- return hook_debugger_to_signal()
-
-
def determine_signal():
global _breakin_signal_number
global _breakin_signal_name
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2011-02-16 15:52:12 +0000
+++ b/bzrlib/bzrdir.py 2011-02-19 17:37:45 +0000
@@ -1131,14 +1131,8 @@
return self.transport
raise errors.IncompatibleFormat(workingtree_format, self._format)
- def needs_format_conversion(self, format=None):
+ def needs_format_conversion(self, format):
"""See BzrDir.needs_format_conversion()."""
- # if the format is not the same as the system default,
- # an upgrade is needed.
- if format is None:
- symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0))
- % 'needs_format_conversion(format=None)')
- format = BzrDirFormat.get_default_format()
return not isinstance(self._format, format.__class__)
def open_branch(self, name=None, unsupported=False,
@@ -1195,11 +1189,8 @@
"""See BzrDir.create_repository."""
return self._format.repository_format.initialize(self, shared)
- def needs_format_conversion(self, format=None):
+ def needs_format_conversion(self, format):
"""Format 4 dirs are always in need of conversion."""
- if format is None:
- symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0))
- % 'needs_format_conversion(format=None)')
return True
def open_repository(self):
@@ -1392,13 +1383,8 @@
return False
return True
- def needs_format_conversion(self, format=None):
+ def needs_format_conversion(self, format):
"""See BzrDir.needs_format_conversion()."""
- if format is None:
- symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0))
- % 'needs_format_conversion(format=None)')
- if format is None:
- format = BzrDirFormat.get_default_format()
if not isinstance(self._format, format.__class__):
# it is not a meta dir format, conversion is needed.
return True
=== modified file 'bzrlib/check.py'
--- a/bzrlib/check.py 2011-01-13 00:14:31 +0000
+++ b/bzrlib/check.py 2011-02-19 17:37:45 +0000
@@ -330,39 +330,6 @@
self.text_key_references[key] = True
- at deprecated_function(deprecated_in((1,6,0)))
-def check(branch, verbose):
- """Run consistency checks on a branch.
-
- Results are reported through logging.
-
- Deprecated in 1.6. Please use check_dwim instead.
-
- :raise BzrCheckError: if there's a consistency error.
- """
- check_branch(branch, verbose)
-
-
- at deprecated_function(deprecated_in((1,16,0)))
-def check_branch(branch, verbose):
- """Run consistency checks on a branch.
-
- Results are reported through logging.
-
- :raise BzrCheckError: if there's a consistency error.
- """
- branch.lock_read()
- try:
- needed_refs = {}
- for ref in branch._get_check_refs():
- needed_refs.setdefault(ref, []).append(branch)
- result = branch.repository.check([branch.last_revision()], needed_refs)
- branch_result = result.other_results[0]
- finally:
- branch.unlock()
- branch_result.report_results(verbose)
-
-
def scan_branch(branch, needed_refs, to_unlock):
"""Scan a branch for refs.
=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py 2011-02-07 05:37:16 +0000
+++ b/bzrlib/graph.py 2011-02-19 17:37:45 +0000
@@ -64,9 +64,6 @@
ancestry = self.ancestry
return dict((k, ancestry[k]) for k in keys if k in ancestry)
- at deprecated_function(deprecated_in((1, 16, 0)))
-def _StackedParentsProvider(*args, **kwargs):
- return StackedParentsProvider(*args, **kwargs)
class StackedParentsProvider(object):
"""A parents provider which stacks (or unions) multiple providers.
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2011-02-07 04:14:29 +0000
+++ b/bzrlib/remote.py 2011-02-19 17:37:45 +0000
@@ -451,11 +451,8 @@
"""Upgrading of remote bzrdirs is not supported yet."""
return False
- def needs_format_conversion(self, format=None):
+ def needs_format_conversion(self, format):
"""Upgrading of remote bzrdirs is not supported yet."""
- if format is None:
- symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0))
- % 'needs_format_conversion(format=None)')
return False
def clone(self, url, revision_id=None, force_new_repo=False,
@@ -1372,7 +1369,7 @@
find_ghosts=find_ghosts, revision_ids=revision_ids,
if_present_ids=if_present_ids)
- def fetch(self, source, revision_id=None, pb=None, find_ghosts=False,
+ def fetch(self, source, revision_id=None, find_ghosts=False,
fetch_spec=None):
# No base implementation to use as RemoteRepository is not a subclass
# of Repository; so this is a copy of Repository.fetch().
@@ -1396,7 +1393,7 @@
# the InterRepository base class, which raises an
# IncompatibleRepositories when asked to fetch.
inter = repository.InterRepository.get(source, self)
- return inter.fetch(revision_id=revision_id, pb=pb,
+ return inter.fetch(revision_id=revision_id,
find_ghosts=find_ghosts, fetch_spec=fetch_spec)
def create_bundle(self, target, base, fileobj, format=None):
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2011-02-08 15:41:44 +0000
+++ b/bzrlib/repository.py 2011-02-19 17:37:45 +0000
@@ -1745,7 +1745,7 @@
def _resume_write_group(self, tokens):
raise errors.UnsuspendableWriteGroup(self)
- def fetch(self, source, revision_id=None, pb=None, find_ghosts=False,
+ def fetch(self, source, revision_id=None, find_ghosts=False,
fetch_spec=None):
"""Fetch the content required to construct revision_id from source.
@@ -1786,7 +1786,7 @@
self.get_revision(revision_id)
return 0, []
inter = InterRepository.get(source, self)
- return inter.fetch(revision_id=revision_id, pb=pb,
+ return inter.fetch(revision_id=revision_id,
find_ghosts=find_ghosts, fetch_spec=fetch_spec)
def create_bundle(self, target, base, fileobj, format=None):
@@ -3489,7 +3489,7 @@
self.target.fetch(self.source, revision_id=revision_id)
@needs_write_lock
- def fetch(self, revision_id=None, pb=None, find_ghosts=False,
+ def fetch(self, revision_id=None, find_ghosts=False,
fetch_spec=None):
"""Fetch the content required to construct revision_id.
@@ -3497,7 +3497,6 @@
:param revision_id: if None all content is copied, if NULL_REVISION no
content is copied.
- :param pb: ignored.
:return: None.
"""
ui.ui_factory.warn_experimental_format_fetch(self)
@@ -3962,7 +3961,7 @@
len(revision_ids))
@needs_write_lock
- def fetch(self, revision_id=None, pb=None, find_ghosts=False,
+ def fetch(self, revision_id=None, find_ghosts=False,
fetch_spec=None):
"""See InterRepository.fetch()."""
if fetch_spec is not None:
@@ -3998,19 +3997,11 @@
# Walk though all revisions; get inventory deltas, copy referenced
# texts that delta references, insert the delta, revision and
# signature.
- if pb is None:
- my_pb = ui.ui_factory.nested_progress_bar()
- pb = my_pb
- else:
- symbol_versioning.warn(
- symbol_versioning.deprecated_in((1, 14, 0))
- % "pb parameter to fetch()")
- my_pb = None
+ pb = ui.ui_factory.nested_progress_bar()
try:
self._fetch_all_revisions(revision_ids, pb)
finally:
- if my_pb is not None:
- my_pb.finished()
+ pb.finished()
return len(revision_ids), 0
def _get_basis(self, first_revision_id):
=== modified file 'bzrlib/revisionspec.py'
--- a/bzrlib/revisionspec.py 2010-08-18 14:39:37 +0000
+++ b/bzrlib/revisionspec.py 2011-02-19 17:37:45 +0000
@@ -168,11 +168,6 @@
spectype.__name__, spec)
return spectype(spec, _internal=True)
else:
- for spectype in SPEC_TYPES:
- if spec.startswith(spectype.prefix):
- trace.mutter('Returning RevisionSpec %s for %s',
- spectype.__name__, spec)
- return spectype(spec, _internal=True)
# Otherwise treat it as a DWIM, build the RevisionSpec object and
# wait for _match_on to be called.
return RevisionSpec_dwim(spec, _internal=True)
@@ -994,8 +989,3 @@
_register_revspec(RevisionSpec_submit)
_register_revspec(RevisionSpec_annotate)
_register_revspec(RevisionSpec_mainline)
-
-# classes in this list should have a "prefix" attribute, against which
-# string specs are matched
-SPEC_TYPES = symbol_versioning.deprecated_list(
- symbol_versioning.deprecated_in((1, 12, 0)), "SPEC_TYPES", [])
=== modified file 'bzrlib/tests/per_branch/test_branch.py'
--- a/bzrlib/tests/per_branch/test_branch.py 2011-01-27 14:27:18 +0000
+++ b/bzrlib/tests/per_branch/test_branch.py 2011-02-19 17:37:45 +0000
@@ -310,36 +310,6 @@
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_graph.py'
--- a/bzrlib/tests/test_graph.py 2011-01-12 01:01:53 +0000
+++ b/bzrlib/tests/test_graph.py 2011-02-19 17:37:45 +0000
@@ -699,20 +699,6 @@
self.assertEqual({'rev2': ['rev1']},
stacked.get_parent_map(['rev2']))
- def test__stacked_parents_provider_deprecated(self):
- parents1 = _mod_graph.DictParentsProvider({'rev2': ['rev3']})
- parents2 = _mod_graph.DictParentsProvider({'rev1': ['rev4']})
- stacked = self.applyDeprecated(deprecated_in((1, 16, 0)),
- _mod_graph._StackedParentsProvider, [parents1, parents2])
- self.assertEqual({'rev1':['rev4'], 'rev2':['rev3']},
- stacked.get_parent_map(['rev1', 'rev2']))
- self.assertEqual({'rev2':['rev3'], 'rev1':['rev4']},
- stacked.get_parent_map(['rev2', 'rev1']))
- self.assertEqual({'rev2':['rev3']},
- stacked.get_parent_map(['rev2', 'rev2']))
- self.assertEqual({'rev1':['rev4']},
- stacked.get_parent_map(['rev1', 'rev1']))
-
def test_iter_topo_order(self):
graph = self.make_graph(ancestry_1)
args = ['rev2a', 'rev3', 'rev1']
=== modified file 'bzrlib/tree.py'
--- a/bzrlib/tree.py 2010-08-31 07:12:18 +0000
+++ b/bzrlib/tree.py 2011-02-19 17:37:45 +0000
@@ -778,17 +778,6 @@
return 'wtf?'
- at deprecated_function(deprecated_in((1, 9, 0)))
-def find_renames(old_inv, new_inv):
- for file_id in old_inv:
- if file_id not in new_inv:
- continue
- old_name = old_inv.id2path(file_id)
- new_name = new_inv.id2path(file_id)
- if old_name != new_name:
- yield (old_name, new_name)
-
-
def find_ids_across_trees(filenames, trees, require_versioned=True):
"""Find the ids corresponding to specified filenames.
=== removed file 'bzrlib/util/bencode.py'
--- a/bzrlib/util/bencode.py 2009-06-23 22:31:59 +0000
+++ b/bzrlib/util/bencode.py 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-# Copyright (C) 2009 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-from bzrlib import symbol_versioning
-
-dep_warning = symbol_versioning.deprecated_in((1, 16, 0)) % (
- 'bzrlib.util.bencode',) + '\n Use bzrlib.bencode instead'
-
-symbol_versioning.warn(dep_warning, DeprecationWarning, stacklevel=2)
-
-from bzrlib.bencode import *
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-02-18 17:05:11 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-02-19 17:37:45 +0000
@@ -117,6 +117,9 @@
* Added ``bzrlib.mergetools`` module with helper functions for working with
the list of external merge tools. (Gordon Tyler, #489915)
+* All methods and arguments that were deprecated before 2.0
+ have been removed. (Jelmer Vernooij)
+
* ``Branch.fetch`` implementations must now accept an optional
``fetch_spec`` keyword argument. (Andrew Bennetts)
More information about the bazaar-commits
mailing list