Mercurial > hg
annotate tests/test-pull.t @ 35855:69d7fcd91696
testrunner: fix updating of .testtimes file
We attempt to write the 5 most recent test timings to a file called
.testtimes, but we read previous results from a file called
.testtimes- (including the hyphen), so we ended up no more than a
single time per test.
Differential Revision: https://phab.mercurial-scm.org/D1961
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 31 Jan 2018 22:20:59 -0800 |
parents | eb586ed5d8ce |
children | 1ee1a42bfdae |
rev | line source |
---|---|
22046
7a9cbb315d84
tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents:
17486
diff
changeset
|
1 #require serve |
15446
c5c9ca3719f9
tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents:
13956
diff
changeset
|
2 |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
13826
diff
changeset
|
3 $ hg init test |
12279 | 4 $ cd test |
5 | |
6 $ echo foo>foo | |
7 $ hg addremove | |
8 adding foo | |
9 $ hg commit -m 1 | |
10 | |
11 $ hg verify | |
12 checking changesets | |
13 checking manifests | |
14 crosschecking files in changesets and manifests | |
15 checking files | |
16 1 files, 1 changesets, 1 total revisions | |
336 | 17 |
12279 | 18 $ hg serve -p $HGPORT -d --pid-file=hg.pid |
19 $ cat hg.pid >> $DAEMON_PIDS | |
20 $ cd .. | |
21 | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
22 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy |
12279 | 23 requesting all changes |
24 adding changesets | |
25 adding manifests | |
26 adding file changes | |
27 added 1 changesets with 1 changes to 1 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
33644
diff
changeset
|
28 new changesets 340e38bdcde4 |
12279 | 29 updating to branch default |
30 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
31 | |
32 $ cd copy | |
33 $ hg verify | |
34 checking changesets | |
35 checking manifests | |
36 crosschecking files in changesets and manifests | |
37 checking files | |
38 1 files, 1 changesets, 1 total revisions | |
336 | 39 |
12279 | 40 $ hg co |
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 $ cat foo | |
43 foo | |
44 | |
45 $ hg manifest --debug | |
46 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo | |
47 | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
48 $ hg pull |
15552
62c9183a0bbb
clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents:
13956
diff
changeset
|
49 pulling from http://foo@localhost:$HGPORT/ |
12279 | 50 searching for changes |
51 no changes found | |
52 | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
53 $ hg rollback --dry-run --verbose |
13446
1e497df514e2
rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents:
12643
diff
changeset
|
54 repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/) |
12279 | 55 |
26604
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
56 Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
57 not are encoded like a node: |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
58 |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
59 $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy' |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
60 pulling from http://foo@localhost:$HGPORT/ |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
61 abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy'! |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
62 [255] |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
63 $ hg pull -r 'xxxxxxxxxxxxxxxxxx y' |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
64 pulling from http://foo@localhost:$HGPORT/ |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
65 abort: unknown revision '7878787878787878787878787878787878782079'! |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
66 [255] |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
67 |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12377
diff
changeset
|
68 Issue622: hg init && hg pull -u URL doesn't checkout default branch |
4891
2d545b98a7bc
issue 622: pull/unbundle -u updates to default branch if repo was empty
Bryan O'Sullivan <bos@serpentine.com>
parents:
3736
diff
changeset
|
69 |
12279 | 70 $ cd .. |
71 $ hg init empty | |
72 $ cd empty | |
73 $ hg pull -u ../test | |
74 pulling from ../test | |
75 requesting all changes | |
76 adding changesets | |
77 adding manifests | |
78 adding file changes | |
79 added 1 changesets with 1 changes to 1 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
33644
diff
changeset
|
80 new changesets 340e38bdcde4 |
12279 | 81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9996
2770d03ae49f
handle file URIs correctly, according to RFC 2396 (issue1153)
Sune Foldager <cryo@cyanite.org>
parents:
5384
diff
changeset
|
82 |
12279 | 83 Test 'file:' uri handling: |
84 | |
17486 | 85 $ hg pull -q file://../test-does-not-exist |
13823
ad179644750f
hg: look up schemes using url.url
Brodie Rao <brodie@bitheap.org>
parents:
13817
diff
changeset
|
86 abort: file:// URLs can only refer to localhost |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
87 [255] |
12279 | 88 |
13826
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
89 $ hg pull -q file://../test |
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
90 abort: file:// URLs can only refer to localhost |
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
91 [255] |
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
92 |
31771
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
93 MSYS changes 'file:' into 'file;' |
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
94 |
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
95 #if no-msys |
24205
abcb1ee3b20a
check-code: allow disabling msys path check
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
96 $ hg pull -q file:../test # no-msys |
31771
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
97 #endif |
12279 | 98 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
99 It's tricky to make file:// URLs working on every platform with |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
100 regular shell commands. |
12279 | 101 |
22947
c63a09b6b337
tests: use $PYTHON instead of hardcoding python
Augie Fackler <raf@durin42.com>
parents:
22046
diff
changeset
|
102 $ URL=`$PYTHON -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` |
12279 | 103 $ hg pull -q "$URL" |
13817
7f18bab2c0b0
url: abort on file:// URLs with non-localhost hosts
Brodie Rao <brodie@bitheap.org>
parents:
13446
diff
changeset
|
104 abort: file:// URLs can only refer to localhost |
7f18bab2c0b0
url: abort on file:// URLs with non-localhost hosts
Brodie Rao <brodie@bitheap.org>
parents:
13446
diff
changeset
|
105 [255] |
12279 | 106 |
22947
c63a09b6b337
tests: use $PYTHON instead of hardcoding python
Augie Fackler <raf@durin42.com>
parents:
22046
diff
changeset
|
107 $ URL=`$PYTHON -c "import os; print 'file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` |
13817
7f18bab2c0b0
url: abort on file:// URLs with non-localhost hosts
Brodie Rao <brodie@bitheap.org>
parents:
13446
diff
changeset
|
108 $ hg pull -q "$URL" |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
109 |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
110 SEC: check for unsafe ssh url |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
111 |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
112 $ cat >> $HGRCPATH << EOF |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
113 > [ui] |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
114 > ssh = sh -c "read l; read l; read l" |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
115 > EOF |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
116 |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
117 $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
118 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
119 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
120 [255] |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
121 $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
122 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
123 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
124 [255] |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
125 $ hg pull 'ssh://fakehost|touch${IFS}owned/path' |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
126 pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
127 abort: no suitable response from remote hg! |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
128 [255] |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
129 $ hg pull 'ssh://fakehost%7Ctouch%20owned/path' |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
130 pulling from ssh://fakehost%7Ctouch%20owned/path |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
131 abort: no suitable response from remote hg! |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
132 [255] |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
133 |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
134 $ [ ! -f owned ] || echo 'you got owned' |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
135 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
136 $ cd .. |