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