~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-14 07:41:17 UTC
  • mfrom: (3619.4.4 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080814074117-x0zvzzv7y6mok8pz
(robertc) Improve the testing of InterTree.iter_changes and fix bugs
        found as a result (Robert Collins, Aaron Bentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1980
1980
        # record is handled, but isn't interesting to process (unchanged)
1981
1981
        uninteresting = object()
1982
1982
 
1983
 
 
1984
1983
        old_dirname_to_file_id = {}
1985
1984
        new_dirname_to_file_id = {}
1986
1985
        # TODO: jam 20070516 - Avoid the _get_entry lookup overhead by
2169
2168
                    return uninteresting
2170
2169
            elif source_minikind in 'a' and target_minikind in 'fdlt':
2171
2170
                # looks like a new file
 
2171
                path = pathjoin(entry[0][0], entry[0][1])
 
2172
                # parent id is the entry for the path in the target tree
 
2173
                # TODO: these are the same for an entire directory: cache em.
 
2174
                parent_id = state._get_entry(target_index,
 
2175
                                             path_utf8=entry[0][0])[0][2]
 
2176
                if parent_id == entry[0][2]:
 
2177
                    parent_id = None
2172
2178
                if path_info is not None:
2173
 
                    path = pathjoin(entry[0][0], entry[0][1])
2174
 
                    # parent id is the entry for the path in the target tree
2175
 
                    # TODO: these are the same for an entire directory: cache em.
2176
 
                    parent_id = state._get_entry(target_index,
2177
 
                                                 path_utf8=entry[0][0])[0][2]
2178
 
                    if parent_id == entry[0][2]:
2179
 
                        parent_id = None
 
2179
                    # Present on disk:
2180
2180
                    if use_filesystem_for_exec:
2181
2181
                        # We need S_ISREG here, because we aren't sure if this
2182
2182
                        # is a file or not.
2194
2194
                           (None, path_info[2]),
2195
2195
                           (None, target_exec))
2196
2196
                else:
2197
 
                    # but its not on disk: we deliberately treat this as just
2198
 
                    # never-present. (Why ?! - RBC 20070224)
2199
 
                    pass
 
2197
                    # Its a missing file, report it as such.
 
2198
                    return (entry[0][2],
 
2199
                           (None, utf8_decode(path)[0]),
 
2200
                           False,
 
2201
                           (False, True),
 
2202
                           (None, parent_id),
 
2203
                           (None, utf8_decode(entry[0][1])[0]),
 
2204
                           (None, None),
 
2205
                           (None, False))
2200
2206
            elif source_minikind in 'fdlt' and target_minikind in 'a':
2201
2207
                # unversioned, possibly, or possibly not deleted: we dont care.
2202
2208
                # if its still on disk, *and* theres no other entry at this
2521
2527
                    except StopIteration:
2522
2528
                        current_dir_info = None
2523
2529
 
2524
 
 
2525
2530
    @staticmethod
2526
2531
    def is_compatible(source, target):
2527
2532
        # the target must be a dirstate working tree