| 39 | return process.returncode |
| 40 | |
| 41 | def checkout_pull(clone_url, commit, out): |
| 42 | # Init |
| 43 | build_dir=os.environ["BUILD_DIR"] |
| 44 | run("umount ${CHROOT_COPY}/proc", fail_hard=False) |
| 45 | run("rsync --delete -apv ${CHROOT_MASTER}/ ${CHROOT_COPY}") |
| 46 | run("rm -rf ${CHROOT_COPY}${SCRIPTS_DIR}") |
| 47 | run("cp -a ${SCRIPTS_DIR} ${CHROOT_COPY}${SCRIPTS_DIR}") |
| 48 | # Merge onto upstream/master |
| 49 | run("rm -rf ${BUILD_DIR}") |
| 50 | run("mkdir -p ${BUILD_DIR}") |
| 51 | run("git clone ${CLONE_URL} ${BUILD_DIR}") |
| 52 | run("git remote add pull "+clone_url, cwd=build_dir, stdout=out, stderr=out) |
| 53 | run("git fetch pull", cwd=build_dir, stdout=out, stderr=out) |
| 54 | if run("git merge "+ commit, fail_hard=False, cwd=build_dir, stdout=out, stderr=out) != 0: |
| 55 | return False |
| 56 | run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${BUILD_DIR}", stdout=out, stderr=out) |
| 57 | run("mount --bind /proc ${CHROOT_COPY}/proc") |
| 58 | return True |
| 59 | |
| 60 | def commentOn(commentUrl, success, inMerge, needTests, linkUrl): |
| 61 | common_message = """ |