diff --git a/contrib/phab-refresh-stack.sh b/contrib/phab-refresh-stack.sh --- a/contrib/phab-refresh-stack.sh +++ b/contrib/phab-refresh-stack.sh @@ -1,8 +1,14 @@ #!/bin/bash set -eu -revision_in_stack=`hg log --rev '.#stack and ::.' -T '\nONE-REV\n' | grep 'ONE-REV' | wc -l` -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` +revision_in_stack=`hg log \ + --rev '.#stack and ::. and topic()' \ + -T '\nONE-REV\n' \ + | grep 'ONE-REV' | wc -l` +revision_on_phab=`hg log \ + --rev '.#stack and ::. and topic() and desc("re:\nDifferential Revision: [^\n]+D\d+$")'\ + -T '\nONE-REV\n' \ + | grep 'ONE-REV' | wc -l` if [[ $revision_in_stack -eq 0 ]]; then echo "stack is empty" >&2