# File lib/fastcst/command/sync.rb, line 45
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:             # use the two sets to find out what is new in the remote repository
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:             # download all of the changesets to the work directory first
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:                     # get the meta-data contents
70:                     data_file, journal_file = Distribution.download_md_contents(md_url, md)
71:                     
72:                     # then store it in the repository with a move
73:                     @repo.store_changeset ".", "meta-data.yaml", move=true
74:                 end
75:             end
76:             
77:             # downloaded each one, so now we display that repository's revision path
78:             puts "Remote Revision Path: #{remote_index['Revision Path']}"
79:         end