summaryrefslogtreecommitdiff
path: root/revision_store.py
diff options
context:
space:
mode:
Diffstat (limited to 'revision_store.py')
-rw-r--r--revision_store.py44
1 files changed, 33 insertions, 11 deletions
diff --git a/revision_store.py b/revision_store.py
index 3aa0bdd..cd84e6a 100644
--- a/revision_store.py
+++ b/revision_store.py
@@ -81,6 +81,17 @@ class _TreeShim(object):
old_ie = basis_inv[file_id]
except errors.NoSuchId:
old_ie = None
+ if ie is None:
+ raise AssertionError('How is both old and new None?')
+ change = (file_id,
+ (old_path, new_path),
+ False,
+ (False, False),
+ (None, None),
+ (None, None),
+ (None, None),
+ (None, None),
+ )
change = (file_id,
(old_path, new_path),
True,
@@ -91,17 +102,28 @@ class _TreeShim(object):
(None, ie.executable),
)
else:
- content_modified = (ie.text_sha1 != old_ie.text_sha1
- or ie.text_size != old_ie.text_size)
- change = (file_id,
- (old_path, new_path),
- content_modified,
- (True, True),
- (old_ie.parent_id, ie.parent_id),
- (old_ie.name, ie.name),
- (old_ie.kind, ie.kind),
- (old_ie.executable, ie.executable),
- )
+ if ie is None:
+ change = (file_id,
+ (old_path, new_path),
+ True,
+ (True, False),
+ (old_ie.parent_id, None),
+ (old_ie.name, None),
+ (old_ie.kind, None),
+ (old_ie.executable, None),
+ )
+ else:
+ content_modified = (ie.text_sha1 != old_ie.text_sha1
+ or ie.text_size != old_ie.text_size)
+ change = (file_id,
+ (old_path, new_path),
+ content_modified,
+ (True, True),
+ (old_ie.parent_id, ie.parent_id),
+ (old_ie.name, ie.name),
+ (old_ie.kind, ie.kind),
+ (old_ie.executable, ie.executable),
+ )
yield change