Last active
December 10, 2015 23:08
-
-
Save daicham/4507205 to your computer and use it in GitHub Desktop.
Request Redmine SCM fetching by http on Python (Tested for Mercurial)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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