kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nehanarkh...@apache.org
Subject git commit: KAFKA-1142 Patch review tool should take diff with origin from last divergent point; reviewed by Neha Narkhede
Date Thu, 12 Dec 2013 00:20:45 GMT
Updated Branches:
  refs/heads/trunk 6bc290f66 -> 169a79e68


KAFKA-1142 Patch review tool should take diff with origin from last divergent point; reviewed
by Neha Narkhede


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

Branch: refs/heads/trunk
Commit: 169a79e687799bffd5cf1f4bb86855bf3725cb88
Parents: 6bc290f
Author: Neha Narkhede <neha.narkhede@gmail.com>
Authored: Wed Dec 11 16:20:38 2013 -0800
Committer: Neha Narkhede <neha.narkhede@gmail.com>
Committed: Wed Dec 11 16:20:38 2013 -0800

----------------------------------------------------------------------
 kafka-patch-review.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/169a79e6/kafka-patch-review.py
----------------------------------------------------------------------
diff --git a/kafka-patch-review.py b/kafka-patch-review.py
index 7fa6cb5..dc6664d 100644
--- a/kafka-patch-review.py
+++ b/kafka-patch-review.py
@@ -37,6 +37,21 @@ def main():
     st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H:%M:%S')
     patch_file=tempfile.gettempdir() + "/" + opt.jira + '_' + st + '.patch'
 
+  # first check if rebase is needed
+  git_branch_hash="git rev-parse " + opt.branch
+  p_now=os.popen(git_branch_hash)
+  branch_now=p_now.read()
+  p_now.close()
+
+  git_common_ancestor="git merge-base " + opt.branch + " HEAD"
+  p_then=os.popen(git_common_ancestor)
+  branch_then=p_then.read()
+  p_then.close()
+
+  if branch_now != branch_then:
+    print 'ERROR: Your current working branch is from an older version of ' + opt.branch
+ '. Please rebase first by using git pull --rebase'
+    sys.exit(1)
+
   git_configure_reviewboard="git config reviewboard.url https://reviews.apache.org"
   print "Configuring reviewboard url to https://reviews.apache.org"
   p=os.popen(git_configure_reviewboard)


Mime
View raw message