comparison contrib/phab-refresh-stack.sh @ 46043:024f90fc01b5

phab-refresh: do not pick draft changeset from the bare "default" branch My initial test overlooked a common case: draft changeset on the default branch. So right now, heptapod is doing a final refresh of the patch with the landed version. This is not a bit problem except for the extra noise. However we would be better without the noise. Differential Revision: https://phab.mercurial-scm.org/D9522
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 05 Dec 2020 23:27:57 +0100
parents 372409eb5cd1
children 9be5db6148fb
comparison
equal deleted inserted replaced
46042:1bf2b44c4007 46043:024f90fc01b5
1 #!/bin/bash 1 #!/bin/bash
2 set -eu 2 set -eu
3 3
4 revision_in_stack=`hg log --rev '.#stack and ::.' -T '\nONE-REV\n' | grep 'ONE-REV' | wc -l` 4 revision_in_stack=`hg log \
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` 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 if [[ $revision_in_stack -eq 0 ]]; then 13 if [[ $revision_in_stack -eq 0 ]]; then
8 echo "stack is empty" >&2 14 echo "stack is empty" >&2
9 exit 0 15 exit 0
10 fi 16 fi
29 --config phabricator.url=https://phab.mercurial-scm.org/ \ 35 --config phabricator.url=https://phab.mercurial-scm.org/ \
30 --config phabricator.callsign=HG \ 36 --config phabricator.callsign=HG \
31 --config auth.phabricator.schemes=https \ 37 --config auth.phabricator.schemes=https \
32 --config auth.phabricator.prefix=phab.mercurial-scm.org \ 38 --config auth.phabricator.prefix=phab.mercurial-scm.org \
33 --config auth.phabricator.phabtoken=$PHABRICATOR_TOKEN \ 39 --config auth.phabricator.phabtoken=$PHABRICATOR_TOKEN \
34 phabsend --rev '.#stack and ::.' 40 phabsend --rev '.#stack and ::. and topic()' \