Skip to content

Commit

Permalink
Merge Pull Request #7932 from william76/Trilinos/PRDriverMergeFix-202…
Browse files Browse the repository at this point in the history
…00828

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Framework: PullRequestLinuxDriverMerge.py py2-3 compatibility fix
PR Author: william76
  • Loading branch information
trilinos-autotester authored Sep 1, 2020
2 parents 156e9ef + 39f9be1 commit 1ce57b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/std/PullRequestLinuxDriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ then
fi

echo -e "PRDriver> "
echo -e "PRDriver> Driver and Merge scripts unchaged, proceeding to TEST phase"
echo -e "PRDriver> Driver and Merge scripts unchanged, proceeding to TEST phase"
echo -e "PRDriver> "

# Prepare the command for the TEST operation
Expand Down
9 changes: 9 additions & 0 deletions cmake/std/PullRequestLinuxDriverMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,14 @@ def merge_branch(source_url, source_branch, target_branch, sourceSHA):
sourceSHA = sourceSHA.strip()

remote_list = subprocess.check_output(['git', 'remote', '-v'])

if isinstance(remote_list, bytes):
remote_list = remote_list.decode('utf-8')

if 'source_remote' in remote_list:
print('git remote exists, removing it', file=sys.stdout)
subprocess.check_call(['git', 'remote', 'rm', 'source_remote'])

subprocess.check_call(['git', 'remote', 'add', 'source_remote', source_url])

fetch_succeeded = False
Expand All @@ -104,6 +109,7 @@ def merge_branch(source_url, source_branch, target_branch, sourceSHA):
break
except subprocess.CalledProcessError:
pass

if not fetch_succeeded:
raise SystemExit(12)

Expand All @@ -114,6 +120,9 @@ def merge_branch(source_url, source_branch, target_branch, sourceSHA):

actual_source_SHA = subprocess.check_output(['git', 'rev-parse', 'source_remote/' + source_branch])

if isinstance(actual_source_SHA, bytes):
actual_source_SHA = actual_source_SHA.decode('utf-8')

actual_source_SHA = actual_source_SHA.strip()

if actual_source_SHA != sourceSHA:
Expand Down

0 comments on commit 1ce57b1

Please sign in to comment.