Show More
@@ -1,34 +1,40 b'' | |||
|
1 | 1 | #!/bin/bash |
|
2 | 2 | set -eu |
|
3 | 3 | |
|
4 | revision_in_stack=`hg log --rev '.#stack and ::.' -T '\nONE-REV\n' | grep 'ONE-REV' | wc -l` | |
|
5 | revision_on_phab=`hg log --rev '.#stack and ::. and desc("re:\nDifferential Revision: [^\n]+D\d+$")' -T '\nONE-REV\n' | grep 'ONE-REV' | wc -l` | |
|
4 | revision_in_stack=`hg log \ | |
|
5 | --rev '.#stack and ::. and topic()' \ | |
|
6 | -T '\nONE-REV\n' \ | |
|
7 | | grep 'ONE-REV' | wc -l` | |
|
8 | revision_on_phab=`hg log \ | |
|
9 | --rev '.#stack and ::. and topic() and desc("re:\nDifferential Revision: [^\n]+D\d+$")'\ | |
|
10 | -T '\nONE-REV\n' \ | |
|
11 | | grep 'ONE-REV' | wc -l` | |
|
6 | 12 | |
|
7 | 13 | if [[ $revision_in_stack -eq 0 ]]; then |
|
8 | 14 | echo "stack is empty" >&2 |
|
9 | 15 | exit 0 |
|
10 | 16 | fi |
|
11 | 17 | |
|
12 | 18 | if [[ $revision_on_phab -eq 0 ]]; then |
|
13 | 19 | echo "no tracked diff in this stack" >&2 |
|
14 | 20 | exit 0 |
|
15 | 21 | fi |
|
16 | 22 | |
|
17 | 23 | if [[ $revision_on_phab -lt $revision_in_stack ]]; then |
|
18 | 24 | echo "not all stack changesets (${revision_in_stack}) have matching Phabricator Diff (${revision_on_phab})" >&2 |
|
19 | 25 | exit 2 |
|
20 | 26 | fi |
|
21 | 27 | |
|
22 | 28 | if [[ "$PHABRICATOR_TOKEN" == "" ]]; then |
|
23 | 29 | echo 'missing $PHABRICATOR_TOKEN variable' >&2 |
|
24 | 30 | exit 2 |
|
25 | 31 | fi |
|
26 | 32 | |
|
27 | 33 | hg \ |
|
28 | 34 | --config extensions.phabricator= \ |
|
29 | 35 | --config phabricator.url=https://phab.mercurial-scm.org/ \ |
|
30 | 36 | --config phabricator.callsign=HG \ |
|
31 | 37 | --config auth.phabricator.schemes=https \ |
|
32 | 38 | --config auth.phabricator.prefix=phab.mercurial-scm.org \ |
|
33 | 39 | --config auth.phabricator.phabtoken=$PHABRICATOR_TOKEN \ |
|
34 | phabsend --rev '.#stack and ::.' | |
|
40 | phabsend --rev '.#stack and ::. and topic()' \ |
General Comments 0
You need to be logged in to leave comments.
Login now