Patchwork D9522: phab-refresh: do not pick draft changeset from the bare "default" branch

login
register
mail settings
Submitter phabricator
Date Dec. 5, 2020, 11:14 a.m.
Message ID <differential-rev-PHID-DREV-sikgphk3m3dpjdoh4ifb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47805/
State Superseded
Headers show

Comments

phabricator - Dec. 5, 2020, 11:14 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9522

AFFECTED FILES
  contrib/phab-refresh-stack.sh

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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