From d5f431af20cf181bf5e6a0e1100cc9e8b0ab5cf1 Mon Sep 17 00:00:00 2001
From: Holger Freyther <zecke@selfish.org>
Date: Sun, 13 Jan 2008 17:08:33 +0000
Subject: * Import revisions without a parent properly! The diffing would have
 been all right but   we have not diffed the two manifests at all. Now we are
 diffinf an empty manifest against   the initial one.

---
 contrib/mtn2git/mtn2git.py | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'contrib/mtn2git')

diff --git a/contrib/mtn2git/mtn2git.py b/contrib/mtn2git/mtn2git.py
index 94f467598e..db29edf725 100755
--- a/contrib/mtn2git/mtn2git.py
+++ b/contrib/mtn2git/mtn2git.py
@@ -244,6 +244,12 @@ def fast_import(ops, revision):
         all_modifications = all_modifications.union(modified)
         all_deleted = all_deleted.union(deleted) 
 
+    if len(revision["parent"]) == 0:
+        (added, modified, deleted) = diff_manifest(build_tree([],""), current_tree)
+        all_added = all_added.union(added)
+        all_modifications = all_modifications.union(modified)
+        all_deleted = all_deleted.union(deleted) 
+
     # TODO:
     # Readd the sanity check to see if we deleted and modified an entry. This
     # could probably happen if we have more than one parent (on a merge)?
-- 
cgit v1.2.3