##// END OF EJS Templates
tests: demonstrate broken pull of "ffffffffffff" revision...
Martin von Zweigbergk -
r42247:50b69c08 default
parent child Browse files
Show More
@@ -1,146 +1,153 b''
1 #require serve
1 #require serve
2
2
3 #testcases sshv1 sshv2
3 #testcases sshv1 sshv2
4
4
5 #if sshv2
5 #if sshv2
6 $ cat >> $HGRCPATH << EOF
6 $ cat >> $HGRCPATH << EOF
7 > [experimental]
7 > [experimental]
8 > sshpeer.advertise-v2 = true
8 > sshpeer.advertise-v2 = true
9 > sshserver.support-v2 = true
9 > sshserver.support-v2 = true
10 > EOF
10 > EOF
11 #endif
11 #endif
12
12
13 $ hg init test
13 $ hg init test
14 $ cd test
14 $ cd test
15
15
16 $ echo foo>foo
16 $ echo foo>foo
17 $ hg addremove
17 $ hg addremove
18 adding foo
18 adding foo
19 $ hg commit -m 1
19 $ hg commit -m 1
20
20
21 $ hg verify
21 $ hg verify
22 checking changesets
22 checking changesets
23 checking manifests
23 checking manifests
24 crosschecking files in changesets and manifests
24 crosschecking files in changesets and manifests
25 checking files
25 checking files
26 checked 1 changesets with 1 changes to 1 files
26 checked 1 changesets with 1 changes to 1 files
27
27
28 $ hg serve -p $HGPORT -d --pid-file=hg.pid
28 $ hg serve -p $HGPORT -d --pid-file=hg.pid
29 $ cat hg.pid >> $DAEMON_PIDS
29 $ cat hg.pid >> $DAEMON_PIDS
30 $ cd ..
30 $ cd ..
31
31
32 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy
32 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy
33 requesting all changes
33 requesting all changes
34 adding changesets
34 adding changesets
35 adding manifests
35 adding manifests
36 adding file changes
36 adding file changes
37 added 1 changesets with 1 changes to 1 files
37 added 1 changesets with 1 changes to 1 files
38 new changesets 340e38bdcde4
38 new changesets 340e38bdcde4
39 updating to branch default
39 updating to branch default
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41
41
42 $ cd copy
42 $ cd copy
43 $ hg verify
43 $ hg verify
44 checking changesets
44 checking changesets
45 checking manifests
45 checking manifests
46 crosschecking files in changesets and manifests
46 crosschecking files in changesets and manifests
47 checking files
47 checking files
48 checked 1 changesets with 1 changes to 1 files
48 checked 1 changesets with 1 changes to 1 files
49
49
50 $ hg co
50 $ hg co
51 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ cat foo
52 $ cat foo
53 foo
53 foo
54
54
55 $ hg manifest --debug
55 $ hg manifest --debug
56 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
56 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
57
57
58 $ hg pull
58 $ hg pull
59 pulling from http://foo@localhost:$HGPORT/
59 pulling from http://foo@localhost:$HGPORT/
60 searching for changes
60 searching for changes
61 no changes found
61 no changes found
62
62
63 $ hg rollback --dry-run --verbose
63 $ hg rollback --dry-run --verbose
64 repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
64 repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
65
65
66 Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers
66 Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers
67 not are encoded like a node:
67 not are encoded like a node:
68
68
69 $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy'
69 $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy'
70 pulling from http://foo@localhost:$HGPORT/
70 pulling from http://foo@localhost:$HGPORT/
71 abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy'!
71 abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy'!
72 [255]
72 [255]
73 $ hg pull -r 'xxxxxxxxxxxxxxxxxx y'
73 $ hg pull -r 'xxxxxxxxxxxxxxxxxx y'
74 pulling from http://foo@localhost:$HGPORT/
74 pulling from http://foo@localhost:$HGPORT/
75 abort: unknown revision 'xxxxxxxxxxxxxxxxxx y'!
75 abort: unknown revision 'xxxxxxxxxxxxxxxxxx y'!
76 [255]
76 [255]
77
77
78 Test pull of working copy revision
79 BROKEN: should give a better error message
80 $ hg pull -r 'ffffffffffff'
81 pulling from http://foo@localhost:$HGPORT/
82 abort: b2a_hex() argument 1 must be string or buffer, not None!
83 [255]
84
78 Issue622: hg init && hg pull -u URL doesn't checkout default branch
85 Issue622: hg init && hg pull -u URL doesn't checkout default branch
79
86
80 $ cd ..
87 $ cd ..
81 $ hg init empty
88 $ hg init empty
82 $ cd empty
89 $ cd empty
83 $ hg pull -u ../test
90 $ hg pull -u ../test
84 pulling from ../test
91 pulling from ../test
85 requesting all changes
92 requesting all changes
86 adding changesets
93 adding changesets
87 adding manifests
94 adding manifests
88 adding file changes
95 adding file changes
89 added 1 changesets with 1 changes to 1 files
96 added 1 changesets with 1 changes to 1 files
90 new changesets 340e38bdcde4
97 new changesets 340e38bdcde4
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92
99
93 Test 'file:' uri handling:
100 Test 'file:' uri handling:
94
101
95 $ hg pull -q file://../test-does-not-exist
102 $ hg pull -q file://../test-does-not-exist
96 abort: file:// URLs can only refer to localhost
103 abort: file:// URLs can only refer to localhost
97 [255]
104 [255]
98
105
99 $ hg pull -q file://../test
106 $ hg pull -q file://../test
100 abort: file:// URLs can only refer to localhost
107 abort: file:// URLs can only refer to localhost
101 [255]
108 [255]
102
109
103 MSYS changes 'file:' into 'file;'
110 MSYS changes 'file:' into 'file;'
104
111
105 #if no-msys
112 #if no-msys
106 $ hg pull -q file:../test # no-msys
113 $ hg pull -q file:../test # no-msys
107 #endif
114 #endif
108
115
109 It's tricky to make file:// URLs working on every platform with
116 It's tricky to make file:// URLs working on every platform with
110 regular shell commands.
117 regular shell commands.
111
118
112 $ URL=`"$PYTHON" -c "from __future__ import print_function; import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
119 $ URL=`"$PYTHON" -c "from __future__ import print_function; import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
113 $ hg pull -q "$URL"
120 $ hg pull -q "$URL"
114 abort: file:// URLs can only refer to localhost
121 abort: file:// URLs can only refer to localhost
115 [255]
122 [255]
116
123
117 $ URL=`"$PYTHON" -c "from __future__ import print_function; import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
124 $ URL=`"$PYTHON" -c "from __future__ import print_function; import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
118 $ hg pull -q "$URL"
125 $ hg pull -q "$URL"
119
126
120 SEC: check for unsafe ssh url
127 SEC: check for unsafe ssh url
121
128
122 $ cat >> $HGRCPATH << EOF
129 $ cat >> $HGRCPATH << EOF
123 > [ui]
130 > [ui]
124 > ssh = sh -c "read l; read l; read l"
131 > ssh = sh -c "read l; read l; read l"
125 > EOF
132 > EOF
126
133
127 $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path'
134 $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path'
128 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
135 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
129 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
136 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
130 [255]
137 [255]
131 $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
138 $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
132 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
139 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
133 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
140 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
134 [255]
141 [255]
135 $ hg pull 'ssh://fakehost|touch${IFS}owned/path'
142 $ hg pull 'ssh://fakehost|touch${IFS}owned/path'
136 pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
143 pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
137 abort: no suitable response from remote hg!
144 abort: no suitable response from remote hg!
138 [255]
145 [255]
139 $ hg pull 'ssh://fakehost%7Ctouch%20owned/path'
146 $ hg pull 'ssh://fakehost%7Ctouch%20owned/path'
140 pulling from ssh://fakehost%7Ctouch%20owned/path
147 pulling from ssh://fakehost%7Ctouch%20owned/path
141 abort: no suitable response from remote hg!
148 abort: no suitable response from remote hg!
142 [255]
149 [255]
143
150
144 $ [ ! -f owned ] || echo 'you got owned'
151 $ [ ! -f owned ] || echo 'you got owned'
145
152
146 $ cd ..
153 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now