/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tag.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from __future__ import absolute_import
26
26
 
27
27
from collections import defaultdict
 
28
import contextlib
28
29
 
29
30
# NOTE: I was going to call this tags.py, but vim seems to think all files
30
31
# called tags* are ctags files... mbp 20070220.
31
32
 
32
33
from .registry import Registry
33
 
from .sixish import text_type
34
34
from .lazy_import import lazy_import
35
35
lazy_import(globals(), """
36
36
import itertools
39
39
 
40
40
from breezy import (
41
41
    bencode,
42
 
    cleanup,
43
42
    trace,
44
43
    )
45
44
""")
286
285
            (tagname, source_target, dest_target), or None if no copying was
287
286
            done.
288
287
        """
289
 
        with cleanup.ExitStack() as stack:
 
288
        with contextlib.ExitStack() as stack:
290
289
            if self.branch == to_tags.branch:
291
290
                return {}, []
292
291
            if not self.branch.supports_tags():
406
405
    """
407
406
    def natural_sort_key(tag):
408
407
        return [f(s) for f, s in
409
 
                zip(itertools.cycle((text_type.lower, int)),
 
408
                zip(itertools.cycle((str.lower, int)),
410
409
                    re.split('([0-9]+)', tag[0]))]
411
410
    tags.sort(key=natural_sort_key)
412
411