~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2010-04-21 11:27:04 UTC
  • mto: This revision was merged to the branch mainline in revision 5189.
  • Revision ID: mbp@canonical.com-20100421112704-zijso22b6pdevrxy
Simplify various code to use user_url

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
                # copied, and finally if we are copying up to a specific
295
295
                # revision_id then we can use the pending-ancestry-result which
296
296
                # does not require traversing all of history to describe it.
297
 
                if (result_repo.bzrdir.root_transport.base ==
298
 
                    result.root_transport.base and not require_stacking and
 
297
                if (result_repo.user_url == result.user_url
 
298
                    and not require_stacking and
299
299
                    revision_id is not None):
300
300
                    fetch_spec = graph.PendingAncestryResult(
301
301
                        [revision_id], local_repo)
491
491
            stop = False
492
492
            stack_on = config.get_default_stack_on()
493
493
            if stack_on is not None:
494
 
                stack_on_pwd = found_bzrdir.root_transport.base
 
494
                stack_on_pwd = found_bzrdir.user_url
495
495
                stop = True
496
496
            # does it have a repository ?
497
497
            try:
499
499
            except errors.NoRepositoryPresent:
500
500
                repository = None
501
501
            else:
502
 
                if ((found_bzrdir.root_transport.base !=
503
 
                     self.root_transport.base) and not repository.is_shared()):
 
502
                if (found_bzrdir.user_url != self.user_url 
 
503
                    and not repository.is_shared()):
504
504
                    # Don't look higher, can't use a higher shared repo.
505
505
                    repository = None
506
506
                    stop = True
702
702
            if stop:
703
703
                return result
704
704
            next_transport = found_bzrdir.root_transport.clone('..')
705
 
            if (found_bzrdir.root_transport.base == next_transport.base):
 
705
            if (found_bzrdir.user_url == next_transport.base):
706
706
                # top of the file system
707
707
                return None
708
708
            # find the next containing bzrdir
725
725
                repository = found_bzrdir.open_repository()
726
726
            except errors.NoRepositoryPresent:
727
727
                return None, False
728
 
            if found_bzrdir.root_transport.base == self.root_transport.base:
 
728
            if found_bzrdir.user_url == self.user_url:
729
729
                return repository, True
730
730
            elif repository.is_shared():
731
731
                return repository, True
2694
2694
            if isinstance(self.bzrdir.transport, local.LocalTransport):
2695
2695
                self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2696
2696
            self._convert_to_weaves()
2697
 
            return BzrDir.open(self.bzrdir.root_transport.base)
 
2697
            return BzrDir.open(self.bzrdir.user_url)
2698
2698
        finally:
2699
2699
            self.pb.finished()
2700
2700
 
2947
2947
        try:
2948
2948
            ui.ui_factory.note('starting upgrade from format 5 to 6')
2949
2949
            self._convert_to_prefixed()
2950
 
            return BzrDir.open(self.bzrdir.root_transport.base)
 
2950
            return BzrDir.open(self.bzrdir.user_url)
2951
2951
        finally:
2952
2952
            pb.finished()
2953
2953
 
3075
3075
            BzrDirMetaFormat1().get_format_string(),
3076
3076
            mode=self.file_mode)
3077
3077
        self.pb.finished()
3078
 
        return BzrDir.open(self.bzrdir.root_transport.base)
 
3078
        return BzrDir.open(self.bzrdir.user_url)
3079
3079
 
3080
3080
    def make_lock(self, name):
3081
3081
        """Make a lock for the new control dir name."""
3662
3662
            try:
3663
3663
                stack_on = urlutils.rebase_url(self._stack_on,
3664
3664
                    self._stack_on_pwd,
3665
 
                    branch.bzrdir.root_transport.base)
 
3665
                    branch.user_url)
3666
3666
            except errors.InvalidRebaseURLs:
3667
3667
                stack_on = self._get_full_stack_on()
3668
3668
        try: