Skip to content

Instantly share code, notes, and snippets.

@daicham daicham/redmine.py
Last active Dec 10, 2015

Embed
What would you like to do?
Request Redmine SCM fetching by http on Python (Tested for Mercurial)
# usase:
# python redmine.py projectname1, projectname2
import sys, httplib
REDMINE_HOST = 'localhost:3000'
URL = '/redmine/sys/fetch_changesets?id=%s&key=%s'
REDMINE_API_KEY = 'token'
redmine_project_ids = sys.argv
redmine_project_ids.pop(0) # shift operation to reduce this command
for project_id in redmine_project_ids:
http = httplib.HTTPConnection(REDMINE_HOST)
url = URL % (project_id, REDMINE_API_KEY)
http.request('GET', url)
response = http.getresponse()
#print response.status, response.reason, url # debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.