From 209b24d410d77f58e1bc5251c4a49d987a607eb1 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Tue, 8 Jan 2008 03:14:28 +0000 Subject: [PATCH] contrib/mtn2git/mtn2git.py: Stub the most important function. diff_manifest will tell us what to do --- contrib/mtn2git/mtn2git.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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] -- 2.39.5