Rev 6221: (jelmer) Add flag to indicate whether a repository supports unreferenced in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Mon Oct 17 15:20:33 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6221 [merge]
revision-id: pqm at pqm.ubuntu.com-20111017152032-yp2mve2gf9j8ru49
parent: pqm at pqm.ubuntu.com-20111017100224-hm1pav0lqgzv7y2s
parent: jelmer at samba.org-20111017144313-fz58bgstug0xo8i4
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2011-10-17 15:20:32 +0000
message:
  (jelmer) Add flag to indicate whether a repository supports unreferenced
   revisions. (Jelmer Vernooij)
modified:
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/per_branch/test_pull.py test_pull.py-20060410103942-83c35b26657414fc
  bzrlib/tests/per_interbranch/test_pull.py test_pull.py-20090227164435-0rtbqqyuh1rmm82n-1
  bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
  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/repository.py'
--- a/bzrlib/repository.py	2011-10-11 12:01:51 +0000
+++ b/bzrlib/repository.py	2011-10-17 08:45:09 +0000
@@ -1409,6 +1409,9 @@
     supports_versioned_directories = None
     # Can other repositories be nested into one of this format?
     supports_nesting_repositories = None
+    # Is it possible for revisions to be present without being referenced
+    # somewhere ?
+    supports_unreferenced_revisions = None
 
     def __repr__(self):
         return "%s()" % self.__class__.__name__

=== modified file 'bzrlib/tests/per_branch/test_pull.py'
--- a/bzrlib/tests/per_branch/test_pull.py	2011-09-26 15:21:01 +0000
+++ b/bzrlib/tests/per_branch/test_pull.py	2011-10-17 08:45:09 +0000
@@ -128,9 +128,10 @@
                           tree_a.branch.pull, tree_b.branch,
                           overwrite=False, stop_revision='rev2b')
         # It should not have updated the branch tip, but it should have fetched
-        # the revision
+        # the revision if the repository supports "invisible" revisions
         self.assertEqual('rev2a', tree_a.branch.last_revision())
-        self.assertTrue(tree_a.branch.repository.has_revision('rev2b'))
+        if tree_a.branch.repository._format.supports_unreferenced_revisions:
+            self.assertTrue(tree_a.branch.repository.has_revision('rev2b'))
         tree_a.branch.pull(tree_b.branch, overwrite=True,
                            stop_revision='rev2b')
         self.assertEqual('rev2b', tree_a.branch.last_revision())

=== modified file 'bzrlib/tests/per_interbranch/test_pull.py'
--- a/bzrlib/tests/per_interbranch/test_pull.py	2011-09-27 11:35:00 +0000
+++ b/bzrlib/tests/per_interbranch/test_pull.py	2011-10-17 08:45:09 +0000
@@ -110,9 +110,10 @@
                           tree_a.branch.pull, tree_b.branch,
                           overwrite=False, stop_revision='rev2b')
         # It should not have updated the branch tip, but it should have fetched
-        # the revision
+        # the revision if the repository supports "invisible" revisions.
         self.assertEqual('rev2a', tree_a.branch.last_revision())
-        self.assertTrue(tree_a.branch.repository.has_revision('rev2b'))
+        if tree_a.branch.repository._format.supports_unreferenced_revisions:
+            self.assertTrue(tree_a.branch.repository.has_revision('rev2b'))
         tree_a.branch.pull(tree_b.branch, overwrite=True,
                            stop_revision='rev2b')
         self.assertEqual('rev2b', tree_a.branch.last_revision())

=== modified file 'bzrlib/tests/per_repository/test_repository.py'
--- a/bzrlib/tests/per_repository/test_repository.py	2011-10-13 16:52:17 +0000
+++ b/bzrlib/tests/per_repository/test_repository.py	2011-10-17 08:45:09 +0000
@@ -73,6 +73,11 @@
         self.assertFormatAttribute('supports_nesting_repositories',
             (True, False))
 
+    def test_attribute_supports_unreferenced_revisions(self):
+        """Test the format.supports_unreferenced_revisions."""
+        self.assertFormatAttribute('supports_unreferenced_revisions',
+            (True, False))
+
     def test_attribute__fetch_reconcile(self):
         """Test the _fetch_reconcile attribute."""
         self.assertFormatAttribute('_fetch_reconcile', (True, False))

=== modified file 'bzrlib/vf_repository.py'
--- a/bzrlib/vf_repository.py	2011-10-11 12:01:51 +0000
+++ b/bzrlib/vf_repository.py	2011-10-17 08:45:09 +0000
@@ -80,6 +80,7 @@
 
     supports_full_versioned_files = True
     supports_versioned_directories = True
+    supports_unreferenced_revisions = True
 
     # Should commit add an inventory, or an inventory delta to the repository.
     _commit_inv_deltas = True

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-10-16 10:05:26 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-10-17 14:43:13 +0000
@@ -68,6 +68,11 @@
 
 * ``Branch.revision_history`` is now deprecated. (Jelmer Vernooij, #799519)
 
+* New flag ``RepositoryFormat.supports_unreferenced_revisions`` which
+  indicates whether revisions can be present in a repository without
+  being referenced from e.g. a branch history at the same time.
+  (Jelmer Vernooij)
+
 * ``UIFactory.choose`` has been added: prompt the user for a list of
   choices. (Benoît Pierre)
 




More information about the bazaar-commits mailing list