~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
3395
3395
        if local and not bound_location:
3396
3396
            raise errors.LocalRequiresBoundBranch()
3397
3397
        master_branch = None
3398
 
        if not local and bound_location and self.source.user_url != bound_location:
 
3398
        source_is_master = (self.source.user_url == bound_location)
 
3399
        if not local and bound_location and not source_is_master:
3399
3400
            # not pulling from master, so we need to update master.
3400
3401
            master_branch = self.target.get_master_branch(possible_transports)
3401
3402
            master_branch.lock_write()
3407
3408
            return self._pull(overwrite,
3408
3409
                stop_revision, _hook_master=master_branch,
3409
3410
                run_hooks=run_hooks,
3410
 
                _override_hook_target=_override_hook_target)
 
3411
                _override_hook_target=_override_hook_target,
 
3412
                merge_tags_to_master=not source_is_master)
3411
3413
        finally:
3412
3414
            if master_branch:
3413
3415
                master_branch.unlock()
3480
3482
 
3481
3483
    def _pull(self, overwrite=False, stop_revision=None,
3482
3484
             possible_transports=None, _hook_master=None, run_hooks=True,
3483
 
             _override_hook_target=None, local=False):
 
3485
             _override_hook_target=None, local=False,
 
3486
             merge_tags_to_master=True):
3484
3487
        """See Branch.pull.
3485
3488
 
3486
3489
        This function is the core worker, used by GenericInterBranch.pull to
3521
3524
            # so a tags implementation that versions tags can only 
3522
3525
            # pull in the most recent changes. -- JRV20090506
3523
3526
            result.tag_conflicts = self.source.tags.merge_to(self.target.tags,
3524
 
                overwrite)
 
3527
                overwrite, ignore_master=not merge_tags_to_master)
3525
3528
            result.new_revno, result.new_revid = self.target.last_revision_info()
3526
3529
            if _hook_master:
3527
3530
                result.master_branch = _hook_master