[oe-commits] org.oe.dev contrib/mtn2git/mtn2git.py: Stub the most important function. diff_manifest will tell us what to do
freyther commit
openembedded-commits at lists.openembedded.org
Tue Jan 8 10:08:34 UTC 2008
contrib/mtn2git/mtn2git.py: Stub the most important function. diff_manifest will tell us what to do
Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: 2f179e4c16eebdd66f8c67c99fe4bdb779216471
ViewMTN: http://monotone.openembedded.org/revision/info/2f179e4c16eebdd66f8c67c99fe4bdb779216471
Files:
1
contrib/mtn2git/mtn2git.py
Diffs:
#
# mt diff -rd0e82d27834ac45f302a2295996d66046bd047b6 -r2f179e4c16eebdd66f8c67c99fe4bdb779216471
#
#
#
# patch "contrib/mtn2git/mtn2git.py"
# from [61d60d3d255cde2b77a98b6eb83875852ab91c04]
# to [34d060f51b9f31f7ca5e7a5e186407b8914360f3]
#
============================================================
--- contrib/mtn2git/mtn2git.py 61d60d3d255cde2b77a98b6eb83875852ab91c04
+++ contrib/mtn2git/mtn2git.py 34d060f51b9f31f7ca5e7a5e186407b8914360f3
@@ -157,8 +157,15 @@ 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):
"""Import a revision into git using git-fast-import.
@@ -209,8 +216,13 @@ 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]
cmd += ["mark :%s" % get_mark(revision["revision"])]
More information about the Openembedded-commits
mailing list