~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Robert Collins
  • Date: 2007-03-05 01:15:25 UTC
  • mto: (2255.11.4 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: robertc@robertcollins.net-20070305011525-fakb9irlbxyxaukb
Change _iter_changes interface to yield both old and new paths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1459
1459
            output. An unversioned file is defined as one with (False, False)
1460
1460
            for the versioned pair.
1461
1461
        """
1462
 
        utf8_decode = cache_utf8._utf8_decode
 
1462
        utf8_decode = cache_utf8._utf8_decode_with_None
1463
1463
        _minikind_to_kind = dirstate.DirState._minikind_to_kind
1464
1464
        # NB: show_status depends on being able to pass in non-versioned files
1465
1465
        # and report them as unknown
1645
1645
                    old_path = path = pathjoin(old_dirname, old_basename)
1646
1646
                if path_info is None:
1647
1647
                    # the file is missing on disk, show as removed.
1648
 
                    old_path = pathjoin(entry[0][0], entry[0][1])
1649
1648
                    content_change = True
1650
1649
                    target_kind = None
1651
1650
                    target_exec = False
1711
1710
                        last_target_parent[2] = target_parent_entry
1712
1711
 
1713
1712
                source_exec = source_details[3]
1714
 
                return ((entry[0][2], path, content_change,
 
1713
                return ((entry[0][2], (old_path, path), content_change,
1715
1714
                        (True, True),
1716
1715
                        (source_parent_id, target_parent_id),
1717
1716
                        (old_basename, entry[0][1]),
1730
1729
                    target_exec = bool(
1731
1730
                        stat.S_ISREG(path_info[3].st_mode)
1732
1731
                        and stat.S_IEXEC & path_info[3].st_mode)
1733
 
                    return ((entry[0][2], path, True,
 
1732
                    return ((entry[0][2], (None, path), True,
1734
1733
                            (False, True),
1735
1734
                            (None, parent_id),
1736
1735
                            (None, entry[0][1]),
1750
1749
                parent_id = state._get_entry(source_index, path_utf8=entry[0][0])[0][2]
1751
1750
                if parent_id == entry[0][2]:
1752
1751
                    parent_id = None
1753
 
                return ((entry[0][2], old_path, True,
 
1752
                return ((entry[0][2], (old_path, None), True,
1754
1753
                        (True, False),
1755
1754
                        (parent_id, None),
1756
1755
                        (entry[0][1], None),
1812
1811
                        or result[7][0] != result[7][1] # executable
1813
1812
                        ):
1814
1813
                        result = (result[0],
1815
 
                                  utf8_decode(result[1])[0]) + result[2:]
 
1814
                            ((utf8_decode(result[1][0])[0]),
 
1815
                             utf8_decode(result[1][1])[0]),) + result[2:]
1816
1816
                        yield result
1817
1817
            if want_unversioned and not path_handled:
1818
1818
                new_executable = bool(
1819
1819
                    stat.S_ISREG(root_dir_info[3].st_mode)
1820
1820
                    and stat.S_IEXEC & root_dir_info[3].st_mode)
1821
 
                yield (None, current_root, True, (False, False), (None, None),
 
1821
                yield (None, (None, current_root), True, (False, False),
 
1822
                    (None, None),
1822
1823
                    (None, splitpath(current_root)[-1]),
1823
1824
                    (None, root_dir_info[2]), (None, new_executable))
1824
1825
            dir_iterator = osutils._walkdirs_utf8(root_abspath, prefix=current_root)
1896
1897
                                    or result[7][0] != result[7][1] # executable
1897
1898
                                    ):
1898
1899
                                    result = (result[0],
1899
 
                                              utf8_decode(result[1])[0]) + result[2:]
 
1900
                                        ((utf8_decode(result[1][0])[0]),
 
1901
                                         utf8_decode(result[1][1])[0]),) + result[2:]
1900
1902
                                    yield result
1901
1903
                        block_index +=1
1902
1904
                        if (block_index < len(state._dirblocks) and
1940
1942
                                or result[7][0] != result[7][1] # executable
1941
1943
                                ):
1942
1944
                                result = (result[0],
1943
 
                                          utf8_decode(result[1])[0]) + result[2:]
 
1945
                                    ((utf8_decode(result[1][0])[0]),
 
1946
                                     utf8_decode(result[1][1])[0]),) + result[2:]
1944
1947
                                yield result
1945
1948
                    elif current_entry[0][1] != current_path_info[1]:
1946
1949
                        if current_path_info[1] < current_entry[0][1]:
1966
1969
                                    or result[7][0] != result[7][1] # executable
1967
1970
                                    ):
1968
1971
                                    result = (result[0],
1969
 
                                              utf8_decode(result[1])[0]) + result[2:]
 
1972
                                        ((utf8_decode(result[1][0])[0]),
 
1973
                                         utf8_decode(result[1][1])[0]),) + result[2:]
1970
1974
                                    yield result
1971
1975
                            advance_path = False
1972
1976
                    else:
1984
1988
                                or result[7][0] != result[7][1] # executable
1985
1989
                                ):
1986
1990
                                result = (result[0],
1987
 
                                          utf8_decode(result[1])[0]) + result[2:]
 
1991
                                    ((utf8_decode(result[1][0])[0]),
 
1992
                                     utf8_decode(result[1][1])[0]),) + result[2:]
1988
1993
                                yield result
1989
1994
                    if advance_entry and current_entry is not None:
1990
1995
                        entry_index += 1
2002
2007
                                    stat.S_ISREG(current_path_info[3].st_mode)
2003
2008
                                    and stat.S_IEXEC & current_path_info[3].st_mode)
2004
2009
                                if want_unversioned:
2005
 
                                    yield (None, current_path_info[0], True,
2006
 
                                           (False, False),
2007
 
                                           (None, None),
2008
 
                                           (None, current_path_info[1]),
2009
 
                                           (None, current_path_info[2]),
2010
 
                                           (None, new_executable))
 
2010
                                    yield (None, (None, current_path_info[0]),
 
2011
                                        True,
 
2012
                                        (False, False),
 
2013
                                        (None, None),
 
2014
                                        (None, current_path_info[1]),
 
2015
                                        (None, current_path_info[2]),
 
2016
                                        (None, new_executable))
2011
2017
                            # dont descend into this unversioned path if it is
2012
2018
                            # a dir
2013
2019
                            if current_path_info[2] == 'directory':