~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: 2007-05-01 18:27:14 UTC
  • mfrom: (2472.2.2 dirstate_fixes)
  • Revision ID: pqm@pqm.ubuntu.com-20070501182714-71xp33bziogu3qu0
(John Arbash Meinel) Fix bug #111127 and bug #111288. WT4._iter_changes had difficulties with directories with '-', and filesystem renames.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2122
2122
                   current_block is not None):
2123
2123
                if (current_dir_info and current_block
2124
2124
                    and current_dir_info[0][0] != current_block[0]):
2125
 
                    if current_dir_info[0][0] < current_block[0] :
 
2125
                    if current_dir_info[0][0].split('/') < current_block[0].split('/'):
2126
2126
                        # filesystem data refers to paths not covered by the dirblock.
2127
2127
                        # this has two possibilities:
2128
2128
                        # A) it is versioned but empty, so there is no block for it
2256
2256
                                       result[6],
2257
2257
                                       result[7],
2258
2258
                                      )
2259
 
                    elif current_entry[0][1] != current_path_info[1]:
2260
 
                        if current_path_info[1] < current_entry[0][1]:
 
2259
                    elif (current_entry[0][1] != current_path_info[1]
 
2260
                          or current_entry[1][target_index][0] in 'ar'):
 
2261
                        # The current path on disk doesn't match the dirblock
 
2262
                        # record. Either the dirblock is marked as absent, or
 
2263
                        # the file on disk is not present at all in the
 
2264
                        # dirblock. Either way, report about the dirblock
 
2265
                        # entry, and let other code handle the filesystem one.
 
2266
                        if current_path_info[1].split('/') < current_entry[0][1].split('/'):
2261
2267
                            # extra file on disk: pass for now, but only
2262
2268
                            # increment the path, not the entry
2263
2269
                            advance_entry = False
2268
2274
                                # this check should probably be outside the loop: one
2269
2275
                                # 'iterate two trees' api, and then _iter_changes filters
2270
2276
                                # unchanged pairs. - RBC 20070226
2271
 
                                path_handled = True
2272
2277
                                if (include_unchanged
2273
2278
                                    or result[2]                    # content change
2274
2279
                                    or result[3][0] != result[3][1] # versioned status
2289
2294
                                           result[7],
2290
2295
                                          )
2291
2296
                            advance_path = False
2292
 
                    elif current_entry[1][target_index][0] in 'ar':
2293
 
                        # The path matches, but the current entry is marked as
2294
 
                        # not being here. So we don't want to consider this
2295
 
                        # as a match. We still need to process the current
2296
 
                        # entry, though.
2297
 
                        advance_path = False
2298
 
                        path_handled = False
2299
 
                        for result in _process_entry(current_entry, None):
2300
 
                            if (include_unchanged
2301
 
                                or result[2]                    # content change
2302
 
                                or result[3][0] != result[3][1] # versioned status
2303
 
                                or result[4][0] != result[4][1] # parent id
2304
 
                                or result[5][0] != result[5][1] # name
2305
 
                                or result[6][0] != result[6][1] # kind
2306
 
                                or result[7][0] != result[7][1] # executable
2307
 
                                ):
2308
 
                                yield (result[0],
2309
 
                                       (utf8_decode_or_none(result[1][0]),
2310
 
                                        utf8_decode_or_none(result[1][1])),
2311
 
                                       result[2],
2312
 
                                       result[3],
2313
 
                                       result[4],
2314
 
                                       (utf8_decode_or_none(result[5][0]),
2315
 
                                        utf8_decode_or_none(result[5][1])),
2316
 
                                       result[6],
2317
 
                                       result[7],
2318
 
                                      )
2319
2297
                    else:
2320
2298
                        for result in _process_entry(current_entry, current_path_info):
2321
2299
                            # this check should probably be outside the loop: one