##// END OF EJS Templates
tests: use hghave eol-in-paths to test for support for ':' in filenames and " "...
Mads Kiilerich -
r16974:01ed5bb5 default
parent child Browse files
Show More
@@ -1,137 +1,140
1 1 $ hg init a
2 2 $ cd a
3 3 $ echo a > a
4 4 $ hg add -n
5 5 adding a
6 6 $ hg st
7 7 ? a
8 8 $ hg add
9 9 adding a
10 10 $ hg st
11 11 A a
12 12 $ hg forget a
13 13 $ hg add
14 14 adding a
15 15 $ hg st
16 16 A a
17 17
18 18 $ echo b > b
19 19 $ hg add -n b
20 20 $ hg st
21 21 A a
22 22 ? b
23 23 $ hg add b
24 24 $ hg st
25 25 A a
26 26 A b
27 27
28 28 should fail
29 29
30 30 $ hg add b
31 31 b already tracked!
32 32 $ hg st
33 33 A a
34 34 A b
35 35
36 36 #if no-windows
37 37 $ echo foo > con.xml
38 38 $ hg --config ui.portablefilenames=jump add con.xml
39 39 abort: ui.portablefilenames value is invalid ('jump')
40 40 [255]
41 41 $ hg --config ui.portablefilenames=abort add con.xml
42 42 abort: filename contains 'con', which is reserved on Windows: 'con.xml'
43 43 [255]
44 44 $ hg st
45 45 A a
46 46 A b
47 47 ? con.xml
48 48 $ hg add con.xml
49 49 warning: filename contains 'con', which is reserved on Windows: 'con.xml'
50 50 $ hg st
51 51 A a
52 52 A b
53 53 A con.xml
54 $ hg forget con.xml
55 $ rm con.xml
56 #endif
57
58 #if eol-in-paths
54 59 $ echo bla > 'hello:world'
55 60 $ hg --config ui.portablefilenames=abort add
56 61 adding hello:world
57 62 abort: filename contains ':', which is reserved on Windows: 'hello:world'
58 63 [255]
59 64 $ hg st
60 65 A a
61 66 A b
62 A con.xml
63 67 ? hello:world
64 68 $ hg --config ui.portablefilenames=ignore add
65 69 adding hello:world
66 70 $ hg st
67 71 A a
68 72 A b
69 A con.xml
70 73 A hello:world
71 74 #endif
72 75
73 76 $ hg ci -m 0 --traceback
74 77
75 78 should fail
76 79
77 80 $ hg add a
78 81 a already tracked!
79 82
80 83 $ echo aa > a
81 84 $ hg ci -m 1
82 85 $ hg up 0
83 86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 87 $ echo aaa > a
85 88 $ hg ci -m 2
86 89 created new head
87 90
88 91 $ hg merge
89 92 merging a
90 93 warning: conflicts during merge.
91 94 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
92 95 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
93 96 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
94 97 [1]
95 98 $ hg st
96 99 M a
97 100 ? a.orig
98 101
99 102 should fail
100 103
101 104 $ hg add a
102 105 a already tracked!
103 106 $ hg st
104 107 M a
105 108 ? a.orig
106 109 $ hg resolve -m a
107 110 $ hg ci -m merge
108 111
109 112 Issue683: peculiarity with hg revert of an removed then added file
110 113
111 114 $ hg forget a
112 115 $ hg add a
113 116 $ hg st
114 117 ? a.orig
115 118 $ hg rm a
116 119 $ hg st
117 120 R a
118 121 ? a.orig
119 122 $ echo a > a
120 123 $ hg add a
121 124 $ hg st
122 125 M a
123 126 ? a.orig
124 127
125 128 $ hg add c && echo "unexpected addition of missing file"
126 129 c: * (glob)
127 130 [1]
128 131 $ echo c > c
129 132 $ hg add d c && echo "unexpected addition of missing file"
130 133 d: * (glob)
131 134 [1]
132 135 $ hg st
133 136 M a
134 137 A c
135 138 ? a.orig
136 139
137 140 $ cd ..
@@ -1,199 +1,199
1 1 This test tries to exercise the ssh functionality with a dummy script
2 2
3 3 $ checknewrepo()
4 4 > {
5 5 > name=$1
6 6 > if [ -d "$name"/.hg/store ]; then
7 7 > echo store created
8 8 > fi
9 9 > if [ -f "$name"/.hg/00changelog.i ]; then
10 10 > echo 00changelog.i created
11 11 > fi
12 12 > cat "$name"/.hg/requires
13 13 > }
14 14
15 15 creating 'local'
16 16
17 17 $ hg init local
18 18 $ checknewrepo local
19 19 store created
20 20 00changelog.i created
21 21 revlogv1
22 22 fncache
23 23 store
24 24 dotencode
25 25 $ echo this > local/foo
26 26 $ hg ci --cwd local -A -m "init"
27 27 adding foo
28 28
29 29 creating repo with format.usestore=false
30 30
31 31 $ hg --config format.usestore=false init old
32 32 $ checknewrepo old
33 33 revlogv1
34 34
35 35 creating repo with format.usefncache=false
36 36
37 37 $ hg --config format.usefncache=false init old2
38 38 $ checknewrepo old2
39 39 store created
40 40 00changelog.i created
41 41 revlogv1
42 42 store
43 43
44 44 creating repo with format.dotencode=false
45 45
46 46 $ hg --config format.dotencode=false init old3
47 47 $ checknewrepo old3
48 48 store created
49 49 00changelog.i created
50 50 revlogv1
51 51 fncache
52 52 store
53 53
54 54 test failure
55 55
56 56 $ hg init local
57 57 abort: repository local already exists!
58 58 [255]
59 59
60 60 init+push to remote2
61 61
62 62 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
63 63 $ hg incoming -R remote2 local
64 64 comparing with local
65 65 changeset: 0:08b9e9f63b32
66 66 tag: tip
67 67 user: test
68 68 date: Thu Jan 01 00:00:00 1970 +0000
69 69 summary: init
70 70
71 71
72 72 $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
73 73 pushing to ssh://user@dummy/remote2
74 74 searching for changes
75 75 remote: adding changesets
76 76 remote: adding manifests
77 77 remote: adding file changes
78 78 remote: added 1 changesets with 1 changes to 1 files
79 79
80 80 clone to remote1
81 81
82 82 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
83 83 searching for changes
84 84 remote: adding changesets
85 85 remote: adding manifests
86 86 remote: adding file changes
87 87 remote: added 1 changesets with 1 changes to 1 files
88 88
89 89 init to existing repo
90 90
91 91 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
92 92 abort: repository remote1 already exists!
93 93 abort: could not create remote repo!
94 94 [255]
95 95
96 96 clone to existing repo
97 97
98 98 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
99 99 abort: repository remote1 already exists!
100 100 abort: could not create remote repo!
101 101 [255]
102 102
103 103 output of dummyssh
104 104
105 105 $ cat dummylog
106 106 Got arguments 1:user@dummy 2:hg init remote2
107 107 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
108 108 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
109 109 Got arguments 1:user@dummy 2:hg init remote1
110 110 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
111 111 Got arguments 1:user@dummy 2:hg init remote1
112 112 Got arguments 1:user@dummy 2:hg init remote1
113 113
114 114 comparing repositories
115 115
116 116 $ hg tip -q -R local
117 117 0:08b9e9f63b32
118 118 $ hg tip -q -R remote1
119 119 0:08b9e9f63b32
120 120 $ hg tip -q -R remote2
121 121 0:08b9e9f63b32
122 122
123 123 check names for repositories (clashes with URL schemes, special chars)
124 124
125 125 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
126 126 > printf "hg init \"$i\"... "
127 127 > hg init "$i"
128 128 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
129 129 > done
130 130 hg init "bundle"... ok
131 131 hg init "file"... ok
132 132 hg init "hg"... ok
133 133 hg init "http"... ok
134 134 hg init "https"... ok
135 135 hg init "old-http"... ok
136 136 hg init "ssh"... ok
137 137 hg init "static-http"... ok
138 138 hg init "with space"... ok
139 #if no-windows
139 #if eol-in-paths
140 140 /* " " is not a valid name for a directory on Windows */
141 141 $ hg init " "
142 142 $ test -d " "
143 143 $ test -d " /.hg"
144 144 #endif
145 145
146 146 creating 'local/sub/repo'
147 147
148 148 $ hg init local/sub/repo
149 149 $ checknewrepo local/sub/repo
150 150 store created
151 151 00changelog.i created
152 152 revlogv1
153 153 fncache
154 154 store
155 155 dotencode
156 156
157 157 prepare test of init of url configured from paths
158 158
159 159 $ echo '[paths]' >> $HGRCPATH
160 160 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
161 161 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
162 162
163 163 init should (for consistency with clone) expand the url
164 164
165 165 $ hg init somewhere
166 166 $ checknewrepo "url from paths"
167 167 store created
168 168 00changelog.i created
169 169 revlogv1
170 170 fncache
171 171 store
172 172 dotencode
173 173
174 174 verify that clone also expand urls
175 175
176 176 $ hg clone somewhere elsewhere
177 177 updating to branch default
178 178 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 179 $ checknewrepo "another paths url"
180 180 store created
181 181 00changelog.i created
182 182 revlogv1
183 183 fncache
184 184 store
185 185 dotencode
186 186
187 187 clone bookmarks
188 188
189 189 $ hg -R local bookmark test
190 190 $ hg -R local bookmarks
191 191 * test 0:08b9e9f63b32
192 192 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
193 193 searching for changes
194 194 remote: adding changesets
195 195 remote: adding manifests
196 196 remote: adding file changes
197 197 remote: added 1 changesets with 1 changes to 1 files
198 198 $ hg -R remote-bookmarks bookmarks
199 199 test 0:08b9e9f63b32
General Comments 0
You need to be logged in to leave comments. Login now