Show More
1 | NO CONTENT: file renamed from contrib/phabricator.py to hgext/phabricator.py |
|
NO CONTENT: file renamed from contrib/phabricator.py to hgext/phabricator.py |
@@ -1,29 +1,29 b'' | |||||
1 | #require test-repo |
|
1 | #require test-repo | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/helpers-testrepo.sh" |
|
3 | $ . "$TESTDIR/helpers-testrepo.sh" | |
4 |
|
4 | |||
5 | $ cat <<'EOF' > scanhelptopics.py |
|
5 | $ cat <<'EOF' > scanhelptopics.py | |
6 | > from __future__ import absolute_import, print_function |
|
6 | > from __future__ import absolute_import, print_function | |
7 | > import re |
|
7 | > import re | |
8 | > import sys |
|
8 | > import sys | |
9 | > if sys.platform == "win32": |
|
9 | > if sys.platform == "win32": | |
10 | > import os, msvcrt |
|
10 | > import os, msvcrt | |
11 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
11 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
12 | > topics = set() |
|
12 | > topics = set() | |
13 | > topicre = re.compile(br':hg:`help ([a-z0-9\-.]+)`') |
|
13 | > topicre = re.compile(br':hg:`help ([a-z0-9\-.]+)`') | |
14 | > for fname in sys.argv: |
|
14 | > for fname in sys.argv: | |
15 | > with open(fname, 'rb') as f: |
|
15 | > with open(fname, 'rb') as f: | |
16 | > topics.update(m.group(1) for m in topicre.finditer(f.read())) |
|
16 | > topics.update(m.group(1) for m in topicre.finditer(f.read())) | |
17 | > for s in sorted(topics): |
|
17 | > for s in sorted(topics): | |
18 | > print(s) |
|
18 | > print(s) | |
19 | > EOF |
|
19 | > EOF | |
20 |
|
20 | |||
21 | $ cd "$TESTDIR"/.. |
|
21 | $ cd "$TESTDIR"/.. | |
22 |
|
22 | |||
23 | Check if ":hg:`help TOPIC`" is valid: |
|
23 | Check if ":hg:`help TOPIC`" is valid: | |
24 | (use "xargs -n1 -t" to see which help commands are executed) |
|
24 | (use "xargs -n1 -t" to see which help commands are executed) | |
25 |
|
25 | |||
26 | $ testrepohg files 'glob:{hgdemandimport,hgext,mercurial}/**/*.py' \ |
|
26 | $ testrepohg files 'glob:{hgdemandimport,hgext,mercurial}/**/*.py' \ | |
27 | > | sed 's|\\|/|g' \ |
|
27 | > | sed 's|\\|/|g' \ | |
28 | > | xargs $PYTHON "$TESTTMP/scanhelptopics.py" \ |
|
28 | > | xargs $PYTHON "$TESTTMP/scanhelptopics.py" \ | |
29 | > | xargs -n1 hg help > /dev/null |
|
29 | > | xargs -n1 hg help --config extensions.phabricator= > /dev/null |
@@ -1,67 +1,67 b'' | |||||
1 | #require vcr |
|
1 | #require vcr | |
2 | $ cat >> $HGRCPATH <<EOF |
|
2 | $ cat >> $HGRCPATH <<EOF | |
3 | > [extensions] |
|
3 | > [extensions] | |
4 | > phabricator = $TESTDIR/../contrib/phabricator.py |
|
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 | $ cd .. |
|
67 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now