Rev 6053: (jelmer) Remove UIFactory.warn_cross_format_fetch and in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Aug 5 19:18:23 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6053 [merge]
revision-id: pqm at pqm.ubuntu.com-20110805191820-dyms8ui5i6le4xtc
parent: pqm at pqm.ubuntu.com-20110805165101-e89g9pgybm7db15a
parent: jelmer at samba.org-20110802111843-rv2smesjxmodzpp9
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-08-05 19:18:20 +0000
message:
  (jelmer) Remove UIFactory.warn_cross_format_fetch and
   UIFactory.warn_experimental_format_fetch in favor of
   UIFactory.show_user_warning. (Jelmer Vernooij)
modified:
  bzrlib/ui/__init__.py          ui.py-20050824083933-8cf663c763ba53a9
  bzrlib/vf_repository.py        vf_repository.py-20110502151858-yh9nnoxpokg86unk-1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/ui/__init__.py'
--- a/bzrlib/ui/__init__.py	2011-06-10 07:01:07 +0000
+++ b/bzrlib/ui/__init__.py	2011-08-02 11:18:43 +0000
@@ -145,6 +145,10 @@
             "This may take some time. Upgrade the repositories to the "
             "same format for better performance."
             ),
+        experimental_format_fetch=("Fetching into experimental format "
+            "%(to_format)s.\n"
+            "This format may be unreliable or change in the future "
+            "without an upgrade path.\n"),
         deprecated_command=(
             "The command 'bzr %(deprecated_name)s' "
             "has been deprecated in bzr %(deprecated_in_version)s. "
@@ -408,22 +412,6 @@
         """Show a warning to the user."""
         raise NotImplementedError(self.show_warning)
 
-    def warn_cross_format_fetch(self, from_format, to_format):
-        """Warn about a potentially slow cross-format transfer.
-        
-        This is deprecated in favor of show_user_warning, but retained for api
-        compatibility in 2.0 and 2.1.
-        """
-        self.show_user_warning('cross_format_fetch', from_format=from_format,
-            to_format=to_format)
-
-    def warn_experimental_format_fetch(self, inter):
-        """Warn about fetching into experimental repository formats."""
-        if inter.target._format.experimental:
-            trace.warning("Fetching into experimental format %s.\n"
-                "This format may be unreliable or change in the future "
-                "without an upgrade path.\n" % (inter.target._format,))
-
 
 class NoninteractiveUIFactory(UIFactory):
     """Base class for UIs with no user."""

=== modified file 'bzrlib/vf_repository.py'
--- a/bzrlib/vf_repository.py	2011-07-23 11:16:56 +0000
+++ b/bzrlib/vf_repository.py	2011-08-02 11:18:43 +0000
@@ -2495,7 +2495,10 @@
                             content is copied.
         :return: None.
         """
-        ui.ui_factory.warn_experimental_format_fetch(self)
+        if self.target._format.experimental:
+            ui.ui_factory.show_user_warning('experimental_format_fetch',
+                from_format=self.source._format,
+                to_format=self.target._format)
         from bzrlib.fetch import RepoFetcher
         # See <https://launchpad.net/bugs/456077> asking for a warning here
         if self.source._format.network_name() != self.target._format.network_name():
@@ -2940,7 +2943,10 @@
             revision_ids = fetch_spec.get_keys()
         else:
             revision_ids = None
-        ui.ui_factory.warn_experimental_format_fetch(self)
+        if self.source._format.experimental:
+            ui.ui_factory.show_user_warning('experimental_format_fetch',
+                from_format=self.source._format,
+                to_format=self.target._format)
         if (not self.source.supports_rich_root()
             and self.target.supports_rich_root()):
             self._converting_to_rich_root = True

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-08-05 16:51:01 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-08-05 19:18:20 +0000
@@ -125,6 +125,10 @@
 * Remove ``TransportListRegistry.set_default_transport``, as the concept of
   a default transport is currently unused. (Jelmer Vernooij)
 
+* Remove ``UIFactory.warn_cross_format_fetch`` and
+  ``UIFactory.warn_experimental_format_fetch`` in favor of
+  ``UIFactory.show_user_warning``. (Jelmer Vernooij)
+
 * There is a new class `ContentFilterTree` that provides a facade for 
   content filtering.  The `filtered` parameter to `export` is deprecated 
   in favor of passing a filtered tree, and the specific exporter plugins




More information about the bazaar-commits mailing list