243: def store_changeset(path, md_file, move=false)
244: md_path = File.join(path, md_file)
245: md = MetaData.load_metadata(md_path)
246:
247:
248: md_dir = File.join(@root_dir, md['ID'])
249: Dir.mkdir md_dir
250:
251:
252: if move
253: FileUtils.move md_path, md_dir
254: else
255: FileUtils.cp md_path, md_dir
256: end
257:
258: md['Contents'].each do |info|
259: name, digest, purpose = info['Name'], info['Digest'], info['Purpose']
260: to_copy = File.join(path, name)
261: if move
262: FileUtils.mv to_copy, md_dir
263: else
264: FileUtils.cp to_copy, md_dir
265: end
266: end
267:
268:
269: @cached_rev_tree = nil
270:
271: return md
272: end