/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/plugins/git/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2018-07-14 19:33:15 UTC
  • mto: This revision was merged to the branch mainline in revision 7041.
  • Revision ID: jelmer@jelmer.uk-20180714193315-dksm3w715lfpknjq
Fix some more git tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
962
962
                # everything is missing
963
963
                direction = -1
964
964
            else:
965
 
                direction = cmp(current_inv[0][0], cur_disk_dir_relpath)
 
965
                direction = ((current_inv[0][0] > cur_disk_dir_relpath) -
 
966
                             (current_inv[0][0] < cur_disk_dir_relpath))
966
967
            if direction > 0:
967
968
                # disk is before inventory - unknown
968
969
                dirblock = [(relpath, basename, kind, stat, None, None) for
1020
1021
                except StopIteration:
1021
1022
                    disk_finished = True
1022
1023
 
1023
 
    def _walkdirs(self, prefix=""):
1024
 
        if prefix != "":
1025
 
            prefix += "/"
 
1024
    def _walkdirs(self, prefix=u""):
 
1025
        if prefix != u"":
 
1026
            prefix += u"/"
1026
1027
        prefix = prefix.encode('utf-8')
1027
1028
        per_dir = defaultdict(set)
1028
 
        if prefix == "":
1029
 
            per_dir[('', self.get_root_id())] = set()
 
1029
        if prefix == b"":
 
1030
            per_dir[(u'', self.get_root_id())] = set()
1030
1031
        def add_entry(path, kind):
1031
 
            if path == '' or not path.startswith(prefix):
 
1032
            if path == b'' or not path.startswith(prefix):
1032
1033
                return
1033
1034
            (dirname, child_name) = posixpath.split(path)
1034
1035
            add_entry(dirname, 'directory')