Rev 6041: Remove more deprecated code in file:///home/vila/src/bzr/cleanup/deprecations/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Mar 14 09:30:49 UTC 2012
At file:///home/vila/src/bzr/cleanup/deprecations/
------------------------------------------------------------
revno: 6041
revision-id: v.ladeuil+lp at free.fr-20120314093048-lng0t04ud0k7p9e1
parent: v.ladeuil+lp at free.fr-20120314083410-knnbugxnq7owem53
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: deprecations
timestamp: Wed 2012-03-14 10:30:48 +0100
message:
Remove more deprecated code
-------------- next part --------------
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2012-02-23 23:41:51 +0000
+++ b/bzrlib/bzrdir.py 2012-03-14 09:30:48 +0000
@@ -465,10 +465,6 @@
stacked=stacked)
return result
- @deprecated_method(deprecated_in((2, 3, 0)))
- def generate_backup_name(self, base):
- return self._available_backup_name(base)
-
def _available_backup_name(self, base):
"""Find a non-existing backup file name based on base.
@@ -1234,16 +1230,6 @@
"""The known .bzr formats."""
@classmethod
- @deprecated_method(deprecated_in((2, 4, 0)))
- def register_bzrdir_format(klass, format):
- klass.formats.register(format.get_format_string(), format)
-
- @classmethod
- @deprecated_method(deprecated_in((2, 4, 0)))
- def unregister_bzrdir_format(klass, format):
- klass.formats.remove(format.get_format_string())
-
- @classmethod
def probe_transport(klass, transport):
"""Return the .bzrdir style format present in a directory."""
try:
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2012-03-08 18:30:33 +0000
+++ b/bzrlib/config.py 2012-03-14 09:30:48 +0000
@@ -205,11 +205,6 @@
"""Returns a unique ID for the config."""
raise NotImplementedError(self.config_id)
- @deprecated_method(deprecated_in((2, 4, 0)))
- def get_editor(self):
- """Get the users pop up editor."""
- raise NotImplementedError
-
def get_change_editor(self, old_tree, new_tree):
from bzrlib import diff
cmd = self._get_change_editor()
@@ -1056,10 +1051,6 @@
conf._create_from_string(str_or_unicode, save)
return conf
- @deprecated_method(deprecated_in((2, 4, 0)))
- def get_editor(self):
- return self._get_user_option('editor')
-
@needs_write_lock
def set_user_option(self, option, value):
"""Save option and its value in the configuration."""
=== modified file 'bzrlib/merge.py'
--- a/bzrlib/merge.py 2012-03-13 17:25:29 +0000
+++ b/bzrlib/merge.py 2012-03-14 09:30:48 +0000
@@ -1078,52 +1078,6 @@
))
return result
- @deprecated_method(deprecated_in((2, 4, 0)))
- def fix_root(self):
- if self.tt.final_kind(self.tt.root) is None:
- self.tt.cancel_deletion(self.tt.root)
- if self.tt.final_file_id(self.tt.root) is None:
- self.tt.version_file(self.tt.tree_file_id(self.tt.root),
- self.tt.root)
- other_root_file_id = self.other_tree.get_root_id()
- if other_root_file_id is None:
- return
- other_root = self.tt.trans_id_file_id(other_root_file_id)
- if other_root == self.tt.root:
- return
- if self.this_tree.has_id(
- self.other_tree.get_root_id()):
- # the other tree's root is a non-root in the current tree (as
- # when a previously unrelated branch is merged into another)
- return
- if self.tt.final_kind(other_root) is not None:
- other_root_is_present = True
- else:
- # other_root doesn't have a physical representation. We still need
- # to move any references to the actual root of the tree.
- other_root_is_present = False
- # the other tree root is not present in this tree. We are
- # calling adjust_path for children which *want* to be present with a
- # correct place to go.
- for child_id in self.other_tree.iter_children(
- self.other_tree.get_root_id()):
- trans_id = self.tt.trans_id_file_id(child_id)
- if not other_root_is_present:
- if self.tt.final_kind(trans_id) is not None:
- # The item exist in the final tree and has a defined place
- # to go already.
- continue
- # Move the item into the root
- try:
- final_name = self.tt.final_name(trans_id)
- except errors.NoFinalPath:
- # This file is not present anymore, ignore it.
- continue
- self.tt.adjust_path(final_name, self.tt.root, trans_id)
- if other_root_is_present:
- self.tt.cancel_creation(other_root)
- self.tt.cancel_versioning(other_root)
-
def write_modified(self, results):
modified_hashes = {}
for path in results.modified_paths:
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py 2012-02-23 23:26:35 +0000
+++ b/bzrlib/tests/test_bzrdir.py 2012-03-14 09:30:48 +0000
@@ -1404,11 +1404,6 @@
possible_transports=[self._transport])
self._bzrdir = bzrdir.BzrDir.open_from_transport(self._transport)
- def test_deprecated_generate_backup_name(self):
- res = self.applyDeprecated(
- symbol_versioning.deprecated_in((2, 3, 0)),
- self._bzrdir.generate_backup_name, 'whatever')
-
def test_new(self):
self.assertEqual("a.~1~", self._bzrdir._available_backup_name("a"))
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2012-03-08 18:30:33 +0000
+++ b/bzrlib/tests/test_config.py 2012-03-14 09:30:48 +0000
@@ -476,12 +476,6 @@
def test_constructs(self):
config.Config()
- def test_no_default_editor(self):
- self.assertRaises(
- NotImplementedError,
- self.applyDeprecated, deprecated_in((2, 4, 0)),
- config.Config().get_editor)
-
def test_user_email(self):
my_config = InstrumentedConfig()
self.assertEqual('robert.collins at example.org', my_config.user_email())
@@ -1189,12 +1183,6 @@
my_config = config.GlobalConfig()
self.assertEqual(None, my_config._get_user_id())
- def test_configured_editor(self):
- my_config = config.GlobalConfig.from_string(sample_config_text)
- editor = self.applyDeprecated(
- deprecated_in((2, 4, 0)), my_config.get_editor)
- self.assertEqual('vim', editor)
-
def test_signatures_always(self):
my_config = config.GlobalConfig.from_string(sample_always_signatures)
self.assertEqual(config.CHECK_NEVER,
=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt 2012-03-14 08:34:10 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt 2012-03-14 09:30:48 +0000
@@ -89,7 +89,8 @@
* New convenience API method ``WorkingTree.get_config_stack``.
(Jelmer Vernooij)
-* Remove ``Merge3Merger.scalar_three_way`` deprecated in 2.2.0,
+* Remove ``merge.Merge3Merger.scalar_three_way`` deprecated in 2.2.0,
+ ``merge.Merge3Merger.fix_root`` deprecated in 2.4.0,
``hooks.known_hooks_key_to_parent_and_attribute`` deprecated in 2.3,
``hooks.Hooks.create_hook`` deprecated in 2.4,
``inventory.Inventory.__contains__`` deprecated in 2.4.0,
@@ -100,6 +101,10 @@
``workingtree.WorkingTreeFormat.get_formats`` deprecated in 2.4.0,
``workingtree.WorkingTreeFormat.set_default_format`` deprecated in 2.4.0,
``workingtree.WorkingTreeFormat.unregister_format`` deprecated in 2.4.0,
+ ``config.Config.get_editor`` deprecated in 2.4.0,
+ ``bzrdir.BzrDir.generate_backup_name`` deprecated in 2.3.0,
+ ``bzrdir.BzrProber.register_bzrdir_format`` deprecated in 2.4.0,
+ ``bzrdir.BzrProber.unregister_bzrdir_format`` deprecated in 2.4.0,
(Vincent Ladeuil)
Internals
More information about the bazaar-commits
mailing list