~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Vincent Ladeuil
  • Date: 2007-04-26 09:01:46 UTC
  • mfrom: (2420.2.2 bzr.http.auth)
  • mto: This revision was merged to the branch mainline in revision 2463.
  • Revision ID: v.ladeuil+lp@free.fr-20070426090146-jbwl0muvk76wlw6c
Merge spiv modifications

Show diffs side-by-side

added added

removed removed

Lines of Context:
395
395
 
396
396
        :return: The newly created destination repository.
397
397
        """
 
398
        # TODO: deprecate after 0.16; cloning this with all its settings is
 
399
        # probably not very useful -- mbp 20070423
 
400
        dest_repo = self._create_sprouting_repo(a_bzrdir, shared=self.is_shared())
 
401
        self.copy_content_into(dest_repo, revision_id)
 
402
        return dest_repo
 
403
 
 
404
    @needs_read_lock
 
405
    def sprout(self, to_bzrdir, revision_id=None):
 
406
        """Create a descendent repository for new development.
 
407
 
 
408
        Unlike clone, this does not copy the settings of the repository.
 
409
        """
 
410
        dest_repo = self._create_sprouting_repo(to_bzrdir, shared=False)
 
411
        dest_repo.fetch(self, revision_id=revision_id)
 
412
        return dest_repo
 
413
 
 
414
    def _create_sprouting_repo(self, a_bzrdir, shared):
398
415
        if not isinstance(a_bzrdir._format, self.bzrdir._format.__class__):
399
416
            # use target default format.
400
417
            dest_repo = a_bzrdir.create_repository()
402
419
            # Most control formats need the repository to be specifically
403
420
            # created, but on some old all-in-one formats it's not needed
404
421
            try:
405
 
                dest_repo = self._format.initialize(a_bzrdir, shared=self.is_shared())
 
422
                dest_repo = self._format.initialize(a_bzrdir, shared=shared)
406
423
            except errors.UninitializableFormat:
407
424
                dest_repo = a_bzrdir.open_repository()
408
 
        self.copy_content_into(dest_repo, revision_id)
409
425
        return dest_repo
410
426
 
411
427
    @needs_read_lock
772
788
        reconciler = RepoReconciler(self, thorough=thorough)
773
789
        reconciler.reconcile()
774
790
        return reconciler
775
 
    
 
791
 
776
792
    @needs_read_lock
777
793
    def revision_tree(self, revision_id):
778
794
        """Return Tree for a revision on this branch.
1385
1401
    @needs_write_lock
1386
1402
    def copy_content(self, revision_id=None):
1387
1403
        """Make a complete copy of the content in self into destination.
 
1404
 
 
1405
        This copies both the repository's revision data, and configuration information
 
1406
        such as the make_working_trees setting.
1388
1407
        
1389
1408
        This is a destructive operation! Do not use it on existing 
1390
1409
        repositories.