Rev 2950: Change Repository.fetch to provide a find_ghosts parameter which triggers ghost filling. in http://people.ubuntu.com/~robertc/baz2.0/fetch

Robert Collins robertc at robertcollins.net
Mon Oct 29 23:55:49 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/fetch

------------------------------------------------------------
revno: 2950
revision-id:robertc at robertcollins.net-20071029235541-41o2q61c7hwagcol
parent: pqm at pqm.ubuntu.com-20071029221703-zy7q7a0ehfvpybtn
committer: Robert Collins <robertc at robertcollins.net>
branch nick: fetch
timestamp: Tue 2007-10-30 10:55:41 +1100
message:
  Change Repository.fetch to provide a find_ghosts parameter which triggers ghost filling.
modified:
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-10-28 23:47:31 +0000
+++ b/bzrlib/repository.py	2007-10-29 23:55:41 +0000
@@ -840,10 +840,13 @@
         extent possible considering file system caching etc).
         """
 
-    def fetch(self, source, revision_id=None, pb=None):
+    def fetch(self, source, revision_id=None, pb=None, find_ghosts=False):
         """Fetch the content required to construct revision_id from source.
 
         If revision_id is None all content is copied.
+        :param find_ghosts: Find and copy revisions in the source that are
+            ghosts in the target (and not reachable directly by walking out to
+            the first-present revision in target from revision_id).
         """
         # fast path same-url fetch operations
         if self.has_same_location(source):

=== modified file 'bzrlib/tests/interrepository_implementations/test_interrepository.py'
--- a/bzrlib/tests/interrepository_implementations/test_interrepository.py	2007-10-17 09:39:41 +0000
+++ b/bzrlib/tests/interrepository_implementations/test_interrepository.py	2007-10-29 23:55:41 +0000
@@ -337,7 +337,7 @@
         repo = repository.Repository.open('missing_ghost')
         rev = repo.get_revision('with_ghost')
         from_repo = repository.Repository.open('with_ghost_rev')
-        repo.fetch(from_repo)
+        repo.fetch(from_repo, find_ghosts=True)
         # rev must not be corrupt now
         rev = repo.get_revision('with_ghost')
         self.assertEqual([None, 'ghost', 'with_ghost'], repo.get_ancestry('with_ghost'))



More information about the bazaar-commits mailing list