summaryrefslogtreecommitdiff
path: root/contrib/mtn2git/mtn2git.py
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2008-01-08 03:14:28 +0000
committerHolger Freyther <zecke@selfish.org>2008-01-08 03:14:28 +0000
commit209b24d410d77f58e1bc5251c4a49d987a607eb1 (patch)
treed6dd35c9a8b7b9a3ee9f004bd823abe05db6a3b3 /contrib/mtn2git/mtn2git.py
parent17dc0d5e796a96bd625171a326aa5a1ed5ea9ec4 (diff)
contrib/mtn2git/mtn2git.py: Stub the most important function. diff_manifest will tell us what to do
Diffstat (limited to 'contrib/mtn2git/mtn2git.py')
-rwxr-xr-xcontrib/mtn2git/mtn2git.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/mtn2git/mtn2git.py b/contrib/mtn2git/mtn2git.py
index 346fe28d98..2d7e0c3366 100755
--- a/contrib/mtn2git/mtn2git.py
+++ b/contrib/mtn2git/mtn2git.py
@@ -157,6 +157,13 @@ def get_and_cache_tree(ops, revision):
cached_fifo = cached_fifo[1:]
del cached_tree[old_name]
+def diff_manifest(old_tree, new_tree):
+ """Find additions, modifications and deletions"""
+ added = set()
+ modified = set()
+ deleted = set()
+
+ return (added, modified, deleted)
def fast_import(ops, revision):
@@ -209,7 +216,12 @@ def fast_import(ops, revision):
if attribute == "mtn:execute":
all_modifications.add( (file, None, rev) )
-
+ # Now diff the manifests
+ for parent in revision["parent"]:
+ (added, modified, deleted) = diff_manifest(get_and_cache_tree(ops, parent), current_tree)
+ all_added = all_added.union(added)
+ all_modifications = all_modifications.union(modified)
+ all_deleted = all_modifications.union(deleted)
cmd = []
cmd += ["commit refs/heads/%s" % branch]