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