importing.rb revision 7b1e12286a360e4bfd9b54f97c2ad1d1a561c77d
#
# States:
# * pending - Job is enqueued.
# * fetching - Fetching new commits from the remote repository.
# * processing - Inserting fetched commits into the local database-
# * done - Everthing is fine, nothing to do-
# * failed - Something has gone wrong.
#
SOURCE_TYPES = %w( git svn )
STATES = %w( pending fetching processing done failed )
included do
end
end
# do not allow new actions in specific states
end
# enqueues a clone job
end
# enqueues a pull job
end
# enqueues a remote job
update_state! 'pending'
end
=end
update_state! 'fetching'
update_state! 'processing'
update_state! 'done'
end
end
# creates a new repository and imports the contents from the remote repository
raise Repository::ImportError, "#{source} is not a #{type} repository" unless GitRepository.send "is_#{type}_repository?", source
params[:source_type] = type
params[:source_address] = source
r = Repository.new(params)
r
end
end
end