45: def run
46:
47: remote_index = nil
48: open(@url + "/index.yaml") { |f| remote_index = YAML.load(f) }
49:
50: remote_cs = Set.new(remote_index['Changesets'])
51: local_cs = Set.new(@repo.list_changesets)
52:
53:
54: new_cs = remote_cs - local_cs
55:
56: if new_cs.empty?
57: UI.event :exit, "No new changesets at #@url. Done."
58: return
59: end
60:
61:
62: root_url = @url + "/root"
63: Dir.chdir @repo.work_dir do
64: new_cs.each do |id|
65: md_url = root_url + "/#{id}"
66: md = Distribution.download_meta_data(md_url, "meta-data.yaml")
67: display_meta_data(md)
68:
69:
70: data_file, journal_file = Distribution.download_md_contents(md_url, md)
71:
72:
73: @repo.store_changeset ".", "meta-data.yaml", move=true
74: end
75: end
76:
77:
78: puts "Remote Revision Path: #{remote_index['Revision Path']}"
79: end