~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
1293
1293
            if repository_policy is not None:
1294
1294
                repository_policy.configure_branch(result)
1295
1295
            self.copy_content_into(result, revision_id=revision_id)
1296
 
            master_branch = self.get_master_branch()
1297
 
            if master_branch is None:
 
1296
            master_url = self.get_bound_location()
 
1297
            if master_url is None:
1298
1298
                result.set_parent(self.bzrdir.root_transport.base)
1299
1299
            else:
1300
 
                result.set_parent(master_branch.bzrdir.root_transport.base)
 
1300
                result.set_parent(master_url)
1301
1301
        finally:
1302
1302
            result.unlock()
1303
1303
        return result
3344
3344
        if local and not bound_location:
3345
3345
            raise errors.LocalRequiresBoundBranch()
3346
3346
        master_branch = None
3347
 
        source_is_master = (self.source.user_url == bound_location)
 
3347
        source_is_master = False
 
3348
        if bound_location:
 
3349
            # bound_location comes from a config file, some care has to be
 
3350
            # taken to relate it to source.user_url
 
3351
            normalized = urlutils.normalize_url(bound_location)
 
3352
            try:
 
3353
                relpath = self.source.user_transport.relpath(normalized)
 
3354
                source_is_master = (relpath == '')
 
3355
            except (errors.PathNotChild, errors.InvalidURL):
 
3356
                source_is_master = False
3348
3357
        if not local and bound_location and not source_is_master:
3349
3358
            # not pulling from master, so we need to update master.
3350
3359
            master_branch = self.target.get_master_branch(possible_transports)