/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 fetch.py

Track unusual file modes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
            base_sha = shagitmap.lookup_tree(file_id, base_inv.revision_id)
210
210
        except KeyError:
211
211
            pass
212
 
        else:11):
 
212
        else:
213
213
            if base_sha == hexsha:
214
214
                # If nothing has changed since the base revision, we're done
215
215
                return [], {}
239
239
            file_kind = (mode & 070000) / 010000
240
240
            if file_kind == 0: # regular file
241
241
                symlink = False
242
 
                if mode != DEFAULT_FILE_MODE:
 
242
                if mode not in (DEFAULT_FILE_MODE, DEFAULT_FILE_MODE|0111):
243
243
                    child_modes[child_path] = mode
244
244
            elif file_kind == 2:
245
245
                symlink = True
246
 
                if mode not in (DEFAULT_SYMLINK_MODE, DEFAULT_TREE_MODE | 0111):
 
246
                if mode != DEFAULT_SYMLINK_MODE:
247
247
                    child_modes[child_path] = mode
248
248
            else:
249
249
                raise AssertionError("Unknown file kind, mode=%r" % (mode,))
250
250
            subinvdelta = import_git_blob(texts, mapping, child_path, hexsha,
251
251
                    base_inv, file_id, revision_id, parent_invs, shagitmap, 
252
 
                    lookup_object, bool(fs_mode & 0111), symlink))
 
252
                    lookup_object, bool(fs_mode & 0111), symlink)
253
253
            invdelta.extend(subinvdelta)
254
254
        else:
255
255
            raise AssertionError("Unknown object kind, perms=%r." % (mode,))
330
330
            base_inv = Inventory(root_id=None)
331
331
        else:
332
332
            base_inv = parent_invs[0]
333
 
        inv_delta = import_git_tree(repo.texts, mapping, "", 
 
333
        inv_delta, unusual_modes = import_git_tree(repo.texts, mapping, "", 
334
334
            root_trees[revid], base_inv, None, revid, parent_invs, 
335
335
            target_git_object_retriever._idmap, lookup_object)
 
336
        if unusual_modes != {}:
 
337
            ret = "unusual modes: \n"
 
338
            for item in unusual_modes.iteritems():
 
339
                ret += "\t%s: %o\n" % item
 
340
            raise AssertionError(ret)
336
341
        try:
337
342
            basis_id = rev.parent_ids[0]
338
343
        except IndexError: