]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
build-integration-branch: define variables for pr_number and friends
authorKefu Chai <kchai@redhat.com>
Sun, 11 Apr 2021 03:52:16 +0000 (11:52 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 11 Apr 2021 04:00:07 +0000 (12:00 +0800)
so they can be reused later.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/script/build-integration-branch

index e0cf9f4544f6d36c11ed71b41d989bf2045afc34..6bedd7d16223e8daaaddb6319e90ed6c2e4f7ca2 100755 (executable)
@@ -89,13 +89,11 @@ r = call(['git', 'branch', '-D', branch])
 r = call(['git', 'checkout', '-b', branch])
 assert not r
 for pr in prs:
-    print('--- pr %d --- pulling %s branch %s' % (
-        pr['number'],
-        pr['head']['repo']['clone_url'],
-        pr['head']['ref']))
-    r = call(['git', 'pull', '--no-edit',
-              pr['head']['repo']['clone_url'],
-              pr['head']['ref']])
+    pr_number = pr['number']
+    pr_url = pr['head']['repo']['clone_url']
+    pr_ref = pr['head']['ref']
+    print(f'--- pr {pr_number} --- pulling {pr_url} branch {pr_ref}')
+    r = call(['git', 'pull', '--no-edit', pr_url, pr_ref])
     assert not r
 print('--- done. these PRs were included:')
 print('\n'.join(prtext).encode('ascii', errors='ignore').decode())