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

  • Committer: Jelmer Vernooij
  • Date: 2018-12-11 17:29:18 UTC
  • mto: This revision was merged to the branch mainline in revision 7223.
  • Revision ID: jelmer@jelmer.uk-20181211172918-35oxlunbe53ix1b2
Fix on python 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
706
706
        if oldpath is None and newpath is None:
707
707
            continue
708
708
        if oldpath is None:
709
 
            added.append(
710
 
                (osutils.normalized_filename(newpath)[0], mode_kind(newmode)))
 
709
            added.append((newpath, mode_kind(newmode)))
711
710
        elif newpath is None or newmode == 0:
712
711
            file_id = old_fileid_map.lookup_file_id(oldpath_decoded)
713
712
            ret.removed.append((oldpath_decoded, file_id, mode_kind(oldmode)))
734
733
            ret.unchanged.append(
735
734
                (newpath_decoded, file_id, mode_kind(newmode)))
736
735
 
737
 
    implicit_dirs = {''}
 
736
    implicit_dirs = {b''}
738
737
    for path, kind in added:
739
 
        if kind == 'directory' or newpath in target_extras:
 
738
        if kind == 'directory' or path in target_extras:
740
739
            continue
741
740
        implicit_dirs.update(osutils.parent_directories(path))
742
741
 
743
742
    for path, kind in added:
744
743
        if kind == 'directory' and path not in implicit_dirs:
745
744
            continue
 
745
        path_decoded = osutils.normalized_filename(path)[0]
746
746
        if path in target_extras:
747
 
            ret.unversioned.append((path, None, kind))
 
747
            ret.unversioned.append((path_decoded, None, kind))
748
748
        else:
749
 
            file_id = new_fileid_map.lookup_file_id(path)
750
 
            ret.added.append((path, file_id, kind))
 
749
            file_id = new_fileid_map.lookup_file_id(path_decoded)
 
750
            ret.added.append((path_decoded, file_id, kind))
751
751
 
752
752
    return ret
753
753