/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

Support newer versions of bzr where only some InventoryFile/InventoryLink attributes are writable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
    else:
107
107
        cls = InventoryFile
108
108
    ie = cls(file_id, name.decode("utf-8"), parent_id)
109
 
    ie.executable = mode_is_executable(mode)
 
109
    if ie.kind == "file":
 
110
        ie.executable = mode_is_executable(mode)
110
111
    if base_hexsha == hexsha and mode_kind(base_mode) == mode_kind(mode):
111
112
        base_ie = base_inv[base_inv.path2id(path)]
112
113
        ie.text_size = base_ie.text_size
113
114
        ie.text_sha1 = base_ie.text_sha1
114
 
        ie.symlink_target = base_ie.symlink_target
 
115
        if ie.kind == "symlink":
 
116
            ie.symlink_target = base_ie.symlink_target
115
117
        if ie.executable == base_ie.executable:
116
118
            ie.revision = base_ie.revision
117
119
        else:
121
123
        if ie.kind == "symlink":
122
124
            ie.revision = None
123
125
            ie.symlink_target = blob.data
124
 
            ie.text_size = None
125
 
            ie.text_sha1 = None
126
126
        else:
127
127
            ie.text_size = sum(imap(len, blob.chunked))
128
128
            ie.text_sha1 = osutils.sha_strings(blob.chunked)