/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/bzr/inventory.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
from ..sixish import (
54
54
    bytesintern,
55
55
    PY3,
 
56
    text_type,
56
57
    viewitems,
57
58
    viewvalues,
58
59
    )
667
668
                return
668
669
            from_dir = self.root
669
670
            yield '', self.root
670
 
        elif isinstance(from_dir, basestring):
 
671
        elif isinstance(from_dir, (str, text_type)):
671
672
            from_dir = self[from_dir]
672
673
 
673
674
        # unrolling the recursive called changed the time from
751
752
            if (specific_file_ids is None or yield_parents or
752
753
                self.root.file_id in specific_file_ids):
753
754
                yield u'', self.root
754
 
        elif isinstance(from_dir, basestring):
 
755
        elif isinstance(from_dir, (str, text_type)):
755
756
            from_dir = self[from_dir]
756
757
 
757
758
        if specific_file_ids is not None:
843
844
 
844
845
        Returns None IFF the path is not found.
845
846
        """
846
 
        if isinstance(relpath, basestring):
 
847
        if isinstance(relpath, (str, text_type)):
847
848
            names = osutils.splitpath(relpath)
848
849
        else:
849
850
            names = relpath
2094
2095
    def path2id(self, relpath):
2095
2096
        """See CommonInventory.path2id()."""
2096
2097
        # TODO: perhaps support negative hits?
2097
 
        if isinstance(relpath, basestring):
 
2098
        if isinstance(relpath, (str, text_type)):
2098
2099
            names = osutils.splitpath(relpath)
2099
2100
        else:
2100
2101
            names = relpath