~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tag.py

  • Committer: Andrew Bennetts
  • Date: 2011-03-18 01:12:17 UTC
  • mto: (5609.24.3 2.3)
  • mto: This revision was merged to the branch mainline in revision 5732.
  • Revision ID: andrew.bennetts@canonical.com-20110318011217-h1206xizh4kj1ldw
Alternative fix: cache the result of get_master_branch for the lifetime of the branch lock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
290
290
        return result, conflicts
291
291
 
292
292
 
293
 
def _merge_tags_if_possible(from_branch, to_branch, ignore_master=False,
294
 
        overwrite=False):
 
293
def _merge_tags_if_possible(from_branch, to_branch, ignore_master=False):
295
294
    # Try hard to support merge_to implementations that don't expect
296
295
    # 'ignore_master' (new in bzr 2.3).  First, if the flag isn't set then we
297
296
    # can safely avoid passing ignore_master at all.
298
297
    if not ignore_master:
299
 
        return from_branch.tags.merge_to(to_branch.tags, overwrite=overwrite)
 
298
        from_branch.tags.merge_to(to_branch.tags)
 
299
        return
300
300
    # If the flag is set, try to pass it, but be ready to catch TypeError.
301
301
    try:
302
 
        return from_branch.tags.merge_to(
303
 
            to_branch.tags, ignore_master=ignore_master, overwrite=overwrite)
 
302
        from_branch.tags.merge_to(to_branch.tags, ignore_master=ignore_master)
304
303
    except TypeError:
305
304
        # Probably this implementation of 'merge_to' is from a plugin that
306
305
        # doesn't expect the 'ignore_master' keyword argument (e.g. bzr-svn
313
312
                "Tags.merge_to (of %r) that doesn't accept ignore_master kwarg"
314
313
                % (from_branch.tags,),),
315
314
            DeprecationWarning)
316
 
        return from_branch.tags.merge_to(to_branch.tags)
 
315
        from_branch.tags.merge_to(to_branch.tags)
317
316
 
318
317
 
319
318
def sort_natural(branch, tags):