Rev 3671: Change the text a bit, and point to the explicit --1.6 or --1.6.1-rich-root bzrdir format. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration

John Arbash Meinel john at arbash-meinel.com
Tue Sep 2 22:36:17 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/jam-integration

------------------------------------------------------------
revno: 3671
revision-id: john at arbash-meinel.com-20080902213615-tcm28zy17l131n4u
parent: john at arbash-meinel.com-20080902212759-pz26098ijspuknnl
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Tue 2008-09-02 16:36:15 -0500
message:
  Change the text a bit, and point to the explicit --1.6 or --1.6.1-rich-root bzrdir format.
-------------- next part --------------
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-09-02 20:26:33 +0000
+++ b/bzrlib/bzrdir.py	2008-09-02 21:36:15 +0000
@@ -1046,12 +1046,13 @@
             mutter("using %r for stacking" % (format._branch_format,))
             from bzrlib.repofmt import pack_repo
             if format.repository_format.rich_root_data:
+                bzrdir_format_name = '1.6.1-rich-root'
                 repo_format = pack_repo.RepositoryFormatKnitPack5RichRoot()
             else:
+                bzrdir_format_name = '1.6'
                 repo_format = pack_repo.RepositoryFormatKnitPack5()
-            note('Stacking requires repository format:\n  %s\n'
-                 'Not preserving source format.',
-                 repo_format.get_format_description())
+            note('Source format does not support stacking, using format: %s\n  %s\n',
+                 bzrdir_format_name, repo_format.get_format_description())
             format.repository_format = repo_format
         return format
 

=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py	2008-09-02 21:27:59 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py	2008-09-02 21:36:15 +0000
@@ -220,10 +220,26 @@
         out, err = self.run_bzr(
             ['branch', '--stacked', 'trunk', 'shallow'])
         # We should notify the user that we upgraded their format
-        self.assertContainsRe(err, 'Stacking requires repository format:')
-        self.assertContainsRe(err, r'Packs 5 \(adds stacking support,'
-                                   r' requires bzr 1\.6\)')
-        self.assertContainsRe(err, r'Not preserving source format\.')
+        self.assertEqualDiff(
+            'Source format does not support stacking, using format: 1.6\n'
+            '  Packs 5 (adds stacking support, requires bzr 1.6)\n'
+            '\n'
+            'Created new stacked branch referring to %s.\n' % (trunk.base,),
+            err)
+
+    def test_branch_stacked_from_rich_root_non_stackable(self):
+        trunk = self.make_branch('trunk', format='rich-root-pack')
+        out, err = self.run_bzr(
+            ['branch', '--stacked', 'trunk', 'shallow'])
+        # We should notify the user that we upgraded their format
+        self.assertEqualDiff(
+            'Source format does not support stacking, using format:'
+            ' 1.6.1-rich-root\n'
+            '  Packs 5 rich-root (adds stacking support, requires bzr 1.6.1)\n'
+            '\n'
+            'Created new stacked branch referring to %s.\n' % (trunk.base,),
+            err)
+
 
 
 class TestRemoteBranch(TestCaseWithSFTPServer):



More information about the bazaar-commits mailing list