##// END OF EJS Templates
phabricator: add tests of templatekeyword...
Augie Fackler -
r39689:10c53b2e default
parent child Browse files
Show More
@@ -1,67 +1,79 b''
1 #require vcr
1 #require vcr
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [extensions]
3 > [extensions]
4 > phabricator =
4 > phabricator =
5 > EOF
5 > EOF
6 $ hg init repo
6 $ hg init repo
7 $ cd repo
7 $ cd repo
8 $ cat >> .hg/hgrc <<EOF
8 $ cat >> .hg/hgrc <<EOF
9 > [phabricator]
9 > [phabricator]
10 > url = https://phab.mercurial-scm.org/
10 > url = https://phab.mercurial-scm.org/
11 > callsign = HG
11 > callsign = HG
12 >
12 >
13 > [auth]
13 > [auth]
14 > hgphab.schemes = https
14 > hgphab.schemes = https
15 > hgphab.prefix = phab.mercurial-scm.org
15 > hgphab.prefix = phab.mercurial-scm.org
16 > # When working on the extension and making phabricator interaction
16 > # When working on the extension and making phabricator interaction
17 > # changes, edit this to be a real phabricator token. When done, edit
17 > # changes, edit this to be a real phabricator token. When done, edit
18 > # it back, and make sure to also edit your VCR transcripts to match
18 > # it back, and make sure to also edit your VCR transcripts to match
19 > # whatever value you put here.
19 > # whatever value you put here.
20 > hgphab.phabtoken = cli-hahayouwish
20 > hgphab.phabtoken = cli-hahayouwish
21 > EOF
21 > EOF
22 $ VCR="$TESTDIR/phabricator"
22 $ VCR="$TESTDIR/phabricator"
23
23
24 Error is handled reasonably. We override the phabtoken here so that
24 Error is handled reasonably. We override the phabtoken here so that
25 when you're developing changes to phabricator.py you can edit the
25 when you're developing changes to phabricator.py you can edit the
26 above config and have a real token in the test but not have to edit
26 above config and have a real token in the test but not have to edit
27 this test.
27 this test.
28 $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \
28 $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \
29 > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head
29 > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head
30 abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long.
30 abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long.
31
31
32 Basic phabread:
32 Basic phabread:
33 $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head
33 $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head
34 # HG changeset patch
34 # HG changeset patch
35 exchangev2: start to implement pull with wire protocol v2
35 exchangev2: start to implement pull with wire protocol v2
36
36
37 Wire protocol version 2 will take a substantially different
37 Wire protocol version 2 will take a substantially different
38 approach to exchange than version 1 (at least as far as pulling
38 approach to exchange than version 1 (at least as far as pulling
39 is concerned).
39 is concerned).
40
40
41 This commit establishes a new exchangev2 module for holding
41 This commit establishes a new exchangev2 module for holding
42 code related to exchange using wire protocol v2. I could have
42 code related to exchange using wire protocol v2. I could have
43 added things to the existing exchange module. But it is already
43 added things to the existing exchange module. But it is already
44
44
45 phabupdate with an accept:
45 phabupdate with an accept:
46 $ hg phabupdate --accept D4564 \
46 $ hg phabupdate --accept D4564 \
47 > -m 'I think I like where this is headed. Will read rest of series later.'\
47 > -m 'I think I like where this is headed. Will read rest of series later.'\
48 > --test-vcr "$VCR/accept-4564.json"
48 > --test-vcr "$VCR/accept-4564.json"
49
49
50 Create a differential diff:
50 Create a differential diff:
51 $ echo alpha > alpha
51 $ echo alpha > alpha
52 $ hg ci --addremove -m 'create alpha for phabricator test'
52 $ hg ci --addremove -m 'create alpha for phabricator test'
53 adding alpha
53 adding alpha
54 $ hg phabsend -r . --test-vcr "$VCR/phabsend-create-alpha.json"
54 $ hg phabsend -r . --test-vcr "$VCR/phabsend-create-alpha.json"
55 D4596 - created - 5206a4fa1e6c: create alpha for phabricator test
55 D4596 - created - 5206a4fa1e6c: create alpha for phabricator test
56 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5206a4fa1e6c-dec9e777-phabsend.hg
56 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5206a4fa1e6c-dec9e777-phabsend.hg
57 $ echo more >> alpha
57 $ echo more >> alpha
58 $ HGEDITOR=true hg ci --amend
58 $ HGEDITOR=true hg ci --amend
59 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d8f232f7d799-c573510a-amend.hg
59 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d8f232f7d799-c573510a-amend.hg
60 $ echo beta > beta
60 $ echo beta > beta
61 $ hg ci --addremove -m 'create beta for phabricator test'
61 $ hg ci --addremove -m 'create beta for phabricator test'
62 adding beta
62 adding beta
63 $ hg phabsend -r ".^::" --test-vcr "$VCR/phabsend-update-alpha-create-beta.json"
63 $ hg phabsend -r ".^::" --test-vcr "$VCR/phabsend-update-alpha-create-beta.json"
64 D4596 - updated - f70265671c65: create alpha for phabricator test
64 D4596 - updated - f70265671c65: create alpha for phabricator test
65 D4597 - created - 1a5640df7bbf: create beta for phabricator test
65 D4597 - created - 1a5640df7bbf: create beta for phabricator test
66 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/1a5640df7bbf-6daf3e6e-phabsend.hg
66 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/1a5640df7bbf-6daf3e6e-phabsend.hg
67
68 Template keywords
69 $ hg log -T'{rev} {phabreview|json}\n'
70 1 {"id": "D4597", "url": "https://phab.mercurial-scm.org/D4597"}
71 0 {"id": "D4596", "url": "https://phab.mercurial-scm.org/D4596"}
72
73 BUG: this should work, but doesn't.
74 $ hg log -T'{rev} {phabreview.url}\n'
75 hg: parse error: {* 'D4597'*} is not a dictionary (glob)
76 (keyword 'phabreview' does not support member operation)
77 [255]
78
67 $ cd ..
79 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now