TRACKING_BRANCH = "origin/master"
STAMP_WHEN_POSTING = True
OPEN_BROWSER = False
PUBLISH = False
ALIASES = {
'post-head': '! \
review_id=`git commit-review-id`; \
if [[ -z "${review_id}" ]]; then \
repository=`grep REPOSITORY .reviewboardrc | grep -o \'".*"\' | tr -d \\"`; \
commit_subject=`git commit-subject`; \
commit_description=`git commit-description`; \
current_branch=`git current-branch`; \
issue_id=`git commit-issue-id`; \
diff_url=`rbt post \
--summary "[${repository}] ${commit_subject}" \
--description "${commit_description:-$commit_subject} " \
--branch "${current_branch}" \
--bugs-closed "${issue_id:-NONE}" \
--testing-done "unit tests" \
--parent HEAD~ \
| grep diff`; \
else \
diff_url=`rbt post \
--update \
--review-request-id "$review_id" \
--parent HEAD~ \
| grep diff`; \
fi; \
xdg-open "${diff_url}"; \
',
'publish-head': '! \
review_id=`git commit-review-id`; \
rbt publish "${review_id}"; \
',
'publish-all': '! \
rbt status \
| grep Draft \
| cut -f2 -d/ \
| cut -f1 -d- \
| tr -d " " \
| sort \
| xargs -I {} rbt publish {}; \
',
'discard-head': '! \
review_id=`git commit-review-id`; \
rbt close --close-type discarded "${review_id}"; \
',
'submit-head': '! \
review_id=`git commit-review-id`; \
rbt close --close-type submitted "${review_id}"; \
',
'submit-all': '! \
rbt status \
| grep "r/" \
| cut -f2 -d/ \
| cut -f1 -d- \
| tr -d " " \
| sort \
| xargs -I {} rbt close --close-type submitted {}; \
',
'apply': '! \
rbt patch --commit-no-edit $1; \
git commit --amend \
-m \'` \
git log -1 --pretty=%s \
| sed "s/^\[.*\] //" \
`\' \
-m \'` \
git log -1 --pretty=%b \
| sed "/Testing Done/,/^\s*$/{d}" \
| sed "s/^Bugs closed/Issue/"\
`\' \
'
}