Rev 2474: Now that finding a file on disk which doesn't match in http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/renamed_file_111288

John Arbash Meinel john at arbash-meinel.com
Mon Apr 30 18:34:24 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/renamed_file_111288

------------------------------------------------------------
revno: 2474
revision-id: john at arbash-meinel.com-20070430173412-538b3mvbh9b8db8l
parent: john at arbash-meinel.com-20070430172939-hvjgsm1pinoawdy5
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: renamed_file_111288
timestamp: Mon 2007-04-30 12:34:12 -0500
message:
  Now that finding a file on disk which doesn't match
  the dirblock doesn't claim 'path_handled', it is identical
  to the case when the dirblock entry is marked as 'a' or 'r'.
  So remove the extra else clause for simplicity.
modified:
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
-------------- next part --------------
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2007-04-30 17:29:39 +0000
+++ b/bzrlib/workingtree_4.py	2007-04-30 17:34:12 +0000
@@ -2256,7 +2256,13 @@
                                        result[6],
                                        result[7],
                                       )
-                    elif current_entry[0][1] != current_path_info[1]:
+                    elif (current_entry[0][1] != current_path_info[1]
+                          or current_entry[1][target_index][0] in 'ar'):
+                        # The current path on disk doesn't match the dirblock
+                        # record. Either the dirblock is marked as absent, or
+                        # the file on disk is not present at all in the
+                        # dirblock. Either way, report about the dirblock
+                        # entry, and let other code handle the filesystem one.
                         if current_path_info[1] < current_entry[0][1]:
                             # extra file on disk: pass for now, but only
                             # increment the path, not the entry
@@ -2268,7 +2274,6 @@
                                 # this check should probably be outside the loop: one
                                 # 'iterate two trees' api, and then _iter_changes filters
                                 # unchanged pairs. - RBC 20070226
-                                # path_handled = True
                                 if (include_unchanged
                                     or result[2]                    # content change
                                     or result[3][0] != result[3][1] # versioned status
@@ -2289,33 +2294,6 @@
                                            result[7],
                                           )
                             advance_path = False
-                    elif current_entry[1][target_index][0] in 'ar':
-                        # The path matches, but the current entry is marked as
-                        # not being here. So we don't want to consider this
-                        # as a match. We still need to process the current
-                        # entry, though.
-                        advance_path = False
-                        path_handled = False
-                        for result in _process_entry(current_entry, None):
-                            if (include_unchanged
-                                or result[2]                    # content change
-                                or result[3][0] != result[3][1] # versioned status
-                                or result[4][0] != result[4][1] # parent id
-                                or result[5][0] != result[5][1] # name
-                                or result[6][0] != result[6][1] # kind
-                                or result[7][0] != result[7][1] # executable
-                                ):
-                                yield (result[0],
-                                       (utf8_decode_or_none(result[1][0]),
-                                        utf8_decode_or_none(result[1][1])),
-                                       result[2],
-                                       result[3],
-                                       result[4],
-                                       (utf8_decode_or_none(result[5][0]),
-                                        utf8_decode_or_none(result[5][1])),
-                                       result[6],
-                                       result[7],
-                                      )
                     else:
                         for result in _process_entry(current_entry, current_path_info):
                             # this check should probably be outside the loop: one



More information about the bazaar-commits mailing list