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