Rev 4725: (mbp) warning on local cross-format fetches in file:///home/pqm/archives/thelove/bzr/2.0/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jan 13 07:43:28 GMT 2010


At file:///home/pqm/archives/thelove/bzr/2.0/

------------------------------------------------------------
revno: 4725 [merge]
revision-id: pqm at pqm.ubuntu.com-20100113074324-g4mbj7sdxktz602t
parent: pqm at pqm.ubuntu.com-20100112234536-o7k4xeantero4ohj
parent: mbp at sourcefrog.net-20100112061231-c1pq3nhsk9735o5t
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.0
timestamp: Wed 2010-01-13 07:43:24 +0000
message:
  (mbp) warning on local cross-format fetches
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
=== modified file 'NEWS'
--- a/NEWS	2010-01-12 23:45:36 +0000
+++ b/NEWS	2010-01-13 07:43:24 +0000
@@ -41,6 +41,12 @@
 * Give a clearer message if the lockdir disappears after being apparently
   successfully taken.  (Martin Pool, #498378)
 
+* Give a warning when fetching between local repositories with
+  sufficiently different formats that the content will need to be
+  serialized (ie ``InterDifferingSerializer``) so the user has a clue that
+  upgrading could make it faster.
+  (Martin Pool, #456077)
+
 * If we fail to open ``~/.bzr.log`` write a clear message to stderr rather
   than using ``warning()``. The log file is opened before logging is set
   up, and it leads to very confusing: 'no handlers for "bzr"' messages for

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2009-09-03 02:04:04 +0000
+++ b/bzrlib/repository.py	2010-01-12 06:12:31 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
+# Copyright (C) 2005-2010 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
@@ -39,6 +39,7 @@
     osutils,
     revision as _mod_revision,
     symbol_versioning,
+    trace,
     tsort,
     ui,
     versionedfile,
@@ -3979,6 +3980,15 @@
         """See InterRepository.fetch()."""
         if fetch_spec is not None:
             raise AssertionError("Not implemented yet...")
+        # See <https://launchpad.net/bugs/456077> asking for a warning here
+        #
+        # nb this is only active for local-local fetches; other things using
+        # streaming.
+        trace.warning("Fetching between repositories with different formats\n"
+            "from %s to %s.\n"
+            "This may take some time. Upgrade the branches to the same format \n"
+            "for better results.\n"
+            % (self.source._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 'bzrlib/tests/blackbox/test_pull.py'
--- a/bzrlib/tests/blackbox/test_pull.py	2009-06-15 06:47:14 +0000
+++ b/bzrlib/tests/blackbox/test_pull.py	2010-01-12 06:12:31 +0000
@@ -390,4 +390,14 @@
         self.assertLength(18, self.hpss_calls)
         remote = Branch.open('stacked')
         self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
+    
+    def test_pull_cross_format_warning(self):
+        """You get a warning for probably slow cross-format pulls.
+        """
 
+        from_tree = self.make_branch_and_tree('from', format='2a')
+        to_tree = self.make_branch_and_tree('to', format='1.14-rich-root')
+        from_tree.commit(message='first commit')
+        out, err = self.run_bzr(['pull', '-d', 'to', 'from'])
+        self.assertContainsRe(err,
+            "(?m)Fetching between repositories with different formats.*")




More information about the bazaar-commits mailing list