comparison tests/test-phabricator.t @ 44550:bbb170f9396d

phabricator: add a `phabimport` command I've had `alias.phabimport = $hg phabread --stack $1 | $hg import --bypass -` for a while now, and I suspect others do too. That's limited though, in that it can't use the information on Phabricator to restore it in the original location, so I'm making it a first class command. This doesn't do anything ambitious like that- this is mostly a simplification of `hg import` to get the equivalent of the alias mentioned above. The `--bypass` option is hardcoded to be enabled and the message about amending rejects dropped (rejects aren't created with `--bypass`), because editing patches on Phabricator seems like an unusual workflow. This will need other options, like `--obsolete` and `--secret`. I think these would be more useful as config settings, as I imagine the workflows are pretty fixed depending on roles. Reviewers who don't queue patches probably never want `--obsolete`, but may need `--secret`. Reviewers who do will want the former, but not the latter. I left `--stack` as an option, but that should probably be a config knob too (or at least default to on)- if the point of this is to avoid rejects, it doesn't make sense to skip dependencies in most cases. Evolve is going to need a fix to its wrapping of `cmdutil.tryimportone()`, as it currently assumes `opts` has an `obsolete` key. It's worked around for now. Differential Revision: https://phab.mercurial-scm.org/D8136
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 16 Feb 2020 16:13:36 -0500
parents 09f3e003fc2a
children 9bae1d1a0f4c
comparison
equal deleted inserted replaced
44549:47f8c741df0f 44550:bbb170f9396d
321 read config from: */.hgrc (glob) 321 read config from: */.hgrc (glob)
322 $TESTTMP/repo/.hg/hgrc:*: phabricator.url=local (glob) 322 $TESTTMP/repo/.hg/hgrc:*: phabricator.url=local (glob)
323 $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=local (glob) 323 $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=local (glob)
324 $ mv .hg/hgrc.bak .hg/hgrc 324 $ mv .hg/hgrc.bak .hg/hgrc
325 325
326 Phabimport works with a stack
327
326 $ cd .. 328 $ cd ..
329 $ hg clone repo repo2 -qr 1
330 $ cp repo/.hg/hgrc repo2/.hg/
331 $ cd repo2
332 $ hg phabimport --stack 'D7918' --test-vcr "$VCR/phabimport-stack.json"
333 applying patch from D7917
334 applying patch from D7918
335 $ hg log -G -Tcompact
336 o 3[tip] aaef04066140 1970-01-01 00:00 +0000 test
337 | create draft change for phabricator testing
338 |
339 o 2 8de3712202d1 1970-01-01 00:00 +0000 test
340 | create public change for phabricator testing
341 |
342 @ 1 a692622e6937 1970-01-01 00:00 +0000 test
343 | create beta for phabricator test
344 |
345 o 0 c44b38f24a45 1970-01-01 00:00 +0000 test
346 create alpha for phabricator test \x80 (esc)
347
348
349 $ cd ..