summaryrefslogtreecommitdiff
path: root/revision_store.py
diff options
context:
space:
mode:
authorJohn Arbash Meinel <john@arbash-meinel.com>2009-11-12 16:29:42 -0600
committerJohn Arbash Meinel <john@arbash-meinel.com>2009-11-12 16:29:42 -0600
commit62eecb87827a28696393722f3c2b3b15434b4bdd (patch)
tree3dcf8958ef329411dd93d546cc975a15bedd0092 /revision_store.py
parent32a9ab89dc5a83681316652394e5edb662c7db3d (diff)
downloadbzr-fastimport-62eecb87827a28696393722f3c2b3b15434b4bdd.tar.gz
We need to handle when the object has been deleted.
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