summaryrefslogtreecommitdiff
path: root/revision_store.py
diff options
context:
space:
mode:
authorIan Clatworthy <ian.clatworthy@canonical.com>2009-03-16 17:01:06 +1000
committerIan Clatworthy <ian.clatworthy@canonical.com>2009-03-16 17:01:06 +1000
commite9659024a168198b868c93101f043d6ce168e0f3 (patch)
tree2c6c2d150ccfc6b0242dbb5dc4b77051883ba1fa /revision_store.py
parenta1c67e37afa8f3c1eb2a159e4fdb0b11ed3f1057 (diff)
downloadbzr-fastimport-e9659024a168198b868c93101f043d6ce168e0f3.tar.gz
fix per-graph parent handling for adds and renames
Diffstat (limited to 'revision_store.py')
-rw-r--r--revision_store.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/revision_store.py b/revision_store.py
index 229183f..10731ab 100644
--- a/revision_store.py
+++ b/revision_store.py
@@ -110,7 +110,7 @@ class AbstractRevisionStore(object):
def get_parents_and_revision_for_entry(self, ie):
"""Get the parents and revision for an inventory entry.
-
+
:param ie: the inventory entry
:return parents, revision_id where
parents is the tuple of parent revision_ids for the per-file graph
@@ -135,16 +135,19 @@ class AbstractRevisionStore(object):
if ie.file_id in inv:
old_rev = inv[ie.file_id].revision
if old_rev in head_set:
- heads.append(inv[ie.file_id].revision)
- head_set.remove(inv[ie.file_id].revision)
+ rev_id = inv[ie.file_id].revision
+ heads.append(rev_id)
+ head_set.remove(rev_id)
# Find the revision to use. If the content has not changed
# since the parent, record the parent's revision.
+ if len(heads) == 0:
+ return (), ie.revision
parent_entry = parent_candidate_entries[heads[0]]
changed = False
if len(heads) > 1:
changed = True
- elif (parent_entry.kind != ie.kind or
+ elif (parent_entry.name != ie.name or parent_entry.kind != ie.kind or
parent_entry.parent_id != ie.parent_id):
changed = True
elif ie.kind == 'file':