lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject [2/2] lucene-solr:branch_7x: Handle the case of checking out a remote branch that has never been checked out locally before
Date Wed, 20 Jun 2018 02:22:00 GMT
Handle the case of checking out a remote branch that has never been checked out locally before


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9efe619a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9efe619a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9efe619a

Branch: refs/heads/branch_7x
Commit: 9efe619afa636d18362f38ba651bf8bc7244c6a9
Parents: e673775
Author: Steve Rowe <sarowe@apache.org>
Authored: Tue Jun 19 22:21:26 2018 -0400
Committer: Steve Rowe <sarowe@apache.org>
Committed: Tue Jun 19 22:21:49 2018 -0400

----------------------------------------------------------------------
 dev-tools/scripts/reproduceJenkinsFailures.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9efe619a/dev-tools/scripts/reproduceJenkinsFailures.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/reproduceJenkinsFailures.py b/dev-tools/scripts/reproduceJenkinsFailures.py
index 70f0c43..edfe2d4 100644
--- a/dev-tools/scripts/reproduceJenkinsFailures.py
+++ b/dev-tools/scripts/reproduceJenkinsFailures.py
@@ -158,7 +158,11 @@ def prepareWorkspace(useGit, gitRef):
     checkoutCmd = 'git checkout %s' % gitRef
     code = run(checkoutCmd)
     if 0 != code:
-      raise RuntimeError('ERROR: "%s" failed.  See above.' % checkoutCmd)
+      checkoutBranchCmd = 'git checkout -t -b %s origin/%s' % (gitRef, gitRef) # Checkout
remote branch as new local branch
+      print('"%s" failed. Trying "%s".' % (checkoutCmd, checkoutBranchCmd))
+      code = run(checkoutBranchCmd)
+      if 0 != code:
+        raise RuntimeError('ERROR: "%s" failed.  See above.' % checkoutBranchCmd)
     gitCheckoutSucceeded = True
     run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
   


Mime
View raw message