~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-08 15:53:43 UTC
  • mto: (5609.48.3 2.3)
  • mto: This revision was merged to the branch mainline in revision 6027.
  • Revision ID: v.ladeuil+lp@free.fr-20110708155343-mqvck9jn15e4g9tu
Be more tolerant about ``bound_location`` from config files

Show diffs side-by-side

added added

removed removed

Lines of Context:
3466
3466
        if local and not bound_location:
3467
3467
            raise errors.LocalRequiresBoundBranch()
3468
3468
        master_branch = None
3469
 
        source_is_master = (self.source.user_url == bound_location)
 
3469
        source_is_master = False
 
3470
        if bound_location:
 
3471
            # bond_location comes from a config file, some care has to be taken
 
3472
            # to relate it to source.user_url
 
3473
            normalized = urlutils.normalize_url(bound_location)
 
3474
            try:
 
3475
                relpath = self.source.user_transport.relpath(normalized)
 
3476
                source_is_master = (relpath == '')
 
3477
            except (errors.PathNotChild, errors.InvalidURL):
 
3478
                source_is_master = False
3470
3479
        if not local and bound_location and not source_is_master:
3471
3480
            # not pulling from master, so we need to update master.
3472
3481
            master_branch = self.target.get_master_branch(possible_transports)