D6082: phabricator: add a `--branch` flag to `hg phabsend`

Kwan (Ian Moody) phabricator at mercurial-scm.org
Tue Mar 19 08:22:27 EDT 2019

Kwan added a comment.

  In https://phab.mercurial-scm.org/D6082#89656, @pulkit wrote:
  > In https://phab.mercurial-scm.org/D6082#88981, @Kwan wrote:
  > > In https://phab.mercurial-scm.org/D6082#88852, @mharbison72 wrote:
  > >
  > > > In https://phab.mercurial-scm.org/D6082#88851, @pulkit wrote:
  > > >
  > > > > @mharbison72 thanks for tips on adding test. Will add tests in next iteration.
  > > > >
  > > > > I found that Differentials do have a branch field, maybe we can use that? https://secure.phabricator.com/source/phabricator/browse/master/src/applications/differential/customfield/DifferentialBranchField.php
  > > >
  > > >
  > > > Seems worth a shot.  I don’t know anything about it, but presumably this would be rendered specially in the web UI, like the test plan, etc.  That sounds better than as a follow up comment.  It also seems natural enough that maybe it can be done unconditionally, instead of needing the argument.
  > >
  > >
  > > Yeah, it shows in the Diff Detail pane, like here <https://phabricator-dev.allizom.org/D1092?id=1765>.  Unfortunately I think it can be only set when using the creatediff endpoint, which is what I had to change my fork to do (though I could be wrong, the conduit docs are too sparse to be sure).
  > Last night I tried different endpoints and looks like creatediff is the only one which can be used to set the branch. I have asked on their discourse https://discourse.phabricator-community.org/t/conduit-api-to-set-branch-of-a-differential/2521.
  > Talking about creatediff, can it be used instead of createrawdiff? It it's possible can you paste the changes you did your fork, maybe we need the exact same changes.
  Oh man, yeah sure, let me just commit the WIP and push.  It's a lot of extra code to wrangle the data into creatediff form.  Bear in mind this wasn't exactly ready to have other eyes on it, and it's possible not all the changes are actually necessary (particularly the urlencoding ones, _so_ much fun having multiple different ways <https://secure.phabricator.com/T12447#216803> to submit the same data to Conduit :/). I also have not downstreamed all my py3 compat changes yet.
  Frankly I thought this amount of extra code probably wouldn't fly for submitting to the official version (and my coding style is probably questionable).
  On the plus side this did let me successfully submit <https://phabricator.services.mozilla.com/D23114?id=76558> binary file changes to mozilla-central.
  In all it's "glory" <https://bitbucket.org/KwanEsq/phabsend-moz/commits/branch/beta>
  I've also started to write up what I've learnt about the API for the wiki there, to document things the official docs are silent on, like what the "changes" parameter to the creatediff endpoint is actually supposed to be.  Hopefully that'd help anyone else who wanted to use such APIs in future (or who even wanted to make changes to mine).

  rHG Mercurial


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

More information about the Mercurial-devel mailing list