|
a/scripts/migrations/028-remove-svn-trees.py |
|
b/scripts/migrations/028-remove-svn-trees.py |
|
... |
|
... |
13 |
M.repo.Tree.query.remove(dict(_id=tree._id))
|
13 |
M.repo.Tree.query.remove(dict(_id=tree._id))
|
14 |
for tree_rec in tree.tree_ids:
|
14 |
for tree_rec in tree.tree_ids:
|
15 |
tid = repo._tree_oid(commit_id, path + '/' + tree_rec.name)
|
15 |
tid = repo._tree_oid(commit_id, path + '/' + tree_rec.name)
|
16 |
child_tree = M.repo.Tree.query.get(_id=tid)
|
16 |
child_tree = M.repo.Tree.query.get(_id=tid)
|
17 |
if child_tree:
|
17 |
if child_tree:
|
18 |
print ' Found {0}'.format(path + '/' + tree_rec.name)
|
18 |
print ' Found {0}'.format((path + '/' + tree_rec.name).encode('utf8'))
|
19 |
kill_tree(repo, commit_id, path + '/' + tree_rec.name, child_tree)
|
19 |
kill_tree(repo, commit_id, path + '/' + tree_rec.name, child_tree)
|
20 |
else:
|
20 |
else:
|
21 |
print ' Missing {0}'.format(path + '/' + tree_rec.name)
|
21 |
print ' Missing {0}'.format((path + '/' + tree_rec.name).encode('utf8'))
|
22 |
|
22 |
|
23 |
def main():
|
23 |
def main():
|
24 |
for chunk in utils.chunked_find(SM.Repository):
|
24 |
for chunk in utils.chunked_find(SM.Repository):
|
25 |
for r in chunk:
|
25 |
for r in chunk:
|
26 |
print 'Processing {0}'.format(r)
|
26 |
print 'Processing {0}'.format(r)
|