~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: 2009-02-25 06:35:28 UTC
  • mfrom: (4044.1.5 push.roundtrips)
  • Revision ID: pqm@pqm.ubuntu.com-20090225063528-m6c41lna1xu4bdwm
(robertc) Remove a wasted round trip determining whether a repository
        wants working trees made when we cannot create a working tree
        anyway due to the bzrdir being on a non-local path. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
            result_branch = local_branch.clone(result, revision_id=revision_id)
233
233
            if repository_policy is not None:
234
234
                repository_policy.configure_branch(result_branch)
235
 
        if result_repo is None or result_repo.make_working_trees():
236
 
            try:
 
235
        try:
 
236
            # Cheaper to check if the target is not local, than to try making
 
237
            # the tree and fail.
 
238
            result.root_transport.local_abspath('.')
 
239
            if result_repo is None or result_repo.make_working_trees():
237
240
                self.open_workingtree().clone(result)
238
 
            except (errors.NoWorkingTree, errors.NotLocalUrl):
239
 
                pass
 
241
        except (errors.NoWorkingTree, errors.NotLocalUrl):
 
242
            pass
240
243
        return result
241
244
 
242
245
    # TODO: This should be given a Transport, and should chdir up; otherwise