Patchwork D7874: phabricator: post revisions in ascending topological order (issue6241)

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2020, 9:39 p.m.
Message ID <differential-rev-PHID-DREV-kxhrshd75gmazjg5yrqb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44340/
State Superseded
Headers show

Comments

phabricator - Jan. 14, 2020, 9:39 p.m.
mharbison72 created this revision.
Herald added subscribers: mercurial-devel, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The parent in phabricator ends up being the last revision posted, so sorting the
  user input into ascending order should be enough to preserve the proper
  relationships.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: Kwan, mercurial-devel
phabricator - Jan. 14, 2020, 9:43 p.m.
mharbison72 added a comment.


  I don't see any guardrails that prevent mixing unrelated local stuff into the revset and erroneously assigning the last revision processed as a parent, but that's less trivial and can probably wait until someone stumbles on it.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7874/new/

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

To: mharbison72, #hg-reviewers
Cc: Kwan, mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1065,6 +1065,7 @@ 
     opts = pycompat.byteskwargs(opts)
     revs = list(revs) + opts.get(b'rev', [])
     revs = scmutil.revrange(repo, revs)
+    revs.sort()  # ascending order to preserve topological parent/child in phab
 
     if not revs:
         raise error.Abort(_(b'phabsend requires at least one changeset'))