~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-17 04:15:17 UTC
  • mfrom: (1707.1.1 branch)
  • Revision ID: pqm@pqm.ubuntu.com-20060517041517-124d83271af952bc
Bugfixes to bzrdir.sprout and clone. Sprout was failing to reset the
shared flag in some circumstances, and clone was failing to preserve the
no-working-tree-flags. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        if local_repo:
119
119
            # may need to copy content in
120
120
            if force_new_repo:
121
 
                local_repo.clone(result, revision_id=revision_id, basis=basis_repo)
 
121
                result_repo = local_repo.clone(
 
122
                    result,
 
123
                    revision_id=revision_id,
 
124
                    basis=basis_repo)
 
125
                result_repo.set_make_working_trees(local_repo.make_working_trees())
122
126
            else:
123
127
                try:
124
128
                    result_repo = result.find_repository()
130
134
                    result_repo.fetch(local_repo, revision_id=revision_id)
131
135
                except errors.NoRepositoryPresent:
132
136
                    # needed to make one anyway.
133
 
                    local_repo.clone(result, revision_id=revision_id, basis=basis_repo)
 
137
                    result_repo = local_repo.clone(
 
138
                        result,
 
139
                        revision_id=revision_id,
 
140
                        basis=basis_repo)
 
141
                    result_repo.set_make_working_trees(local_repo.make_working_trees())
134
142
        # 1 if there is a branch present
135
143
        #   make sure its content is available in the target repository
136
144
        #   clone it.
567
575
            # no repo available, make a new one
568
576
            result.create_repository()
569
577
        elif source_repository is not None and result_repo is None:
570
 
            # have soure, and want to make a new target repo
571
 
            source_repository.clone(result,
572
 
                                    revision_id=revision_id,
573
 
                                    basis=basis_repo)
574
 
        else:
 
578
            # have source, and want to make a new target repo
 
579
            # we dont clone the repo because that preserves attributes
 
580
            # like is_shared(), and we have not yet implemented a 
 
581
            # repository sprout().
 
582
            result_repo = result.create_repository()
 
583
        if result_repo is not None:
575
584
            # fetch needed content into target.
576
585
            if basis_repo:
577
586
                # XXX FIXME RBC 20060214 need tests for this when the basis