storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [1/3] storm git commit: Print out the merge command for a given pull request.
Date Mon, 09 Feb 2015 16:11:12 GMT
Repository: storm
Updated Branches:
  refs/heads/master be64b2536 -> 2b39a39cb


Print out the merge command for a given pull request.


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/ab8a43de
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/ab8a43de
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/ab8a43de

Branch: refs/heads/master
Commit: ab8a43de2aab88118213624413defec7281ae968
Parents: 94b9608
Author: Robert (Bobby) Evans <evans@yahoo-inc.com>
Authored: Wed Jan 14 11:07:17 2015 -0600
Committer: Robert (Bobby) Evans <evans@yahoo-inc.com>
Committed: Wed Jan 14 11:07:17 2015 -0600

----------------------------------------------------------------------
 dev-tools/github/__init__.py | 11 +++++++++++
 dev-tools/storm-merge.py     | 31 +++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/ab8a43de/dev-tools/github/__init__.py
----------------------------------------------------------------------
diff --git a/dev-tools/github/__init__.py b/dev-tools/github/__init__.py
index c3e734e..2c533d0 100755
--- a/dev-tools/github/__init__.py
+++ b/dev-tools/github/__init__.py
@@ -107,3 +107,14 @@ class GitHub:
 			
 	def openPulls(self, user, repo):
 		return self.pulls(user, repo, "open")
+
+	def pull(self, user, repo, number):
+		url = "https://api.github.com/repos/"+user+"/"+repo+"/pulls/"+number
+		req = urllib2.Request(url,None,self.headers)
+		result = urllib2.urlopen(req)
+		contents = result.read()
+		if result.getcode() != 200:
+			raise Exception(result.getcode() + " != 200 "+ contents)
+		got = json.loads(contents)
+		return GitPullRequest(got, self)
+

http://git-wip-us.apache.org/repos/asf/storm/blob/ab8a43de/dev-tools/storm-merge.py
----------------------------------------------------------------------
diff --git a/dev-tools/storm-merge.py b/dev-tools/storm-merge.py
new file mode 100755
index 0000000..06ae25f
--- /dev/null
+++ b/dev-tools/storm-merge.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+#	 Licensed under the Apache License, Version 2.0 (the "License");
+#	 you may not use this file except in compliance with the License.
+#	 You may obtain a copy of the License at
+#
+#			 http://www.apache.org/licenses/LICENSE-2.0
+#
+#	 Unless required by applicable law or agreed to in writing, software
+#	 distributed under the License is distributed on an "AS IS" BASIS,
+#	 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#	 See the License for the specific language governing permissions and
+#	 limitations under the License.
+
+from github import GitHub
+from optparse import OptionParser
+
+def main():
+	parser = OptionParser(usage="usage: %prog [options] [pull number]")
+	parser.add_option("-g", "--github-user", dest="gituser",
+			type="string", help="github user, if not supplied no auth is used", metavar="USER")
+	
+	(options, args) = parser.parse_args()
+	github = GitHub(options)
+
+        for pullNumber in args:
+		pull = github.pull("apache", "storm", pullNumber)
+		print "git pull "+pull.fromRepo()+" "+pull.fromBranch()
+
+if __name__ == "__main__":
+	main()
+


Mime
View raw message