~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Robert Collins
  • Date: 2007-03-06 12:28:18 UTC
  • mto: (2321.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: robertc@robertcollins.net-20070306122818-xk0lc3l01ecl6vbc
Get merge_nested finally working: change nested tree iterators to take file_ids, and ensure the right branch is connected to in the merge logic. May not be suitable for shared repositories yet.

Show diffs side-by-side

added added

removed removed

Lines of Context:
768
768
            wt = None
769
769
        if recurse == 'down':
770
770
            if wt is not None:
771
 
                entries = wt.iter_reference_entries()
 
771
                basis = wt.basis_tree()
 
772
                basis.lock_read()
 
773
                subtrees = basis.iter_references()
772
774
                recurse_branch = wt.branch
773
775
            elif source_branch is not None:
774
 
                entries = source_branch.basis_tree().iter_reference_entries()
 
776
                basis = source_branch.basis_tree()
 
777
                basis.lock_read()
 
778
                subtrees = basis.iter_references()
775
779
                recurse_branch = source_branch
776
780
            else:
777
 
                entries = []
778
 
            for path, entry in entries:
779
 
                target = urlutils.join(url, urlutils.escape(path))
780
 
                sublocation = source_branch.reference_parent(entry.file_id,
781
 
                                                             path)
782
 
                sublocation.bzrdir.sprout(target, entry.reference_revision,
783
 
                    force_new_repo=force_new_repo, recurse=recurse)
 
781
                subtrees = []
 
782
                basis = None
 
783
            try:
 
784
                for path, file_id in subtrees:
 
785
                    target = urlutils.join(url, urlutils.escape(path))
 
786
                    sublocation = source_branch.reference_parent(file_id, path)
 
787
                    sublocation.bzrdir.sprout(target,
 
788
                        basis.get_reference_revision(file_id, path),
 
789
                        force_new_repo=force_new_repo, recurse=recurse)
 
790
            finally:
 
791
                if basis is not None:
 
792
                    basis.unlock()
784
793
        return result
785
794
 
786
795