Show More
@@ -1,1030 +1,1030 b'' | |||||
1 | #if windows |
|
1 | #if windows | |
2 | $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" |
|
2 | $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" | |
3 | #else |
|
3 | #else | |
4 | $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" |
|
4 | $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" | |
5 | #endif |
|
5 | #endif | |
6 | $ export PYTHONPATH |
|
6 | $ export PYTHONPATH | |
7 |
|
7 | |||
8 | typical client does not want echo-back messages, so test without it: |
|
8 | typical client does not want echo-back messages, so test without it: | |
9 |
|
9 | |||
10 | $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new |
|
10 | $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new | |
11 | $ mv $HGRCPATH.new $HGRCPATH |
|
11 | $ mv $HGRCPATH.new $HGRCPATH | |
12 |
|
12 | |||
13 | $ hg init repo |
|
13 | $ hg init repo | |
14 | $ cd repo |
|
14 | $ cd repo | |
15 |
|
15 | |||
16 | >>> from __future__ import absolute_import, print_function |
|
16 | >>> from __future__ import absolute_import, print_function | |
17 | >>> import os |
|
17 | >>> import os | |
18 | >>> import sys |
|
18 | >>> import sys | |
19 | >>> from hgclient import check, readchannel, runcommand |
|
19 | >>> from hgclient import check, readchannel, runcommand | |
20 | >>> @check |
|
20 | >>> @check | |
21 | ... def hellomessage(server): |
|
21 | ... def hellomessage(server): | |
22 | ... ch, data = readchannel(server) |
|
22 | ... ch, data = readchannel(server) | |
23 | ... print('%c, %r' % (ch, data)) |
|
23 | ... print('%c, %r' % (ch, data)) | |
24 | ... # run an arbitrary command to make sure the next thing the server |
|
24 | ... # run an arbitrary command to make sure the next thing the server | |
25 | ... # sends isn't part of the hello message |
|
25 | ... # sends isn't part of the hello message | |
26 | ... runcommand(server, ['id']) |
|
26 | ... runcommand(server, ['id']) | |
27 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
|
27 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) | |
28 | *** runcommand id |
|
28 | *** runcommand id | |
29 | 000000000000 tip |
|
29 | 000000000000 tip | |
30 |
|
30 | |||
31 | >>> from hgclient import check |
|
31 | >>> from hgclient import check | |
32 | >>> @check |
|
32 | >>> @check | |
33 | ... def unknowncommand(server): |
|
33 | ... def unknowncommand(server): | |
34 | ... server.stdin.write('unknowncommand\n') |
|
34 | ... server.stdin.write('unknowncommand\n') | |
35 | abort: unknown command unknowncommand |
|
35 | abort: unknown command unknowncommand | |
36 |
|
36 | |||
37 | >>> from hgclient import check, readchannel, runcommand |
|
37 | >>> from hgclient import check, readchannel, runcommand | |
38 | >>> @check |
|
38 | >>> @check | |
39 | ... def checkruncommand(server): |
|
39 | ... def checkruncommand(server): | |
40 | ... # hello block |
|
40 | ... # hello block | |
41 | ... readchannel(server) |
|
41 | ... readchannel(server) | |
42 | ... |
|
42 | ... | |
43 | ... # no args |
|
43 | ... # no args | |
44 | ... runcommand(server, []) |
|
44 | ... runcommand(server, []) | |
45 | ... |
|
45 | ... | |
46 | ... # global options |
|
46 | ... # global options | |
47 | ... runcommand(server, ['id', '--quiet']) |
|
47 | ... runcommand(server, ['id', '--quiet']) | |
48 | ... |
|
48 | ... | |
49 | ... # make sure global options don't stick through requests |
|
49 | ... # make sure global options don't stick through requests | |
50 | ... runcommand(server, ['id']) |
|
50 | ... runcommand(server, ['id']) | |
51 | ... |
|
51 | ... | |
52 | ... # --config |
|
52 | ... # --config | |
53 | ... runcommand(server, ['id', '--config', 'ui.quiet=True']) |
|
53 | ... runcommand(server, ['id', '--config', 'ui.quiet=True']) | |
54 | ... |
|
54 | ... | |
55 | ... # make sure --config doesn't stick |
|
55 | ... # make sure --config doesn't stick | |
56 | ... runcommand(server, ['id']) |
|
56 | ... runcommand(server, ['id']) | |
57 | ... |
|
57 | ... | |
58 | ... # negative return code should be masked |
|
58 | ... # negative return code should be masked | |
59 | ... runcommand(server, ['id', '-runknown']) |
|
59 | ... runcommand(server, ['id', '-runknown']) | |
60 | *** runcommand |
|
60 | *** runcommand | |
61 | Mercurial Distributed SCM |
|
61 | Mercurial Distributed SCM | |
62 |
|
62 | |||
63 | basic commands: |
|
63 | basic commands: | |
64 |
|
64 | |||
65 | add add the specified files on the next commit |
|
65 | add add the specified files on the next commit | |
66 | annotate show changeset information by line for each file |
|
66 | annotate show changeset information by line for each file | |
67 | clone make a copy of an existing repository |
|
67 | clone make a copy of an existing repository | |
68 | commit commit the specified files or all outstanding changes |
|
68 | commit commit the specified files or all outstanding changes | |
69 | diff diff repository (or selected files) |
|
69 | diff diff repository (or selected files) | |
70 | export dump the header and diffs for one or more changesets |
|
70 | export dump the header and diffs for one or more changesets | |
71 | forget forget the specified files on the next commit |
|
71 | forget forget the specified files on the next commit | |
72 | init create a new repository in the given directory |
|
72 | init create a new repository in the given directory | |
73 | log show revision history of entire repository or files |
|
73 | log show revision history of entire repository or files | |
74 | merge merge another revision into working directory |
|
74 | merge merge another revision into working directory | |
75 | pull pull changes from the specified source |
|
75 | pull pull changes from the specified source | |
76 | push push changes to the specified destination |
|
76 | push push changes to the specified destination | |
77 | remove remove the specified files on the next commit |
|
77 | remove remove the specified files on the next commit | |
78 | serve start stand-alone webserver |
|
78 | serve start stand-alone webserver | |
79 | status show changed files in the working directory |
|
79 | status show changed files in the working directory | |
80 | summary summarize working directory state |
|
80 | summary summarize working directory state | |
81 | update update working directory (or switch revisions) |
|
81 | update update working directory (or switch revisions) | |
82 |
|
82 | |||
83 | (use 'hg help' for the full list of commands or 'hg -v' for details) |
|
83 | (use 'hg help' for the full list of commands or 'hg -v' for details) | |
84 | *** runcommand id --quiet |
|
84 | *** runcommand id --quiet | |
85 | 000000000000 |
|
85 | 000000000000 | |
86 | *** runcommand id |
|
86 | *** runcommand id | |
87 | 000000000000 tip |
|
87 | 000000000000 tip | |
88 | *** runcommand id --config ui.quiet=True |
|
88 | *** runcommand id --config ui.quiet=True | |
89 | 000000000000 |
|
89 | 000000000000 | |
90 | *** runcommand id |
|
90 | *** runcommand id | |
91 | 000000000000 tip |
|
91 | 000000000000 tip | |
92 | *** runcommand id -runknown |
|
92 | *** runcommand id -runknown | |
93 | abort: unknown revision 'unknown'! |
|
93 | abort: unknown revision 'unknown'! | |
94 | [255] |
|
94 | [255] | |
95 |
|
95 | |||
96 | >>> from hgclient import check, readchannel |
|
96 | >>> from hgclient import check, readchannel | |
97 | >>> @check |
|
97 | >>> @check | |
98 | ... def inputeof(server): |
|
98 | ... def inputeof(server): | |
99 | ... readchannel(server) |
|
99 | ... readchannel(server) | |
100 | ... server.stdin.write('runcommand\n') |
|
100 | ... server.stdin.write('runcommand\n') | |
101 | ... # close stdin while server is waiting for input |
|
101 | ... # close stdin while server is waiting for input | |
102 | ... server.stdin.close() |
|
102 | ... server.stdin.close() | |
103 | ... |
|
103 | ... | |
104 | ... # server exits with 1 if the pipe closed while reading the command |
|
104 | ... # server exits with 1 if the pipe closed while reading the command | |
105 | ... print('server exit code =', server.wait()) |
|
105 | ... print('server exit code =', server.wait()) | |
106 | server exit code = 1 |
|
106 | server exit code = 1 | |
107 |
|
107 | |||
108 | >>> from hgclient import check, readchannel, runcommand, stringio |
|
108 | >>> from hgclient import check, readchannel, runcommand, stringio | |
109 | >>> @check |
|
109 | >>> @check | |
110 | ... def serverinput(server): |
|
110 | ... def serverinput(server): | |
111 | ... readchannel(server) |
|
111 | ... readchannel(server) | |
112 | ... |
|
112 | ... | |
113 | ... patch = """ |
|
113 | ... patch = """ | |
114 | ... # HG changeset patch |
|
114 | ... # HG changeset patch | |
115 | ... # User test |
|
115 | ... # User test | |
116 | ... # Date 0 0 |
|
116 | ... # Date 0 0 | |
117 | ... # Node ID c103a3dec114d882c98382d684d8af798d09d857 |
|
117 | ... # Node ID c103a3dec114d882c98382d684d8af798d09d857 | |
118 | ... # Parent 0000000000000000000000000000000000000000 |
|
118 | ... # Parent 0000000000000000000000000000000000000000 | |
119 | ... 1 |
|
119 | ... 1 | |
120 | ... |
|
120 | ... | |
121 | ... diff -r 000000000000 -r c103a3dec114 a |
|
121 | ... diff -r 000000000000 -r c103a3dec114 a | |
122 | ... --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
122 | ... --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
123 | ... +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
123 | ... +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
124 | ... @@ -0,0 +1,1 @@ |
|
124 | ... @@ -0,0 +1,1 @@ | |
125 | ... +1 |
|
125 | ... +1 | |
126 | ... """ |
|
126 | ... """ | |
127 | ... |
|
127 | ... | |
128 | ... runcommand(server, ['import', '-'], input=stringio(patch)) |
|
128 | ... runcommand(server, ['import', '-'], input=stringio(patch)) | |
129 | ... runcommand(server, ['log']) |
|
129 | ... runcommand(server, ['log']) | |
130 | *** runcommand import - |
|
130 | *** runcommand import - | |
131 | applying patch from stdin |
|
131 | applying patch from stdin | |
132 | *** runcommand log |
|
132 | *** runcommand log | |
133 | changeset: 0:eff892de26ec |
|
133 | changeset: 0:eff892de26ec | |
134 | tag: tip |
|
134 | tag: tip | |
135 | user: test |
|
135 | user: test | |
136 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
136 | date: Thu Jan 01 00:00:00 1970 +0000 | |
137 | summary: 1 |
|
137 | summary: 1 | |
138 |
|
138 | |||
139 |
|
139 | |||
140 | check strict parsing of early options: |
|
140 | check strict parsing of early options: | |
141 |
|
141 | |||
142 | >>> import os |
|
142 | >>> import os | |
143 | >>> from hgclient import check, readchannel, runcommand |
|
143 | >>> from hgclient import check, readchannel, runcommand | |
144 | >>> os.environ['HGPLAIN'] = '+strictflags' |
|
144 | >>> os.environ['HGPLAIN'] = '+strictflags' | |
145 | >>> @check |
|
145 | >>> @check | |
146 | ... def cwd(server): |
|
146 | ... def cwd(server): | |
147 | ... readchannel(server) |
|
147 | ... readchannel(server) | |
148 | ... runcommand(server, ['log', '-b', '--config=alias.log=!echo pwned', |
|
148 | ... runcommand(server, ['log', '-b', '--config=alias.log=!echo pwned', | |
149 | ... 'default']) |
|
149 | ... 'default']) | |
150 | *** runcommand log -b --config=alias.log=!echo pwned default |
|
150 | *** runcommand log -b --config=alias.log=!echo pwned default | |
151 | abort: unknown revision '--config=alias.log=!echo pwned'! |
|
151 | abort: unknown revision '--config=alias.log=!echo pwned'! | |
152 | [255] |
|
152 | [255] | |
153 |
|
153 | |||
154 | check that "histedit --commands=-" can read rules from the input channel: |
|
154 | check that "histedit --commands=-" can read rules from the input channel: | |
155 |
|
155 | |||
156 | >>> import cStringIO |
|
156 | >>> import cStringIO | |
157 | >>> from hgclient import check, readchannel, runcommand |
|
157 | >>> from hgclient import check, readchannel, runcommand | |
158 | >>> @check |
|
158 | >>> @check | |
159 | ... def serverinput(server): |
|
159 | ... def serverinput(server): | |
160 | ... readchannel(server) |
|
160 | ... readchannel(server) | |
161 | ... rules = 'pick eff892de26ec\n' |
|
161 | ... rules = 'pick eff892de26ec\n' | |
162 | ... runcommand(server, ['histedit', '0', '--commands=-', |
|
162 | ... runcommand(server, ['histedit', '0', '--commands=-', | |
163 | ... '--config', 'extensions.histedit='], |
|
163 | ... '--config', 'extensions.histedit='], | |
164 | ... input=cStringIO.StringIO(rules)) |
|
164 | ... input=cStringIO.StringIO(rules)) | |
165 | *** runcommand histedit 0 --commands=- --config extensions.histedit= |
|
165 | *** runcommand histedit 0 --commands=- --config extensions.histedit= | |
166 |
|
166 | |||
167 | check that --cwd doesn't persist between requests: |
|
167 | check that --cwd doesn't persist between requests: | |
168 |
|
168 | |||
169 | $ mkdir foo |
|
169 | $ mkdir foo | |
170 | $ touch foo/bar |
|
170 | $ touch foo/bar | |
171 | >>> from hgclient import check, readchannel, runcommand |
|
171 | >>> from hgclient import check, readchannel, runcommand | |
172 | >>> @check |
|
172 | >>> @check | |
173 | ... def cwd(server): |
|
173 | ... def cwd(server): | |
174 | ... readchannel(server) |
|
174 | ... readchannel(server) | |
175 | ... runcommand(server, ['--cwd', 'foo', 'st', 'bar']) |
|
175 | ... runcommand(server, ['--cwd', 'foo', 'st', 'bar']) | |
176 | ... runcommand(server, ['st', 'foo/bar']) |
|
176 | ... runcommand(server, ['st', 'foo/bar']) | |
177 | *** runcommand --cwd foo st bar |
|
177 | *** runcommand --cwd foo st bar | |
178 | ? bar |
|
178 | ? bar | |
179 | *** runcommand st foo/bar |
|
179 | *** runcommand st foo/bar | |
180 | ? foo/bar |
|
180 | ? foo/bar | |
181 |
|
181 | |||
182 | $ rm foo/bar |
|
182 | $ rm foo/bar | |
183 |
|
183 | |||
184 |
|
184 | |||
185 | check that local configs for the cached repo aren't inherited when -R is used: |
|
185 | check that local configs for the cached repo aren't inherited when -R is used: | |
186 |
|
186 | |||
187 | $ cat <<EOF >> .hg/hgrc |
|
187 | $ cat <<EOF >> .hg/hgrc | |
188 | > [ui] |
|
188 | > [ui] | |
189 | > foo = bar |
|
189 | > foo = bar | |
190 | > EOF |
|
190 | > EOF | |
191 |
|
191 | |||
192 | #if no-extraextensions |
|
192 | #if no-extraextensions | |
193 |
|
193 | |||
194 | >>> from hgclient import check, readchannel, runcommand, sep |
|
194 | >>> from hgclient import check, readchannel, runcommand, sep | |
195 | >>> @check |
|
195 | >>> @check | |
196 | ... def localhgrc(server): |
|
196 | ... def localhgrc(server): | |
197 | ... readchannel(server) |
|
197 | ... readchannel(server) | |
198 | ... |
|
198 | ... | |
199 | ... # the cached repo local hgrc contains ui.foo=bar, so showconfig should |
|
199 | ... # the cached repo local hgrc contains ui.foo=bar, so showconfig should | |
200 | ... # show it |
|
200 | ... # show it | |
201 | ... runcommand(server, ['showconfig'], outfilter=sep) |
|
201 | ... runcommand(server, ['showconfig'], outfilter=sep) | |
202 | ... |
|
202 | ... | |
203 | ... # but not for this repo |
|
203 | ... # but not for this repo | |
204 | ... runcommand(server, ['init', 'foo']) |
|
204 | ... runcommand(server, ['init', 'foo']) | |
205 | ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) |
|
205 | ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) | |
206 | *** runcommand showconfig |
|
206 | *** runcommand showconfig | |
207 | bundle.mainreporoot=$TESTTMP/repo |
|
207 | bundle.mainreporoot=$TESTTMP/repo | |
208 | devel.all-warnings=true |
|
208 | devel.all-warnings=true | |
209 | devel.default-date=0 0 |
|
209 | devel.default-date=0 0 | |
210 | extensions.fsmonitor= (fsmonitor !) |
|
210 | extensions.fsmonitor= (fsmonitor !) | |
211 | largefiles.usercache=$TESTTMP/.cache/largefiles |
|
211 | largefiles.usercache=$TESTTMP/.cache/largefiles | |
212 | lfs.usercache=$TESTTMP/.cache/lfs |
|
212 | lfs.usercache=$TESTTMP/.cache/lfs | |
213 | ui.slash=True |
|
213 | ui.slash=True | |
214 | ui.interactive=False |
|
214 | ui.interactive=False | |
215 | ui.mergemarkers=detailed |
|
215 | ui.mergemarkers=detailed | |
216 | ui.foo=bar |
|
216 | ui.foo=bar | |
217 | ui.nontty=true |
|
217 | ui.nontty=true | |
218 | web.address=localhost |
|
218 | web.address=localhost | |
219 | web\.ipv6=(?:True|False) (re) |
|
219 | web\.ipv6=(?:True|False) (re) | |
220 | web.server-header=testing stub value |
|
220 | web.server-header=testing stub value | |
221 | *** runcommand init foo |
|
221 | *** runcommand init foo | |
222 | *** runcommand -R foo showconfig ui defaults |
|
222 | *** runcommand -R foo showconfig ui defaults | |
223 | ui.slash=True |
|
223 | ui.slash=True | |
224 | ui.interactive=False |
|
224 | ui.interactive=False | |
225 | ui.mergemarkers=detailed |
|
225 | ui.mergemarkers=detailed | |
226 | ui.nontty=true |
|
226 | ui.nontty=true | |
227 | #endif |
|
227 | #endif | |
228 |
|
228 | |||
229 | $ rm -R foo |
|
229 | $ rm -R foo | |
230 |
|
230 | |||
231 | #if windows |
|
231 | #if windows | |
232 | $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH" |
|
232 | $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH" | |
233 | #else |
|
233 | #else | |
234 | $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH" |
|
234 | $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH" | |
235 | #endif |
|
235 | #endif | |
236 |
|
236 | |||
237 | $ cat <<EOF > hook.py |
|
237 | $ cat <<EOF > hook.py | |
238 | > from __future__ import print_function |
|
238 | > from __future__ import print_function | |
239 | > import sys |
|
239 | > import sys | |
240 | > def hook(**args): |
|
240 | > def hook(**args): | |
241 | > print('hook talking') |
|
241 | > print('hook talking') | |
242 | > print('now try to read something: %r' % sys.stdin.read()) |
|
242 | > print('now try to read something: %r' % sys.stdin.read()) | |
243 | > EOF |
|
243 | > EOF | |
244 |
|
244 | |||
245 | >>> from hgclient import check, readchannel, runcommand, stringio |
|
245 | >>> from hgclient import check, readchannel, runcommand, stringio | |
246 | >>> @check |
|
246 | >>> @check | |
247 | ... def hookoutput(server): |
|
247 | ... def hookoutput(server): | |
248 | ... readchannel(server) |
|
248 | ... readchannel(server) | |
249 | ... runcommand(server, ['--config', |
|
249 | ... runcommand(server, ['--config', | |
250 | ... 'hooks.pre-identify=python:hook.hook', |
|
250 | ... 'hooks.pre-identify=python:hook.hook', | |
251 | ... 'id'], |
|
251 | ... 'id'], | |
252 | ... input=stringio('some input')) |
|
252 | ... input=stringio('some input')) | |
253 | *** runcommand --config hooks.pre-identify=python:hook.hook id |
|
253 | *** runcommand --config hooks.pre-identify=python:hook.hook id | |
254 | eff892de26ec tip |
|
254 | eff892de26ec tip | |
255 | hook talking |
|
255 | hook talking | |
256 | now try to read something: '' |
|
256 | now try to read something: '' | |
257 |
|
257 | |||
258 | Clean hook cached version |
|
258 | Clean hook cached version | |
259 | $ rm hook.py* |
|
259 | $ rm hook.py* | |
260 | $ rm -Rf __pycache__ |
|
260 | $ rm -Rf __pycache__ | |
261 |
|
261 | |||
262 | $ echo a >> a |
|
262 | $ echo a >> a | |
263 | >>> import os |
|
263 | >>> import os | |
264 | >>> from hgclient import check, readchannel, runcommand |
|
264 | >>> from hgclient import check, readchannel, runcommand | |
265 | >>> @check |
|
265 | >>> @check | |
266 | ... def outsidechanges(server): |
|
266 | ... def outsidechanges(server): | |
267 | ... readchannel(server) |
|
267 | ... readchannel(server) | |
268 | ... runcommand(server, ['status']) |
|
268 | ... runcommand(server, ['status']) | |
269 | ... os.system('hg ci -Am2') |
|
269 | ... os.system('hg ci -Am2') | |
270 | ... runcommand(server, ['tip']) |
|
270 | ... runcommand(server, ['tip']) | |
271 | ... runcommand(server, ['status']) |
|
271 | ... runcommand(server, ['status']) | |
272 | *** runcommand status |
|
272 | *** runcommand status | |
273 | M a |
|
273 | M a | |
274 | *** runcommand tip |
|
274 | *** runcommand tip | |
275 | changeset: 1:d3a0a68be6de |
|
275 | changeset: 1:d3a0a68be6de | |
276 | tag: tip |
|
276 | tag: tip | |
277 | user: test |
|
277 | user: test | |
278 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
278 | date: Thu Jan 01 00:00:00 1970 +0000 | |
279 | summary: 2 |
|
279 | summary: 2 | |
280 |
|
280 | |||
281 | *** runcommand status |
|
281 | *** runcommand status | |
282 |
|
282 | |||
283 | >>> import os |
|
283 | >>> import os | |
284 | >>> from hgclient import check, readchannel, runcommand |
|
284 | >>> from hgclient import check, readchannel, runcommand | |
285 | >>> @check |
|
285 | >>> @check | |
286 | ... def bookmarks(server): |
|
286 | ... def bookmarks(server): | |
287 | ... readchannel(server) |
|
287 | ... readchannel(server) | |
288 | ... runcommand(server, ['bookmarks']) |
|
288 | ... runcommand(server, ['bookmarks']) | |
289 | ... |
|
289 | ... | |
290 | ... # changes .hg/bookmarks |
|
290 | ... # changes .hg/bookmarks | |
291 | ... os.system('hg bookmark -i bm1') |
|
291 | ... os.system('hg bookmark -i bm1') | |
292 | ... os.system('hg bookmark -i bm2') |
|
292 | ... os.system('hg bookmark -i bm2') | |
293 | ... runcommand(server, ['bookmarks']) |
|
293 | ... runcommand(server, ['bookmarks']) | |
294 | ... |
|
294 | ... | |
295 | ... # changes .hg/bookmarks.current |
|
295 | ... # changes .hg/bookmarks.current | |
296 | ... os.system('hg upd bm1 -q') |
|
296 | ... os.system('hg upd bm1 -q') | |
297 | ... runcommand(server, ['bookmarks']) |
|
297 | ... runcommand(server, ['bookmarks']) | |
298 | ... |
|
298 | ... | |
299 | ... runcommand(server, ['bookmarks', 'bm3']) |
|
299 | ... runcommand(server, ['bookmarks', 'bm3']) | |
300 | ... f = open('a', 'ab') |
|
300 | ... f = open('a', 'ab') | |
301 | ... f.write('a\n') |
|
301 | ... f.write('a\n') and None | |
302 | ... f.close() |
|
302 | ... f.close() | |
303 | ... runcommand(server, ['commit', '-Amm']) |
|
303 | ... runcommand(server, ['commit', '-Amm']) | |
304 | ... runcommand(server, ['bookmarks']) |
|
304 | ... runcommand(server, ['bookmarks']) | |
305 | ... print('') |
|
305 | ... print('') | |
306 | *** runcommand bookmarks |
|
306 | *** runcommand bookmarks | |
307 | no bookmarks set |
|
307 | no bookmarks set | |
308 | *** runcommand bookmarks |
|
308 | *** runcommand bookmarks | |
309 | bm1 1:d3a0a68be6de |
|
309 | bm1 1:d3a0a68be6de | |
310 | bm2 1:d3a0a68be6de |
|
310 | bm2 1:d3a0a68be6de | |
311 | *** runcommand bookmarks |
|
311 | *** runcommand bookmarks | |
312 | * bm1 1:d3a0a68be6de |
|
312 | * bm1 1:d3a0a68be6de | |
313 | bm2 1:d3a0a68be6de |
|
313 | bm2 1:d3a0a68be6de | |
314 | *** runcommand bookmarks bm3 |
|
314 | *** runcommand bookmarks bm3 | |
315 | *** runcommand commit -Amm |
|
315 | *** runcommand commit -Amm | |
316 | *** runcommand bookmarks |
|
316 | *** runcommand bookmarks | |
317 | bm1 1:d3a0a68be6de |
|
317 | bm1 1:d3a0a68be6de | |
318 | bm2 1:d3a0a68be6de |
|
318 | bm2 1:d3a0a68be6de | |
319 | * bm3 2:aef17e88f5f0 |
|
319 | * bm3 2:aef17e88f5f0 | |
320 |
|
320 | |||
321 |
|
321 | |||
322 | >>> import os |
|
322 | >>> import os | |
323 | >>> from hgclient import check, readchannel, runcommand |
|
323 | >>> from hgclient import check, readchannel, runcommand | |
324 | >>> @check |
|
324 | >>> @check | |
325 | ... def tagscache(server): |
|
325 | ... def tagscache(server): | |
326 | ... readchannel(server) |
|
326 | ... readchannel(server) | |
327 | ... runcommand(server, ['id', '-t', '-r', '0']) |
|
327 | ... runcommand(server, ['id', '-t', '-r', '0']) | |
328 | ... os.system('hg tag -r 0 foo') |
|
328 | ... os.system('hg tag -r 0 foo') | |
329 | ... runcommand(server, ['id', '-t', '-r', '0']) |
|
329 | ... runcommand(server, ['id', '-t', '-r', '0']) | |
330 | *** runcommand id -t -r 0 |
|
330 | *** runcommand id -t -r 0 | |
331 |
|
331 | |||
332 | *** runcommand id -t -r 0 |
|
332 | *** runcommand id -t -r 0 | |
333 | foo |
|
333 | foo | |
334 |
|
334 | |||
335 | >>> import os |
|
335 | >>> import os | |
336 | >>> from hgclient import check, readchannel, runcommand |
|
336 | >>> from hgclient import check, readchannel, runcommand | |
337 | >>> @check |
|
337 | >>> @check | |
338 | ... def setphase(server): |
|
338 | ... def setphase(server): | |
339 | ... readchannel(server) |
|
339 | ... readchannel(server) | |
340 | ... runcommand(server, ['phase', '-r', '.']) |
|
340 | ... runcommand(server, ['phase', '-r', '.']) | |
341 | ... os.system('hg phase -r . -p') |
|
341 | ... os.system('hg phase -r . -p') | |
342 | ... runcommand(server, ['phase', '-r', '.']) |
|
342 | ... runcommand(server, ['phase', '-r', '.']) | |
343 | *** runcommand phase -r . |
|
343 | *** runcommand phase -r . | |
344 | 3: draft |
|
344 | 3: draft | |
345 | *** runcommand phase -r . |
|
345 | *** runcommand phase -r . | |
346 | 3: public |
|
346 | 3: public | |
347 |
|
347 | |||
348 | $ echo a >> a |
|
348 | $ echo a >> a | |
349 | >>> from hgclient import check, readchannel, runcommand |
|
349 | >>> from hgclient import check, readchannel, runcommand | |
350 | >>> @check |
|
350 | >>> @check | |
351 | ... def rollback(server): |
|
351 | ... def rollback(server): | |
352 | ... readchannel(server) |
|
352 | ... readchannel(server) | |
353 | ... runcommand(server, ['phase', '-r', '.', '-p']) |
|
353 | ... runcommand(server, ['phase', '-r', '.', '-p']) | |
354 | ... runcommand(server, ['commit', '-Am.']) |
|
354 | ... runcommand(server, ['commit', '-Am.']) | |
355 | ... runcommand(server, ['rollback']) |
|
355 | ... runcommand(server, ['rollback']) | |
356 | ... runcommand(server, ['phase', '-r', '.']) |
|
356 | ... runcommand(server, ['phase', '-r', '.']) | |
357 | ... print('') |
|
357 | ... print('') | |
358 | *** runcommand phase -r . -p |
|
358 | *** runcommand phase -r . -p | |
359 | no phases changed |
|
359 | no phases changed | |
360 | *** runcommand commit -Am. |
|
360 | *** runcommand commit -Am. | |
361 | *** runcommand rollback |
|
361 | *** runcommand rollback | |
362 | repository tip rolled back to revision 3 (undo commit) |
|
362 | repository tip rolled back to revision 3 (undo commit) | |
363 | working directory now based on revision 3 |
|
363 | working directory now based on revision 3 | |
364 | *** runcommand phase -r . |
|
364 | *** runcommand phase -r . | |
365 | 3: public |
|
365 | 3: public | |
366 |
|
366 | |||
367 |
|
367 | |||
368 | >>> import os |
|
368 | >>> import os | |
369 | >>> from hgclient import check, readchannel, runcommand |
|
369 | >>> from hgclient import check, readchannel, runcommand | |
370 | >>> @check |
|
370 | >>> @check | |
371 | ... def branch(server): |
|
371 | ... def branch(server): | |
372 | ... readchannel(server) |
|
372 | ... readchannel(server) | |
373 | ... runcommand(server, ['branch']) |
|
373 | ... runcommand(server, ['branch']) | |
374 | ... os.system('hg branch foo') |
|
374 | ... os.system('hg branch foo') | |
375 | ... runcommand(server, ['branch']) |
|
375 | ... runcommand(server, ['branch']) | |
376 | ... os.system('hg branch default') |
|
376 | ... os.system('hg branch default') | |
377 | *** runcommand branch |
|
377 | *** runcommand branch | |
378 | default |
|
378 | default | |
379 | marked working directory as branch foo |
|
379 | marked working directory as branch foo | |
380 | (branches are permanent and global, did you want a bookmark?) |
|
380 | (branches are permanent and global, did you want a bookmark?) | |
381 | *** runcommand branch |
|
381 | *** runcommand branch | |
382 | foo |
|
382 | foo | |
383 | marked working directory as branch default |
|
383 | marked working directory as branch default | |
384 | (branches are permanent and global, did you want a bookmark?) |
|
384 | (branches are permanent and global, did you want a bookmark?) | |
385 |
|
385 | |||
386 | $ touch .hgignore |
|
386 | $ touch .hgignore | |
387 | >>> import os |
|
387 | >>> import os | |
388 | >>> from hgclient import check, readchannel, runcommand |
|
388 | >>> from hgclient import check, readchannel, runcommand | |
389 | >>> @check |
|
389 | >>> @check | |
390 | ... def hgignore(server): |
|
390 | ... def hgignore(server): | |
391 | ... readchannel(server) |
|
391 | ... readchannel(server) | |
392 | ... runcommand(server, ['commit', '-Am.']) |
|
392 | ... runcommand(server, ['commit', '-Am.']) | |
393 | ... f = open('ignored-file', 'ab') |
|
393 | ... f = open('ignored-file', 'ab') | |
394 | ... f.write('') |
|
394 | ... f.write('') and None | |
395 | ... f.close() |
|
395 | ... f.close() | |
396 | ... f = open('.hgignore', 'ab') |
|
396 | ... f = open('.hgignore', 'ab') | |
397 | ... f.write('ignored-file') |
|
397 | ... f.write('ignored-file') | |
398 | ... f.close() |
|
398 | ... f.close() | |
399 | ... runcommand(server, ['status', '-i', '-u']) |
|
399 | ... runcommand(server, ['status', '-i', '-u']) | |
400 | ... print('') |
|
400 | ... print('') | |
401 | *** runcommand commit -Am. |
|
401 | *** runcommand commit -Am. | |
402 | adding .hgignore |
|
402 | adding .hgignore | |
403 | *** runcommand status -i -u |
|
403 | *** runcommand status -i -u | |
404 | I ignored-file |
|
404 | I ignored-file | |
405 |
|
405 | |||
406 |
|
406 | |||
407 | cache of non-public revisions should be invalidated on repository change |
|
407 | cache of non-public revisions should be invalidated on repository change | |
408 | (issue4855): |
|
408 | (issue4855): | |
409 |
|
409 | |||
410 | >>> import os |
|
410 | >>> import os | |
411 | >>> from hgclient import check, readchannel, runcommand |
|
411 | >>> from hgclient import check, readchannel, runcommand | |
412 | >>> @check |
|
412 | >>> @check | |
413 | ... def phasesetscacheaftercommit(server): |
|
413 | ... def phasesetscacheaftercommit(server): | |
414 | ... readchannel(server) |
|
414 | ... readchannel(server) | |
415 | ... # load _phasecache._phaserevs and _phasesets |
|
415 | ... # load _phasecache._phaserevs and _phasesets | |
416 | ... runcommand(server, ['log', '-qr', 'draft()']) |
|
416 | ... runcommand(server, ['log', '-qr', 'draft()']) | |
417 | ... # create draft commits by another process |
|
417 | ... # create draft commits by another process | |
418 | ... for i in range(5, 7): |
|
418 | ... for i in range(5, 7): | |
419 | ... f = open('a', 'ab') |
|
419 | ... f = open('a', 'ab') | |
420 | ... f.seek(0, os.SEEK_END) |
|
420 | ... f.seek(0, os.SEEK_END) | |
421 | ... f.write('a\n') |
|
421 | ... f.write('a\n') and None | |
422 | ... f.close() |
|
422 | ... f.close() | |
423 | ... os.system('hg commit -Aqm%d' % i) |
|
423 | ... os.system('hg commit -Aqm%d' % i) | |
424 | ... # new commits should be listed as draft revisions |
|
424 | ... # new commits should be listed as draft revisions | |
425 | ... runcommand(server, ['log', '-qr', 'draft()']) |
|
425 | ... runcommand(server, ['log', '-qr', 'draft()']) | |
426 | ... print('') |
|
426 | ... print('') | |
427 | *** runcommand log -qr draft() |
|
427 | *** runcommand log -qr draft() | |
428 | 4:7966c8e3734d |
|
428 | 4:7966c8e3734d | |
429 | *** runcommand log -qr draft() |
|
429 | *** runcommand log -qr draft() | |
430 | 4:7966c8e3734d |
|
430 | 4:7966c8e3734d | |
431 | 5:41f6602d1c4f |
|
431 | 5:41f6602d1c4f | |
432 | 6:10501e202c35 |
|
432 | 6:10501e202c35 | |
433 |
|
433 | |||
434 |
|
434 | |||
435 | >>> import os |
|
435 | >>> import os | |
436 | >>> from hgclient import check, readchannel, runcommand |
|
436 | >>> from hgclient import check, readchannel, runcommand | |
437 | >>> @check |
|
437 | >>> @check | |
438 | ... def phasesetscacheafterstrip(server): |
|
438 | ... def phasesetscacheafterstrip(server): | |
439 | ... readchannel(server) |
|
439 | ... readchannel(server) | |
440 | ... # load _phasecache._phaserevs and _phasesets |
|
440 | ... # load _phasecache._phaserevs and _phasesets | |
441 | ... runcommand(server, ['log', '-qr', 'draft()']) |
|
441 | ... runcommand(server, ['log', '-qr', 'draft()']) | |
442 | ... # strip cached revisions by another process |
|
442 | ... # strip cached revisions by another process | |
443 | ... os.system('hg --config extensions.strip= strip -q 5') |
|
443 | ... os.system('hg --config extensions.strip= strip -q 5') | |
444 | ... # shouldn't abort by "unknown revision '6'" |
|
444 | ... # shouldn't abort by "unknown revision '6'" | |
445 | ... runcommand(server, ['log', '-qr', 'draft()']) |
|
445 | ... runcommand(server, ['log', '-qr', 'draft()']) | |
446 | ... print('') |
|
446 | ... print('') | |
447 | *** runcommand log -qr draft() |
|
447 | *** runcommand log -qr draft() | |
448 | 4:7966c8e3734d |
|
448 | 4:7966c8e3734d | |
449 | 5:41f6602d1c4f |
|
449 | 5:41f6602d1c4f | |
450 | 6:10501e202c35 |
|
450 | 6:10501e202c35 | |
451 | *** runcommand log -qr draft() |
|
451 | *** runcommand log -qr draft() | |
452 | 4:7966c8e3734d |
|
452 | 4:7966c8e3734d | |
453 |
|
453 | |||
454 |
|
454 | |||
455 | cache of phase roots should be invalidated on strip (issue3827): |
|
455 | cache of phase roots should be invalidated on strip (issue3827): | |
456 |
|
456 | |||
457 | >>> import os |
|
457 | >>> import os | |
458 | >>> from hgclient import check, readchannel, runcommand, sep |
|
458 | >>> from hgclient import check, readchannel, runcommand, sep | |
459 | >>> @check |
|
459 | >>> @check | |
460 | ... def phasecacheafterstrip(server): |
|
460 | ... def phasecacheafterstrip(server): | |
461 | ... readchannel(server) |
|
461 | ... readchannel(server) | |
462 | ... |
|
462 | ... | |
463 | ... # create new head, 5:731265503d86 |
|
463 | ... # create new head, 5:731265503d86 | |
464 | ... runcommand(server, ['update', '-C', '0']) |
|
464 | ... runcommand(server, ['update', '-C', '0']) | |
465 | ... f = open('a', 'ab') |
|
465 | ... f = open('a', 'ab') | |
466 | ... f.write('a\n') |
|
466 | ... f.write('a\n') and None | |
467 | ... f.close() |
|
467 | ... f.close() | |
468 | ... runcommand(server, ['commit', '-Am.', 'a']) |
|
468 | ... runcommand(server, ['commit', '-Am.', 'a']) | |
469 | ... runcommand(server, ['log', '-Gq']) |
|
469 | ... runcommand(server, ['log', '-Gq']) | |
470 | ... |
|
470 | ... | |
471 | ... # make it public; draft marker moves to 4:7966c8e3734d |
|
471 | ... # make it public; draft marker moves to 4:7966c8e3734d | |
472 | ... runcommand(server, ['phase', '-p', '.']) |
|
472 | ... runcommand(server, ['phase', '-p', '.']) | |
473 | ... # load _phasecache.phaseroots |
|
473 | ... # load _phasecache.phaseroots | |
474 | ... runcommand(server, ['phase', '.'], outfilter=sep) |
|
474 | ... runcommand(server, ['phase', '.'], outfilter=sep) | |
475 | ... |
|
475 | ... | |
476 | ... # strip 1::4 outside server |
|
476 | ... # strip 1::4 outside server | |
477 | ... os.system('hg -q --config extensions.mq= strip 1') |
|
477 | ... os.system('hg -q --config extensions.mq= strip 1') | |
478 | ... |
|
478 | ... | |
479 | ... # shouldn't raise "7966c8e3734d: no node!" |
|
479 | ... # shouldn't raise "7966c8e3734d: no node!" | |
480 | ... runcommand(server, ['branches']) |
|
480 | ... runcommand(server, ['branches']) | |
481 | *** runcommand update -C 0 |
|
481 | *** runcommand update -C 0 | |
482 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
482 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
483 | (leaving bookmark bm3) |
|
483 | (leaving bookmark bm3) | |
484 | *** runcommand commit -Am. a |
|
484 | *** runcommand commit -Am. a | |
485 | created new head |
|
485 | created new head | |
486 | *** runcommand log -Gq |
|
486 | *** runcommand log -Gq | |
487 | @ 5:731265503d86 |
|
487 | @ 5:731265503d86 | |
488 | | |
|
488 | | | |
489 | | o 4:7966c8e3734d |
|
489 | | o 4:7966c8e3734d | |
490 | | | |
|
490 | | | | |
491 | | o 3:b9b85890c400 |
|
491 | | o 3:b9b85890c400 | |
492 | | | |
|
492 | | | | |
493 | | o 2:aef17e88f5f0 |
|
493 | | o 2:aef17e88f5f0 | |
494 | | | |
|
494 | | | | |
495 | | o 1:d3a0a68be6de |
|
495 | | o 1:d3a0a68be6de | |
496 | |/ |
|
496 | |/ | |
497 | o 0:eff892de26ec |
|
497 | o 0:eff892de26ec | |
498 |
|
498 | |||
499 | *** runcommand phase -p . |
|
499 | *** runcommand phase -p . | |
500 | *** runcommand phase . |
|
500 | *** runcommand phase . | |
501 | 5: public |
|
501 | 5: public | |
502 | *** runcommand branches |
|
502 | *** runcommand branches | |
503 | default 1:731265503d86 |
|
503 | default 1:731265503d86 | |
504 |
|
504 | |||
505 | in-memory cache must be reloaded if transaction is aborted. otherwise |
|
505 | in-memory cache must be reloaded if transaction is aborted. otherwise | |
506 | changelog and manifest would have invalid node: |
|
506 | changelog and manifest would have invalid node: | |
507 |
|
507 | |||
508 | $ echo a >> a |
|
508 | $ echo a >> a | |
509 | >>> from hgclient import check, readchannel, runcommand |
|
509 | >>> from hgclient import check, readchannel, runcommand | |
510 | >>> @check |
|
510 | >>> @check | |
511 | ... def txabort(server): |
|
511 | ... def txabort(server): | |
512 | ... readchannel(server) |
|
512 | ... readchannel(server) | |
513 | ... runcommand(server, ['commit', '--config', 'hooks.pretxncommit=false', |
|
513 | ... runcommand(server, ['commit', '--config', 'hooks.pretxncommit=false', | |
514 | ... '-mfoo']) |
|
514 | ... '-mfoo']) | |
515 | ... runcommand(server, ['verify']) |
|
515 | ... runcommand(server, ['verify']) | |
516 | *** runcommand commit --config hooks.pretxncommit=false -mfoo |
|
516 | *** runcommand commit --config hooks.pretxncommit=false -mfoo | |
517 | transaction abort! |
|
517 | transaction abort! | |
518 | rollback completed |
|
518 | rollback completed | |
519 | abort: pretxncommit hook exited with status 1 |
|
519 | abort: pretxncommit hook exited with status 1 | |
520 | [255] |
|
520 | [255] | |
521 | *** runcommand verify |
|
521 | *** runcommand verify | |
522 | checking changesets |
|
522 | checking changesets | |
523 | checking manifests |
|
523 | checking manifests | |
524 | crosschecking files in changesets and manifests |
|
524 | crosschecking files in changesets and manifests | |
525 | checking files |
|
525 | checking files | |
526 | checked 2 changesets with 2 changes to 1 files |
|
526 | checked 2 changesets with 2 changes to 1 files | |
527 | $ hg revert --no-backup -aq |
|
527 | $ hg revert --no-backup -aq | |
528 |
|
528 | |||
529 | $ cat >> .hg/hgrc << EOF |
|
529 | $ cat >> .hg/hgrc << EOF | |
530 | > [experimental] |
|
530 | > [experimental] | |
531 | > evolution.createmarkers=True |
|
531 | > evolution.createmarkers=True | |
532 | > EOF |
|
532 | > EOF | |
533 |
|
533 | |||
534 | >>> import os |
|
534 | >>> import os | |
535 | >>> from hgclient import check, readchannel, runcommand |
|
535 | >>> from hgclient import check, readchannel, runcommand | |
536 | >>> @check |
|
536 | >>> @check | |
537 | ... def obsolete(server): |
|
537 | ... def obsolete(server): | |
538 | ... readchannel(server) |
|
538 | ... readchannel(server) | |
539 | ... |
|
539 | ... | |
540 | ... runcommand(server, ['up', 'null']) |
|
540 | ... runcommand(server, ['up', 'null']) | |
541 | ... runcommand(server, ['phase', '-df', 'tip']) |
|
541 | ... runcommand(server, ['phase', '-df', 'tip']) | |
542 | ... cmd = 'hg debugobsolete `hg log -r tip --template {node}`' |
|
542 | ... cmd = 'hg debugobsolete `hg log -r tip --template {node}`' | |
543 | ... if os.name == 'nt': |
|
543 | ... if os.name == 'nt': | |
544 | ... cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe |
|
544 | ... cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe | |
545 | ... os.system(cmd) |
|
545 | ... os.system(cmd) | |
546 | ... runcommand(server, ['log', '--hidden']) |
|
546 | ... runcommand(server, ['log', '--hidden']) | |
547 | ... runcommand(server, ['log']) |
|
547 | ... runcommand(server, ['log']) | |
548 | *** runcommand up null |
|
548 | *** runcommand up null | |
549 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
549 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
550 | *** runcommand phase -df tip |
|
550 | *** runcommand phase -df tip | |
551 | obsoleted 1 changesets |
|
551 | obsoleted 1 changesets | |
552 | *** runcommand log --hidden |
|
552 | *** runcommand log --hidden | |
553 | changeset: 1:731265503d86 |
|
553 | changeset: 1:731265503d86 | |
554 | tag: tip |
|
554 | tag: tip | |
555 | user: test |
|
555 | user: test | |
556 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
556 | date: Thu Jan 01 00:00:00 1970 +0000 | |
557 | obsolete: pruned |
|
557 | obsolete: pruned | |
558 | summary: . |
|
558 | summary: . | |
559 |
|
559 | |||
560 | changeset: 0:eff892de26ec |
|
560 | changeset: 0:eff892de26ec | |
561 | bookmark: bm1 |
|
561 | bookmark: bm1 | |
562 | bookmark: bm2 |
|
562 | bookmark: bm2 | |
563 | bookmark: bm3 |
|
563 | bookmark: bm3 | |
564 | user: test |
|
564 | user: test | |
565 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
565 | date: Thu Jan 01 00:00:00 1970 +0000 | |
566 | summary: 1 |
|
566 | summary: 1 | |
567 |
|
567 | |||
568 | *** runcommand log |
|
568 | *** runcommand log | |
569 | changeset: 0:eff892de26ec |
|
569 | changeset: 0:eff892de26ec | |
570 | bookmark: bm1 |
|
570 | bookmark: bm1 | |
571 | bookmark: bm2 |
|
571 | bookmark: bm2 | |
572 | bookmark: bm3 |
|
572 | bookmark: bm3 | |
573 | tag: tip |
|
573 | tag: tip | |
574 | user: test |
|
574 | user: test | |
575 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
575 | date: Thu Jan 01 00:00:00 1970 +0000 | |
576 | summary: 1 |
|
576 | summary: 1 | |
577 |
|
577 | |||
578 |
|
578 | |||
579 | $ cat <<EOF >> .hg/hgrc |
|
579 | $ cat <<EOF >> .hg/hgrc | |
580 | > [extensions] |
|
580 | > [extensions] | |
581 | > mq = |
|
581 | > mq = | |
582 | > EOF |
|
582 | > EOF | |
583 |
|
583 | |||
584 | >>> import os |
|
584 | >>> import os | |
585 | >>> from hgclient import check, readchannel, runcommand |
|
585 | >>> from hgclient import check, readchannel, runcommand | |
586 | >>> @check |
|
586 | >>> @check | |
587 | ... def mqoutsidechanges(server): |
|
587 | ... def mqoutsidechanges(server): | |
588 | ... readchannel(server) |
|
588 | ... readchannel(server) | |
589 | ... |
|
589 | ... | |
590 | ... # load repo.mq |
|
590 | ... # load repo.mq | |
591 | ... runcommand(server, ['qapplied']) |
|
591 | ... runcommand(server, ['qapplied']) | |
592 | ... os.system('hg qnew 0.diff') |
|
592 | ... os.system('hg qnew 0.diff') | |
593 | ... # repo.mq should be invalidated |
|
593 | ... # repo.mq should be invalidated | |
594 | ... runcommand(server, ['qapplied']) |
|
594 | ... runcommand(server, ['qapplied']) | |
595 | ... |
|
595 | ... | |
596 | ... runcommand(server, ['qpop', '--all']) |
|
596 | ... runcommand(server, ['qpop', '--all']) | |
597 | ... os.system('hg qqueue --create foo') |
|
597 | ... os.system('hg qqueue --create foo') | |
598 | ... # repo.mq should be recreated to point to new queue |
|
598 | ... # repo.mq should be recreated to point to new queue | |
599 | ... runcommand(server, ['qqueue', '--active']) |
|
599 | ... runcommand(server, ['qqueue', '--active']) | |
600 | *** runcommand qapplied |
|
600 | *** runcommand qapplied | |
601 | *** runcommand qapplied |
|
601 | *** runcommand qapplied | |
602 | 0.diff |
|
602 | 0.diff | |
603 | *** runcommand qpop --all |
|
603 | *** runcommand qpop --all | |
604 | popping 0.diff |
|
604 | popping 0.diff | |
605 | patch queue now empty |
|
605 | patch queue now empty | |
606 | *** runcommand qqueue --active |
|
606 | *** runcommand qqueue --active | |
607 | foo |
|
607 | foo | |
608 |
|
608 | |||
609 | $ cat <<EOF > dbgui.py |
|
609 | $ cat <<EOF > dbgui.py | |
610 | > import os |
|
610 | > import os | |
611 | > import sys |
|
611 | > import sys | |
612 | > from mercurial import commands, registrar |
|
612 | > from mercurial import commands, registrar | |
613 | > cmdtable = {} |
|
613 | > cmdtable = {} | |
614 | > command = registrar.command(cmdtable) |
|
614 | > command = registrar.command(cmdtable) | |
615 | > @command(b"debuggetpass", norepo=True) |
|
615 | > @command(b"debuggetpass", norepo=True) | |
616 | > def debuggetpass(ui): |
|
616 | > def debuggetpass(ui): | |
617 | > ui.write("%s\\n" % ui.getpass()) |
|
617 | > ui.write("%s\\n" % ui.getpass()) | |
618 | > @command(b"debugprompt", norepo=True) |
|
618 | > @command(b"debugprompt", norepo=True) | |
619 | > def debugprompt(ui): |
|
619 | > def debugprompt(ui): | |
620 | > ui.write("%s\\n" % ui.prompt("prompt:")) |
|
620 | > ui.write("%s\\n" % ui.prompt("prompt:")) | |
621 | > @command(b"debugreadstdin", norepo=True) |
|
621 | > @command(b"debugreadstdin", norepo=True) | |
622 | > def debugreadstdin(ui): |
|
622 | > def debugreadstdin(ui): | |
623 | > ui.write("read: %r\n" % sys.stdin.read(1)) |
|
623 | > ui.write("read: %r\n" % sys.stdin.read(1)) | |
624 | > @command(b"debugwritestdout", norepo=True) |
|
624 | > @command(b"debugwritestdout", norepo=True) | |
625 | > def debugwritestdout(ui): |
|
625 | > def debugwritestdout(ui): | |
626 | > os.write(1, "low-level stdout fd and\n") |
|
626 | > os.write(1, "low-level stdout fd and\n") | |
627 | > sys.stdout.write("stdout should be redirected to stderr\n") |
|
627 | > sys.stdout.write("stdout should be redirected to stderr\n") | |
628 | > sys.stdout.flush() |
|
628 | > sys.stdout.flush() | |
629 | > EOF |
|
629 | > EOF | |
630 | $ cat <<EOF >> .hg/hgrc |
|
630 | $ cat <<EOF >> .hg/hgrc | |
631 | > [extensions] |
|
631 | > [extensions] | |
632 | > dbgui = dbgui.py |
|
632 | > dbgui = dbgui.py | |
633 | > EOF |
|
633 | > EOF | |
634 |
|
634 | |||
635 | >>> from hgclient import check, readchannel, runcommand, stringio |
|
635 | >>> from hgclient import check, readchannel, runcommand, stringio | |
636 | >>> @check |
|
636 | >>> @check | |
637 | ... def getpass(server): |
|
637 | ... def getpass(server): | |
638 | ... readchannel(server) |
|
638 | ... readchannel(server) | |
639 | ... runcommand(server, ['debuggetpass', '--config', |
|
639 | ... runcommand(server, ['debuggetpass', '--config', | |
640 | ... 'ui.interactive=True'], |
|
640 | ... 'ui.interactive=True'], | |
641 | ... input=stringio('1234\n')) |
|
641 | ... input=stringio('1234\n')) | |
642 | ... runcommand(server, ['debuggetpass', '--config', |
|
642 | ... runcommand(server, ['debuggetpass', '--config', | |
643 | ... 'ui.interactive=True'], |
|
643 | ... 'ui.interactive=True'], | |
644 | ... input=stringio('\n')) |
|
644 | ... input=stringio('\n')) | |
645 | ... runcommand(server, ['debuggetpass', '--config', |
|
645 | ... runcommand(server, ['debuggetpass', '--config', | |
646 | ... 'ui.interactive=True'], |
|
646 | ... 'ui.interactive=True'], | |
647 | ... input=stringio('')) |
|
647 | ... input=stringio('')) | |
648 | ... runcommand(server, ['debugprompt', '--config', |
|
648 | ... runcommand(server, ['debugprompt', '--config', | |
649 | ... 'ui.interactive=True'], |
|
649 | ... 'ui.interactive=True'], | |
650 | ... input=stringio('5678\n')) |
|
650 | ... input=stringio('5678\n')) | |
651 | ... runcommand(server, ['debugreadstdin']) |
|
651 | ... runcommand(server, ['debugreadstdin']) | |
652 | ... runcommand(server, ['debugwritestdout']) |
|
652 | ... runcommand(server, ['debugwritestdout']) | |
653 | *** runcommand debuggetpass --config ui.interactive=True |
|
653 | *** runcommand debuggetpass --config ui.interactive=True | |
654 | password: 1234 |
|
654 | password: 1234 | |
655 | *** runcommand debuggetpass --config ui.interactive=True |
|
655 | *** runcommand debuggetpass --config ui.interactive=True | |
656 | password: |
|
656 | password: | |
657 | *** runcommand debuggetpass --config ui.interactive=True |
|
657 | *** runcommand debuggetpass --config ui.interactive=True | |
658 | password: abort: response expected |
|
658 | password: abort: response expected | |
659 | [255] |
|
659 | [255] | |
660 | *** runcommand debugprompt --config ui.interactive=True |
|
660 | *** runcommand debugprompt --config ui.interactive=True | |
661 | prompt: 5678 |
|
661 | prompt: 5678 | |
662 | *** runcommand debugreadstdin |
|
662 | *** runcommand debugreadstdin | |
663 | read: '' |
|
663 | read: '' | |
664 | *** runcommand debugwritestdout |
|
664 | *** runcommand debugwritestdout | |
665 | low-level stdout fd and |
|
665 | low-level stdout fd and | |
666 | stdout should be redirected to stderr |
|
666 | stdout should be redirected to stderr | |
667 |
|
667 | |||
668 |
|
668 | |||
669 | run commandserver in commandserver, which is silly but should work: |
|
669 | run commandserver in commandserver, which is silly but should work: | |
670 |
|
670 | |||
671 | >>> from __future__ import print_function |
|
671 | >>> from __future__ import print_function | |
672 | >>> from hgclient import check, readchannel, runcommand, stringio |
|
672 | >>> from hgclient import check, readchannel, runcommand, stringio | |
673 | >>> @check |
|
673 | >>> @check | |
674 | ... def nested(server): |
|
674 | ... def nested(server): | |
675 | ... print('%c, %r' % readchannel(server)) |
|
675 | ... print('%c, %r' % readchannel(server)) | |
676 | ... class nestedserver(object): |
|
676 | ... class nestedserver(object): | |
677 | ... stdin = stringio('getencoding\n') |
|
677 | ... stdin = stringio('getencoding\n') | |
678 | ... stdout = stringio() |
|
678 | ... stdout = stringio() | |
679 | ... runcommand(server, ['serve', '--cmdserver', 'pipe'], |
|
679 | ... runcommand(server, ['serve', '--cmdserver', 'pipe'], | |
680 | ... output=nestedserver.stdout, input=nestedserver.stdin) |
|
680 | ... output=nestedserver.stdout, input=nestedserver.stdin) | |
681 | ... nestedserver.stdout.seek(0) |
|
681 | ... nestedserver.stdout.seek(0) | |
682 | ... print('%c, %r' % readchannel(nestedserver)) # hello |
|
682 | ... print('%c, %r' % readchannel(nestedserver)) # hello | |
683 | ... print('%c, %r' % readchannel(nestedserver)) # getencoding |
|
683 | ... print('%c, %r' % readchannel(nestedserver)) # getencoding | |
684 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
|
684 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) | |
685 | *** runcommand serve --cmdserver pipe |
|
685 | *** runcommand serve --cmdserver pipe | |
686 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
|
686 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) | |
687 | r, '*' (glob) |
|
687 | r, '*' (glob) | |
688 |
|
688 | |||
689 |
|
689 | |||
690 | start without repository: |
|
690 | start without repository: | |
691 |
|
691 | |||
692 | $ cd .. |
|
692 | $ cd .. | |
693 |
|
693 | |||
694 | >>> from __future__ import print_function |
|
694 | >>> from __future__ import print_function | |
695 | >>> from hgclient import check, readchannel, runcommand |
|
695 | >>> from hgclient import check, readchannel, runcommand | |
696 | >>> @check |
|
696 | >>> @check | |
697 | ... def hellomessage(server): |
|
697 | ... def hellomessage(server): | |
698 | ... ch, data = readchannel(server) |
|
698 | ... ch, data = readchannel(server) | |
699 | ... print('%c, %r' % (ch, data)) |
|
699 | ... print('%c, %r' % (ch, data)) | |
700 | ... # run an arbitrary command to make sure the next thing the server |
|
700 | ... # run an arbitrary command to make sure the next thing the server | |
701 | ... # sends isn't part of the hello message |
|
701 | ... # sends isn't part of the hello message | |
702 | ... runcommand(server, ['id']) |
|
702 | ... runcommand(server, ['id']) | |
703 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
|
703 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) | |
704 | *** runcommand id |
|
704 | *** runcommand id | |
705 | abort: there is no Mercurial repository here (.hg not found) |
|
705 | abort: there is no Mercurial repository here (.hg not found) | |
706 | [255] |
|
706 | [255] | |
707 |
|
707 | |||
708 | >>> from hgclient import check, readchannel, runcommand |
|
708 | >>> from hgclient import check, readchannel, runcommand | |
709 | >>> @check |
|
709 | >>> @check | |
710 | ... def startwithoutrepo(server): |
|
710 | ... def startwithoutrepo(server): | |
711 | ... readchannel(server) |
|
711 | ... readchannel(server) | |
712 | ... runcommand(server, ['init', 'repo2']) |
|
712 | ... runcommand(server, ['init', 'repo2']) | |
713 | ... runcommand(server, ['id', '-R', 'repo2']) |
|
713 | ... runcommand(server, ['id', '-R', 'repo2']) | |
714 | *** runcommand init repo2 |
|
714 | *** runcommand init repo2 | |
715 | *** runcommand id -R repo2 |
|
715 | *** runcommand id -R repo2 | |
716 | 000000000000 tip |
|
716 | 000000000000 tip | |
717 |
|
717 | |||
718 |
|
718 | |||
719 | don't fall back to cwd if invalid -R path is specified (issue4805): |
|
719 | don't fall back to cwd if invalid -R path is specified (issue4805): | |
720 |
|
720 | |||
721 | $ cd repo |
|
721 | $ cd repo | |
722 | $ hg serve --cmdserver pipe -R ../nonexistent |
|
722 | $ hg serve --cmdserver pipe -R ../nonexistent | |
723 | abort: repository ../nonexistent not found! |
|
723 | abort: repository ../nonexistent not found! | |
724 | [255] |
|
724 | [255] | |
725 | $ cd .. |
|
725 | $ cd .. | |
726 |
|
726 | |||
727 |
|
727 | |||
728 | unix domain socket: |
|
728 | unix domain socket: | |
729 |
|
729 | |||
730 | $ cd repo |
|
730 | $ cd repo | |
731 | $ hg update -q |
|
731 | $ hg update -q | |
732 |
|
732 | |||
733 | #if unix-socket unix-permissions |
|
733 | #if unix-socket unix-permissions | |
734 |
|
734 | |||
735 | >>> from __future__ import print_function |
|
735 | >>> from __future__ import print_function | |
736 | >>> from hgclient import check, readchannel, runcommand, stringio, unixserver |
|
736 | >>> from hgclient import check, readchannel, runcommand, stringio, unixserver | |
737 | >>> server = unixserver('.hg/server.sock', '.hg/server.log') |
|
737 | >>> server = unixserver('.hg/server.sock', '.hg/server.log') | |
738 | >>> def hellomessage(conn): |
|
738 | >>> def hellomessage(conn): | |
739 | ... ch, data = readchannel(conn) |
|
739 | ... ch, data = readchannel(conn) | |
740 | ... print('%c, %r' % (ch, data)) |
|
740 | ... print('%c, %r' % (ch, data)) | |
741 | ... runcommand(conn, ['id']) |
|
741 | ... runcommand(conn, ['id']) | |
742 | >>> check(hellomessage, server.connect) |
|
742 | >>> check(hellomessage, server.connect) | |
743 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
|
743 | o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) | |
744 | *** runcommand id |
|
744 | *** runcommand id | |
745 | eff892de26ec tip bm1/bm2/bm3 |
|
745 | eff892de26ec tip bm1/bm2/bm3 | |
746 | >>> def unknowncommand(conn): |
|
746 | >>> def unknowncommand(conn): | |
747 | ... readchannel(conn) |
|
747 | ... readchannel(conn) | |
748 | ... conn.stdin.write('unknowncommand\n') |
|
748 | ... conn.stdin.write('unknowncommand\n') | |
749 | >>> check(unknowncommand, server.connect) # error sent to server.log |
|
749 | >>> check(unknowncommand, server.connect) # error sent to server.log | |
750 | >>> def serverinput(conn): |
|
750 | >>> def serverinput(conn): | |
751 | ... readchannel(conn) |
|
751 | ... readchannel(conn) | |
752 | ... patch = """ |
|
752 | ... patch = """ | |
753 | ... # HG changeset patch |
|
753 | ... # HG changeset patch | |
754 | ... # User test |
|
754 | ... # User test | |
755 | ... # Date 0 0 |
|
755 | ... # Date 0 0 | |
756 | ... 2 |
|
756 | ... 2 | |
757 | ... |
|
757 | ... | |
758 | ... diff -r eff892de26ec -r 1ed24be7e7a0 a |
|
758 | ... diff -r eff892de26ec -r 1ed24be7e7a0 a | |
759 | ... --- a/a |
|
759 | ... --- a/a | |
760 | ... +++ b/a |
|
760 | ... +++ b/a | |
761 | ... @@ -1,1 +1,2 @@ |
|
761 | ... @@ -1,1 +1,2 @@ | |
762 | ... 1 |
|
762 | ... 1 | |
763 | ... +2 |
|
763 | ... +2 | |
764 | ... """ |
|
764 | ... """ | |
765 | ... runcommand(conn, ['import', '-'], input=stringio(patch)) |
|
765 | ... runcommand(conn, ['import', '-'], input=stringio(patch)) | |
766 | ... runcommand(conn, ['log', '-rtip', '-q']) |
|
766 | ... runcommand(conn, ['log', '-rtip', '-q']) | |
767 | >>> check(serverinput, server.connect) |
|
767 | >>> check(serverinput, server.connect) | |
768 | *** runcommand import - |
|
768 | *** runcommand import - | |
769 | applying patch from stdin |
|
769 | applying patch from stdin | |
770 | *** runcommand log -rtip -q |
|
770 | *** runcommand log -rtip -q | |
771 | 2:1ed24be7e7a0 |
|
771 | 2:1ed24be7e7a0 | |
772 | >>> server.shutdown() |
|
772 | >>> server.shutdown() | |
773 |
|
773 | |||
774 | $ cat .hg/server.log |
|
774 | $ cat .hg/server.log | |
775 | listening at .hg/server.sock |
|
775 | listening at .hg/server.sock | |
776 | abort: unknown command unknowncommand |
|
776 | abort: unknown command unknowncommand | |
777 | killed! |
|
777 | killed! | |
778 | $ rm .hg/server.log |
|
778 | $ rm .hg/server.log | |
779 |
|
779 | |||
780 | if server crashed before hello, traceback will be sent to 'e' channel as |
|
780 | if server crashed before hello, traceback will be sent to 'e' channel as | |
781 | last ditch: |
|
781 | last ditch: | |
782 |
|
782 | |||
783 | $ cat <<EOF >> .hg/hgrc |
|
783 | $ cat <<EOF >> .hg/hgrc | |
784 | > [cmdserver] |
|
784 | > [cmdserver] | |
785 | > log = inexistent/path.log |
|
785 | > log = inexistent/path.log | |
786 | > EOF |
|
786 | > EOF | |
787 | >>> from __future__ import print_function |
|
787 | >>> from __future__ import print_function | |
788 | >>> from hgclient import check, readchannel, unixserver |
|
788 | >>> from hgclient import check, readchannel, unixserver | |
789 | >>> server = unixserver('.hg/server.sock', '.hg/server.log') |
|
789 | >>> server = unixserver('.hg/server.sock', '.hg/server.log') | |
790 | >>> def earlycrash(conn): |
|
790 | >>> def earlycrash(conn): | |
791 | ... while True: |
|
791 | ... while True: | |
792 | ... try: |
|
792 | ... try: | |
793 | ... ch, data = readchannel(conn) |
|
793 | ... ch, data = readchannel(conn) | |
794 | ... if not data.startswith(' '): |
|
794 | ... if not data.startswith(' '): | |
795 | ... print('%c, %r' % (ch, data)) |
|
795 | ... print('%c, %r' % (ch, data)) | |
796 | ... except EOFError: |
|
796 | ... except EOFError: | |
797 | ... break |
|
797 | ... break | |
798 | >>> check(earlycrash, server.connect) |
|
798 | >>> check(earlycrash, server.connect) | |
799 | e, 'Traceback (most recent call last):\n' |
|
799 | e, 'Traceback (most recent call last):\n' | |
800 | e, "IOError: *" (glob) |
|
800 | e, "IOError: *" (glob) | |
801 | >>> server.shutdown() |
|
801 | >>> server.shutdown() | |
802 |
|
802 | |||
803 | $ cat .hg/server.log | grep -v '^ ' |
|
803 | $ cat .hg/server.log | grep -v '^ ' | |
804 | listening at .hg/server.sock |
|
804 | listening at .hg/server.sock | |
805 | Traceback (most recent call last): |
|
805 | Traceback (most recent call last): | |
806 | IOError: * (glob) |
|
806 | IOError: * (glob) | |
807 | killed! |
|
807 | killed! | |
808 | #endif |
|
808 | #endif | |
809 | #if no-unix-socket |
|
809 | #if no-unix-socket | |
810 |
|
810 | |||
811 | $ hg serve --cmdserver unix -a .hg/server.sock |
|
811 | $ hg serve --cmdserver unix -a .hg/server.sock | |
812 | abort: unsupported platform |
|
812 | abort: unsupported platform | |
813 | [255] |
|
813 | [255] | |
814 |
|
814 | |||
815 | #endif |
|
815 | #endif | |
816 |
|
816 | |||
817 | $ cd .. |
|
817 | $ cd .. | |
818 |
|
818 | |||
819 | Test that accessing to invalid changelog cache is avoided at |
|
819 | Test that accessing to invalid changelog cache is avoided at | |
820 | subsequent operations even if repo object is reused even after failure |
|
820 | subsequent operations even if repo object is reused even after failure | |
821 | of transaction (see 0a7610758c42 also) |
|
821 | of transaction (see 0a7610758c42 also) | |
822 |
|
822 | |||
823 | "hg log" after failure of transaction is needed to detect invalid |
|
823 | "hg log" after failure of transaction is needed to detect invalid | |
824 | cache in repoview: this can't detect by "hg verify" only. |
|
824 | cache in repoview: this can't detect by "hg verify" only. | |
825 |
|
825 | |||
826 | Combination of "finalization" and "empty-ness of changelog" (2 x 2 = |
|
826 | Combination of "finalization" and "empty-ness of changelog" (2 x 2 = | |
827 | 4) are tested, because '00changelog.i' are differently changed in each |
|
827 | 4) are tested, because '00changelog.i' are differently changed in each | |
828 | cases. |
|
828 | cases. | |
829 |
|
829 | |||
830 | $ cat > $TESTTMP/failafterfinalize.py <<EOF |
|
830 | $ cat > $TESTTMP/failafterfinalize.py <<EOF | |
831 | > # extension to abort transaction after finalization forcibly |
|
831 | > # extension to abort transaction after finalization forcibly | |
832 | > from mercurial import commands, error, extensions, lock as lockmod |
|
832 | > from mercurial import commands, error, extensions, lock as lockmod | |
833 | > from mercurial import registrar |
|
833 | > from mercurial import registrar | |
834 | > cmdtable = {} |
|
834 | > cmdtable = {} | |
835 | > command = registrar.command(cmdtable) |
|
835 | > command = registrar.command(cmdtable) | |
836 | > configtable = {} |
|
836 | > configtable = {} | |
837 | > configitem = registrar.configitem(configtable) |
|
837 | > configitem = registrar.configitem(configtable) | |
838 | > configitem('failafterfinalize', 'fail', |
|
838 | > configitem('failafterfinalize', 'fail', | |
839 | > default=None, |
|
839 | > default=None, | |
840 | > ) |
|
840 | > ) | |
841 | > def fail(tr): |
|
841 | > def fail(tr): | |
842 | > raise error.Abort('fail after finalization') |
|
842 | > raise error.Abort('fail after finalization') | |
843 | > def reposetup(ui, repo): |
|
843 | > def reposetup(ui, repo): | |
844 | > class failrepo(repo.__class__): |
|
844 | > class failrepo(repo.__class__): | |
845 | > def commitctx(self, ctx, error=False): |
|
845 | > def commitctx(self, ctx, error=False): | |
846 | > if self.ui.configbool('failafterfinalize', 'fail'): |
|
846 | > if self.ui.configbool('failafterfinalize', 'fail'): | |
847 | > # 'sorted()' by ASCII code on category names causes |
|
847 | > # 'sorted()' by ASCII code on category names causes | |
848 | > # invoking 'fail' after finalization of changelog |
|
848 | > # invoking 'fail' after finalization of changelog | |
849 | > # using "'cl-%i' % id(self)" as category name |
|
849 | > # using "'cl-%i' % id(self)" as category name | |
850 | > self.currenttransaction().addfinalize('zzzzzzzz', fail) |
|
850 | > self.currenttransaction().addfinalize('zzzzzzzz', fail) | |
851 | > return super(failrepo, self).commitctx(ctx, error) |
|
851 | > return super(failrepo, self).commitctx(ctx, error) | |
852 | > repo.__class__ = failrepo |
|
852 | > repo.__class__ = failrepo | |
853 | > EOF |
|
853 | > EOF | |
854 |
|
854 | |||
855 | $ hg init repo3 |
|
855 | $ hg init repo3 | |
856 | $ cd repo3 |
|
856 | $ cd repo3 | |
857 |
|
857 | |||
858 | $ cat <<EOF >> $HGRCPATH |
|
858 | $ cat <<EOF >> $HGRCPATH | |
859 | > [ui] |
|
859 | > [ui] | |
860 | > logtemplate = {rev} {desc|firstline} ({files})\n |
|
860 | > logtemplate = {rev} {desc|firstline} ({files})\n | |
861 | > |
|
861 | > | |
862 | > [extensions] |
|
862 | > [extensions] | |
863 | > failafterfinalize = $TESTTMP/failafterfinalize.py |
|
863 | > failafterfinalize = $TESTTMP/failafterfinalize.py | |
864 | > EOF |
|
864 | > EOF | |
865 |
|
865 | |||
866 | - test failure with "empty changelog" |
|
866 | - test failure with "empty changelog" | |
867 |
|
867 | |||
868 | $ echo foo > foo |
|
868 | $ echo foo > foo | |
869 | $ hg add foo |
|
869 | $ hg add foo | |
870 |
|
870 | |||
871 | (failure before finalization) |
|
871 | (failure before finalization) | |
872 |
|
872 | |||
873 | >>> from hgclient import check, readchannel, runcommand |
|
873 | >>> from hgclient import check, readchannel, runcommand | |
874 | >>> @check |
|
874 | >>> @check | |
875 | ... def abort(server): |
|
875 | ... def abort(server): | |
876 | ... readchannel(server) |
|
876 | ... readchannel(server) | |
877 | ... runcommand(server, ['commit', |
|
877 | ... runcommand(server, ['commit', | |
878 | ... '--config', 'hooks.pretxncommit=false', |
|
878 | ... '--config', 'hooks.pretxncommit=false', | |
879 | ... '-mfoo']) |
|
879 | ... '-mfoo']) | |
880 | ... runcommand(server, ['log']) |
|
880 | ... runcommand(server, ['log']) | |
881 | ... runcommand(server, ['verify', '-q']) |
|
881 | ... runcommand(server, ['verify', '-q']) | |
882 | *** runcommand commit --config hooks.pretxncommit=false -mfoo |
|
882 | *** runcommand commit --config hooks.pretxncommit=false -mfoo | |
883 | transaction abort! |
|
883 | transaction abort! | |
884 | rollback completed |
|
884 | rollback completed | |
885 | abort: pretxncommit hook exited with status 1 |
|
885 | abort: pretxncommit hook exited with status 1 | |
886 | [255] |
|
886 | [255] | |
887 | *** runcommand log |
|
887 | *** runcommand log | |
888 | *** runcommand verify -q |
|
888 | *** runcommand verify -q | |
889 |
|
889 | |||
890 | (failure after finalization) |
|
890 | (failure after finalization) | |
891 |
|
891 | |||
892 | >>> from hgclient import check, readchannel, runcommand |
|
892 | >>> from hgclient import check, readchannel, runcommand | |
893 | >>> @check |
|
893 | >>> @check | |
894 | ... def abort(server): |
|
894 | ... def abort(server): | |
895 | ... readchannel(server) |
|
895 | ... readchannel(server) | |
896 | ... runcommand(server, ['commit', |
|
896 | ... runcommand(server, ['commit', | |
897 | ... '--config', 'failafterfinalize.fail=true', |
|
897 | ... '--config', 'failafterfinalize.fail=true', | |
898 | ... '-mfoo']) |
|
898 | ... '-mfoo']) | |
899 | ... runcommand(server, ['log']) |
|
899 | ... runcommand(server, ['log']) | |
900 | ... runcommand(server, ['verify', '-q']) |
|
900 | ... runcommand(server, ['verify', '-q']) | |
901 | *** runcommand commit --config failafterfinalize.fail=true -mfoo |
|
901 | *** runcommand commit --config failafterfinalize.fail=true -mfoo | |
902 | transaction abort! |
|
902 | transaction abort! | |
903 | rollback completed |
|
903 | rollback completed | |
904 | abort: fail after finalization |
|
904 | abort: fail after finalization | |
905 | [255] |
|
905 | [255] | |
906 | *** runcommand log |
|
906 | *** runcommand log | |
907 | *** runcommand verify -q |
|
907 | *** runcommand verify -q | |
908 |
|
908 | |||
909 | - test failure with "not-empty changelog" |
|
909 | - test failure with "not-empty changelog" | |
910 |
|
910 | |||
911 | $ echo bar > bar |
|
911 | $ echo bar > bar | |
912 | $ hg add bar |
|
912 | $ hg add bar | |
913 | $ hg commit -mbar bar |
|
913 | $ hg commit -mbar bar | |
914 |
|
914 | |||
915 | (failure before finalization) |
|
915 | (failure before finalization) | |
916 |
|
916 | |||
917 | >>> from hgclient import check, readchannel, runcommand |
|
917 | >>> from hgclient import check, readchannel, runcommand | |
918 | >>> @check |
|
918 | >>> @check | |
919 | ... def abort(server): |
|
919 | ... def abort(server): | |
920 | ... readchannel(server) |
|
920 | ... readchannel(server) | |
921 | ... runcommand(server, ['commit', |
|
921 | ... runcommand(server, ['commit', | |
922 | ... '--config', 'hooks.pretxncommit=false', |
|
922 | ... '--config', 'hooks.pretxncommit=false', | |
923 | ... '-mfoo', 'foo']) |
|
923 | ... '-mfoo', 'foo']) | |
924 | ... runcommand(server, ['log']) |
|
924 | ... runcommand(server, ['log']) | |
925 | ... runcommand(server, ['verify', '-q']) |
|
925 | ... runcommand(server, ['verify', '-q']) | |
926 | *** runcommand commit --config hooks.pretxncommit=false -mfoo foo |
|
926 | *** runcommand commit --config hooks.pretxncommit=false -mfoo foo | |
927 | transaction abort! |
|
927 | transaction abort! | |
928 | rollback completed |
|
928 | rollback completed | |
929 | abort: pretxncommit hook exited with status 1 |
|
929 | abort: pretxncommit hook exited with status 1 | |
930 | [255] |
|
930 | [255] | |
931 | *** runcommand log |
|
931 | *** runcommand log | |
932 | 0 bar (bar) |
|
932 | 0 bar (bar) | |
933 | *** runcommand verify -q |
|
933 | *** runcommand verify -q | |
934 |
|
934 | |||
935 | (failure after finalization) |
|
935 | (failure after finalization) | |
936 |
|
936 | |||
937 | >>> from hgclient import check, readchannel, runcommand |
|
937 | >>> from hgclient import check, readchannel, runcommand | |
938 | >>> @check |
|
938 | >>> @check | |
939 | ... def abort(server): |
|
939 | ... def abort(server): | |
940 | ... readchannel(server) |
|
940 | ... readchannel(server) | |
941 | ... runcommand(server, ['commit', |
|
941 | ... runcommand(server, ['commit', | |
942 | ... '--config', 'failafterfinalize.fail=true', |
|
942 | ... '--config', 'failafterfinalize.fail=true', | |
943 | ... '-mfoo', 'foo']) |
|
943 | ... '-mfoo', 'foo']) | |
944 | ... runcommand(server, ['log']) |
|
944 | ... runcommand(server, ['log']) | |
945 | ... runcommand(server, ['verify', '-q']) |
|
945 | ... runcommand(server, ['verify', '-q']) | |
946 | *** runcommand commit --config failafterfinalize.fail=true -mfoo foo |
|
946 | *** runcommand commit --config failafterfinalize.fail=true -mfoo foo | |
947 | transaction abort! |
|
947 | transaction abort! | |
948 | rollback completed |
|
948 | rollback completed | |
949 | abort: fail after finalization |
|
949 | abort: fail after finalization | |
950 | [255] |
|
950 | [255] | |
951 | *** runcommand log |
|
951 | *** runcommand log | |
952 | 0 bar (bar) |
|
952 | 0 bar (bar) | |
953 | *** runcommand verify -q |
|
953 | *** runcommand verify -q | |
954 |
|
954 | |||
955 | $ cd .. |
|
955 | $ cd .. | |
956 |
|
956 | |||
957 | Test symlink traversal over cached audited paths: |
|
957 | Test symlink traversal over cached audited paths: | |
958 | ------------------------------------------------- |
|
958 | ------------------------------------------------- | |
959 |
|
959 | |||
960 | #if symlink |
|
960 | #if symlink | |
961 |
|
961 | |||
962 | set up symlink hell |
|
962 | set up symlink hell | |
963 |
|
963 | |||
964 | $ mkdir merge-symlink-out |
|
964 | $ mkdir merge-symlink-out | |
965 | $ hg init merge-symlink |
|
965 | $ hg init merge-symlink | |
966 | $ cd merge-symlink |
|
966 | $ cd merge-symlink | |
967 | $ touch base |
|
967 | $ touch base | |
968 | $ hg commit -qAm base |
|
968 | $ hg commit -qAm base | |
969 | $ ln -s ../merge-symlink-out a |
|
969 | $ ln -s ../merge-symlink-out a | |
970 | $ hg commit -qAm 'symlink a -> ../merge-symlink-out' |
|
970 | $ hg commit -qAm 'symlink a -> ../merge-symlink-out' | |
971 | $ hg up -q 0 |
|
971 | $ hg up -q 0 | |
972 | $ mkdir a |
|
972 | $ mkdir a | |
973 | $ touch a/poisoned |
|
973 | $ touch a/poisoned | |
974 | $ hg commit -qAm 'file a/poisoned' |
|
974 | $ hg commit -qAm 'file a/poisoned' | |
975 | $ hg log -G -T '{rev}: {desc}\n' |
|
975 | $ hg log -G -T '{rev}: {desc}\n' | |
976 | @ 2: file a/poisoned |
|
976 | @ 2: file a/poisoned | |
977 | | |
|
977 | | | |
978 | | o 1: symlink a -> ../merge-symlink-out |
|
978 | | o 1: symlink a -> ../merge-symlink-out | |
979 | |/ |
|
979 | |/ | |
980 | o 0: base |
|
980 | o 0: base | |
981 |
|
981 | |||
982 |
|
982 | |||
983 | try trivial merge after update: cache of audited paths should be discarded, |
|
983 | try trivial merge after update: cache of audited paths should be discarded, | |
984 | and the merge should fail (issue5628) |
|
984 | and the merge should fail (issue5628) | |
985 |
|
985 | |||
986 | $ hg up -q null |
|
986 | $ hg up -q null | |
987 | >>> from hgclient import check, readchannel, runcommand |
|
987 | >>> from hgclient import check, readchannel, runcommand | |
988 | >>> @check |
|
988 | >>> @check | |
989 | ... def merge(server): |
|
989 | ... def merge(server): | |
990 | ... readchannel(server) |
|
990 | ... readchannel(server) | |
991 | ... # audit a/poisoned as a good path |
|
991 | ... # audit a/poisoned as a good path | |
992 | ... runcommand(server, ['up', '-qC', '2']) |
|
992 | ... runcommand(server, ['up', '-qC', '2']) | |
993 | ... runcommand(server, ['up', '-qC', '1']) |
|
993 | ... runcommand(server, ['up', '-qC', '1']) | |
994 | ... # here a is a symlink, so a/poisoned is bad |
|
994 | ... # here a is a symlink, so a/poisoned is bad | |
995 | ... runcommand(server, ['merge', '2']) |
|
995 | ... runcommand(server, ['merge', '2']) | |
996 | *** runcommand up -qC 2 |
|
996 | *** runcommand up -qC 2 | |
997 | *** runcommand up -qC 1 |
|
997 | *** runcommand up -qC 1 | |
998 | *** runcommand merge 2 |
|
998 | *** runcommand merge 2 | |
999 | abort: path 'a/poisoned' traverses symbolic link 'a' |
|
999 | abort: path 'a/poisoned' traverses symbolic link 'a' | |
1000 | [255] |
|
1000 | [255] | |
1001 | $ ls ../merge-symlink-out |
|
1001 | $ ls ../merge-symlink-out | |
1002 |
|
1002 | |||
1003 | cache of repo.auditor should be discarded, so matcher would never traverse |
|
1003 | cache of repo.auditor should be discarded, so matcher would never traverse | |
1004 | symlinks: |
|
1004 | symlinks: | |
1005 |
|
1005 | |||
1006 | $ hg up -qC 0 |
|
1006 | $ hg up -qC 0 | |
1007 | $ touch ../merge-symlink-out/poisoned |
|
1007 | $ touch ../merge-symlink-out/poisoned | |
1008 | >>> from hgclient import check, readchannel, runcommand |
|
1008 | >>> from hgclient import check, readchannel, runcommand | |
1009 | >>> @check |
|
1009 | >>> @check | |
1010 | ... def files(server): |
|
1010 | ... def files(server): | |
1011 | ... readchannel(server) |
|
1011 | ... readchannel(server) | |
1012 | ... runcommand(server, ['up', '-qC', '2']) |
|
1012 | ... runcommand(server, ['up', '-qC', '2']) | |
1013 | ... # audit a/poisoned as a good path |
|
1013 | ... # audit a/poisoned as a good path | |
1014 | ... runcommand(server, ['files', 'a/poisoned']) |
|
1014 | ... runcommand(server, ['files', 'a/poisoned']) | |
1015 | ... runcommand(server, ['up', '-qC', '0']) |
|
1015 | ... runcommand(server, ['up', '-qC', '0']) | |
1016 | ... runcommand(server, ['up', '-qC', '1']) |
|
1016 | ... runcommand(server, ['up', '-qC', '1']) | |
1017 | ... # here 'a' is a symlink, so a/poisoned should be warned |
|
1017 | ... # here 'a' is a symlink, so a/poisoned should be warned | |
1018 | ... runcommand(server, ['files', 'a/poisoned']) |
|
1018 | ... runcommand(server, ['files', 'a/poisoned']) | |
1019 | *** runcommand up -qC 2 |
|
1019 | *** runcommand up -qC 2 | |
1020 | *** runcommand files a/poisoned |
|
1020 | *** runcommand files a/poisoned | |
1021 | a/poisoned |
|
1021 | a/poisoned | |
1022 | *** runcommand up -qC 0 |
|
1022 | *** runcommand up -qC 0 | |
1023 | *** runcommand up -qC 1 |
|
1023 | *** runcommand up -qC 1 | |
1024 | *** runcommand files a/poisoned |
|
1024 | *** runcommand files a/poisoned | |
1025 | abort: path 'a/poisoned' traverses symbolic link 'a' |
|
1025 | abort: path 'a/poisoned' traverses symbolic link 'a' | |
1026 | [255] |
|
1026 | [255] | |
1027 |
|
1027 | |||
1028 | $ cd .. |
|
1028 | $ cd .. | |
1029 |
|
1029 | |||
1030 | #endif |
|
1030 | #endif |
@@ -1,1480 +1,1480 b'' | |||||
1 | #require no-reposimplestore |
|
1 | #require no-reposimplestore | |
2 |
|
2 | |||
3 | Run kwdemo outside a repo |
|
3 | Run kwdemo outside a repo | |
4 | $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo |
|
4 | $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo | |
5 | [extensions] |
|
5 | [extensions] | |
6 | keyword = |
|
6 | keyword = | |
7 | [keyword] |
|
7 | [keyword] | |
8 | demo.txt = |
|
8 | demo.txt = | |
9 | [keywordset] |
|
9 | [keywordset] | |
10 | svn = False |
|
10 | svn = False | |
11 | [keywordmaps] |
|
11 | [keywordmaps] | |
12 | Foo = {author|user} |
|
12 | Foo = {author|user} | |
13 | $Foo: test $ |
|
13 | $Foo: test $ | |
14 |
|
14 | |||
15 | $ cat <<EOF >> $HGRCPATH |
|
15 | $ cat <<EOF >> $HGRCPATH | |
16 | > [extensions] |
|
16 | > [extensions] | |
17 | > keyword = |
|
17 | > keyword = | |
18 | > mq = |
|
18 | > mq = | |
19 | > notify = |
|
19 | > notify = | |
20 | > record = |
|
20 | > record = | |
21 | > transplant = |
|
21 | > transplant = | |
22 | > [ui] |
|
22 | > [ui] | |
23 | > interactive = true |
|
23 | > interactive = true | |
24 | > EOF |
|
24 | > EOF | |
25 |
|
25 | |||
26 | hide outer repo |
|
26 | hide outer repo | |
27 | $ hg init |
|
27 | $ hg init | |
28 |
|
28 | |||
29 | Run kwdemo before [keyword] files are set up |
|
29 | Run kwdemo before [keyword] files are set up | |
30 | as it would succeed without uisetup otherwise |
|
30 | as it would succeed without uisetup otherwise | |
31 |
|
31 | |||
32 | $ hg --quiet kwdemo |
|
32 | $ hg --quiet kwdemo | |
33 | [extensions] |
|
33 | [extensions] | |
34 | keyword = |
|
34 | keyword = | |
35 | [keyword] |
|
35 | [keyword] | |
36 | demo.txt = |
|
36 | demo.txt = | |
37 | [keywordset] |
|
37 | [keywordset] | |
38 | svn = False |
|
38 | svn = False | |
39 | [keywordmaps] |
|
39 | [keywordmaps] | |
40 | Author = {author|user} |
|
40 | Author = {author|user} | |
41 | Date = {date|utcdate} |
|
41 | Date = {date|utcdate} | |
42 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
|
42 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} | |
43 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
|
43 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} | |
44 | RCSFile = {file|basename},v |
|
44 | RCSFile = {file|basename},v | |
45 | RCSfile = {file|basename},v |
|
45 | RCSfile = {file|basename},v | |
46 | Revision = {node|short} |
|
46 | Revision = {node|short} | |
47 | Source = {root}/{file},v |
|
47 | Source = {root}/{file},v | |
48 | $Author: test $ |
|
48 | $Author: test $ | |
49 | $Date: ????/??/?? ??:??:?? $ (glob) |
|
49 | $Date: ????/??/?? ??:??:?? $ (glob) | |
50 | $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
|
50 | $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) | |
51 | $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
|
51 | $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) | |
52 | $RCSFile: demo.txt,v $ |
|
52 | $RCSFile: demo.txt,v $ | |
53 | $RCSfile: demo.txt,v $ |
|
53 | $RCSfile: demo.txt,v $ | |
54 | $Revision: ???????????? $ (glob) |
|
54 | $Revision: ???????????? $ (glob) | |
55 | $Source: */demo.txt,v $ (glob) |
|
55 | $Source: */demo.txt,v $ (glob) | |
56 |
|
56 | |||
57 | $ hg --quiet kwdemo "Branch = {branches}" |
|
57 | $ hg --quiet kwdemo "Branch = {branches}" | |
58 | [extensions] |
|
58 | [extensions] | |
59 | keyword = |
|
59 | keyword = | |
60 | [keyword] |
|
60 | [keyword] | |
61 | demo.txt = |
|
61 | demo.txt = | |
62 | [keywordset] |
|
62 | [keywordset] | |
63 | svn = False |
|
63 | svn = False | |
64 | [keywordmaps] |
|
64 | [keywordmaps] | |
65 | Branch = {branches} |
|
65 | Branch = {branches} | |
66 | $Branch: demobranch $ |
|
66 | $Branch: demobranch $ | |
67 |
|
67 | |||
68 | (test template filter svnisodate and svnutcdate) |
|
68 | (test template filter svnisodate and svnutcdate) | |
69 |
|
69 | |||
70 | $ hg --quiet kwdemo --config keywordset.svn=True |
|
70 | $ hg --quiet kwdemo --config keywordset.svn=True | |
71 | [extensions] |
|
71 | [extensions] | |
72 | keyword = |
|
72 | keyword = | |
73 | [keyword] |
|
73 | [keyword] | |
74 | demo.txt = |
|
74 | demo.txt = | |
75 | [keywordset] |
|
75 | [keywordset] | |
76 | svn = True |
|
76 | svn = True | |
77 | [keywordmaps] |
|
77 | [keywordmaps] | |
78 | Author = {author|user} |
|
78 | Author = {author|user} | |
79 | Date = {date|svnisodate} |
|
79 | Date = {date|svnisodate} | |
80 | Id = {file|basename},v {node|short} {date|svnutcdate} {author|user} |
|
80 | Id = {file|basename},v {node|short} {date|svnutcdate} {author|user} | |
81 | LastChangedBy = {author|user} |
|
81 | LastChangedBy = {author|user} | |
82 | LastChangedDate = {date|svnisodate} |
|
82 | LastChangedDate = {date|svnisodate} | |
83 | LastChangedRevision = {node|short} |
|
83 | LastChangedRevision = {node|short} | |
84 | Revision = {node|short} |
|
84 | Revision = {node|short} | |
85 | $Author: test $ |
|
85 | $Author: test $ | |
86 | $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) |
|
86 | $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) | |
87 | $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob) |
|
87 | $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob) | |
88 | $LastChangedBy: test $ |
|
88 | $LastChangedBy: test $ | |
89 | $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) |
|
89 | $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) | |
90 | $LastChangedRevision: ???????????? $ (glob) |
|
90 | $LastChangedRevision: ???????????? $ (glob) | |
91 | $Revision: ???????????? $ (glob) |
|
91 | $Revision: ???????????? $ (glob) | |
92 |
|
92 | |||
93 | $ cat <<EOF >> $HGRCPATH |
|
93 | $ cat <<EOF >> $HGRCPATH | |
94 | > [keyword] |
|
94 | > [keyword] | |
95 | > ** = |
|
95 | > ** = | |
96 | > b = ignore |
|
96 | > b = ignore | |
97 | > i = ignore |
|
97 | > i = ignore | |
98 | > [hooks] |
|
98 | > [hooks] | |
99 | > EOF |
|
99 | > EOF | |
100 | $ cp $HGRCPATH $HGRCPATH.nohooks |
|
100 | $ cp $HGRCPATH $HGRCPATH.nohooks | |
101 | > cat <<EOF >> $HGRCPATH |
|
101 | > cat <<EOF >> $HGRCPATH | |
102 | > commit= |
|
102 | > commit= | |
103 | > commit.test=cp a hooktest |
|
103 | > commit.test=cp a hooktest | |
104 | > EOF |
|
104 | > EOF | |
105 |
|
105 | |||
106 | $ hg init Test-bndl |
|
106 | $ hg init Test-bndl | |
107 | $ cd Test-bndl |
|
107 | $ cd Test-bndl | |
108 |
|
108 | |||
109 | kwshrink should exit silently in empty/invalid repo |
|
109 | kwshrink should exit silently in empty/invalid repo | |
110 |
|
110 | |||
111 | $ hg kwshrink |
|
111 | $ hg kwshrink | |
112 |
|
112 | |||
113 | Symlinks cannot be created on Windows. |
|
113 | Symlinks cannot be created on Windows. | |
114 | A bundle to test this was made with: |
|
114 | A bundle to test this was made with: | |
115 | hg init t |
|
115 | hg init t | |
116 | cd t |
|
116 | cd t | |
117 | echo a > a |
|
117 | echo a > a | |
118 | ln -s a sym |
|
118 | ln -s a sym | |
119 | hg add sym |
|
119 | hg add sym | |
120 | hg ci -m addsym -u mercurial |
|
120 | hg ci -m addsym -u mercurial | |
121 | hg bundle --base null ../test-keyword.hg |
|
121 | hg bundle --base null ../test-keyword.hg | |
122 |
|
122 | |||
123 | $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg |
|
123 | $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg | |
124 | adding changesets |
|
124 | adding changesets | |
125 | adding manifests |
|
125 | adding manifests | |
126 | adding file changes |
|
126 | adding file changes | |
127 | added 1 changesets with 1 changes to 1 files |
|
127 | added 1 changesets with 1 changes to 1 files | |
128 | new changesets a2392c293916 (1 drafts) |
|
128 | new changesets a2392c293916 (1 drafts) | |
129 | (run 'hg update' to get a working copy) |
|
129 | (run 'hg update' to get a working copy) | |
130 | $ hg up a2392c293916 |
|
130 | $ hg up a2392c293916 | |
131 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
131 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
132 |
|
132 | |||
133 | $ echo 'expand $Id$' > a |
|
133 | $ echo 'expand $Id$' > a | |
134 | $ echo 'do not process $Id:' >> a |
|
134 | $ echo 'do not process $Id:' >> a | |
135 | $ echo 'xxx $' >> a |
|
135 | $ echo 'xxx $' >> a | |
136 | $ echo 'ignore $Id$' > b |
|
136 | $ echo 'ignore $Id$' > b | |
137 |
|
137 | |||
138 | Output files as they were created |
|
138 | Output files as they were created | |
139 |
|
139 | |||
140 | $ cat a b |
|
140 | $ cat a b | |
141 | expand $Id$ |
|
141 | expand $Id$ | |
142 | do not process $Id: |
|
142 | do not process $Id: | |
143 | xxx $ |
|
143 | xxx $ | |
144 | ignore $Id$ |
|
144 | ignore $Id$ | |
145 |
|
145 | |||
146 | no kwfiles |
|
146 | no kwfiles | |
147 |
|
147 | |||
148 | $ hg kwfiles |
|
148 | $ hg kwfiles | |
149 |
|
149 | |||
150 | untracked candidates |
|
150 | untracked candidates | |
151 |
|
151 | |||
152 | $ hg -v kwfiles --unknown |
|
152 | $ hg -v kwfiles --unknown | |
153 | k a |
|
153 | k a | |
154 |
|
154 | |||
155 | Add files and check status |
|
155 | Add files and check status | |
156 |
|
156 | |||
157 | $ hg addremove |
|
157 | $ hg addremove | |
158 | adding a |
|
158 | adding a | |
159 | adding b |
|
159 | adding b | |
160 | $ hg status |
|
160 | $ hg status | |
161 | A a |
|
161 | A a | |
162 | A b |
|
162 | A b | |
163 |
|
163 | |||
164 |
|
164 | |||
165 | Default keyword expansion including commit hook |
|
165 | Default keyword expansion including commit hook | |
166 | Interrupted commit should not change state or run commit hook |
|
166 | Interrupted commit should not change state or run commit hook | |
167 |
|
167 | |||
168 | $ hg --debug commit |
|
168 | $ hg --debug commit | |
169 | abort: empty commit message |
|
169 | abort: empty commit message | |
170 | [255] |
|
170 | [255] | |
171 | $ hg status |
|
171 | $ hg status | |
172 | A a |
|
172 | A a | |
173 | A b |
|
173 | A b | |
174 |
|
174 | |||
175 | Commit with several checks |
|
175 | Commit with several checks | |
176 |
|
176 | |||
177 | $ hg --debug commit -mabsym -u 'User Name <user@example.com>' |
|
177 | $ hg --debug commit -mabsym -u 'User Name <user@example.com>' | |
178 | committing files: |
|
178 | committing files: | |
179 | a |
|
179 | a | |
180 | b |
|
180 | b | |
181 | committing manifest |
|
181 | committing manifest | |
182 | committing changelog |
|
182 | committing changelog | |
183 | overwriting a expanding keywords |
|
183 | overwriting a expanding keywords | |
184 | updating the branch cache |
|
184 | updating the branch cache | |
185 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
185 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 | |
186 | running hook commit.test: cp a hooktest |
|
186 | running hook commit.test: cp a hooktest | |
187 | $ hg status |
|
187 | $ hg status | |
188 | ? hooktest |
|
188 | ? hooktest | |
189 | $ hg debugrebuildstate |
|
189 | $ hg debugrebuildstate | |
190 | $ hg --quiet identify |
|
190 | $ hg --quiet identify | |
191 | ef63ca68695b |
|
191 | ef63ca68695b | |
192 |
|
192 | |||
193 | cat files in working directory with keywords expanded |
|
193 | cat files in working directory with keywords expanded | |
194 |
|
194 | |||
195 | $ cat a b |
|
195 | $ cat a b | |
196 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
196 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
197 | do not process $Id: |
|
197 | do not process $Id: | |
198 | xxx $ |
|
198 | xxx $ | |
199 | ignore $Id$ |
|
199 | ignore $Id$ | |
200 |
|
200 | |||
201 | hg cat files and symlink, no expansion |
|
201 | hg cat files and symlink, no expansion | |
202 |
|
202 | |||
203 | $ hg cat sym a b && echo |
|
203 | $ hg cat sym a b && echo | |
204 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
204 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
205 | do not process $Id: |
|
205 | do not process $Id: | |
206 | xxx $ |
|
206 | xxx $ | |
207 | ignore $Id$ |
|
207 | ignore $Id$ | |
208 | a |
|
208 | a | |
209 |
|
209 | |||
210 | $ diff a hooktest |
|
210 | $ diff a hooktest | |
211 |
|
211 | |||
212 | $ cp $HGRCPATH.nohooks $HGRCPATH |
|
212 | $ cp $HGRCPATH.nohooks $HGRCPATH | |
213 | $ rm hooktest |
|
213 | $ rm hooktest | |
214 |
|
214 | |||
215 | hg status of kw-ignored binary file starting with '\1\n' |
|
215 | hg status of kw-ignored binary file starting with '\1\n' | |
216 |
|
216 | |||
217 | >>> open("i", "wb").write("\1\nfoo") and None |
|
217 | >>> open("i", "wb").write("\1\nfoo") and None | |
218 | $ hg -q commit -Am metasep i |
|
218 | $ hg -q commit -Am metasep i | |
219 | $ hg status |
|
219 | $ hg status | |
220 | >>> open("i", "wb").write("\1\nbar") |
|
220 | >>> open("i", "wb").write("\1\nbar") and None | |
221 | $ hg status |
|
221 | $ hg status | |
222 | M i |
|
222 | M i | |
223 | $ hg -q commit -m "modify metasep" i |
|
223 | $ hg -q commit -m "modify metasep" i | |
224 | $ hg status --rev 2:3 |
|
224 | $ hg status --rev 2:3 | |
225 | M i |
|
225 | M i | |
226 | $ touch empty |
|
226 | $ touch empty | |
227 | $ hg -q commit -A -m "another file" |
|
227 | $ hg -q commit -A -m "another file" | |
228 | $ hg status -A --rev 3:4 i |
|
228 | $ hg status -A --rev 3:4 i | |
229 | C i |
|
229 | C i | |
230 |
|
230 | |||
231 | $ hg -q strip --no-backup 2 |
|
231 | $ hg -q strip --no-backup 2 | |
232 |
|
232 | |||
233 | Test hook execution |
|
233 | Test hook execution | |
234 |
|
234 | |||
235 | bundle |
|
235 | bundle | |
236 |
|
236 | |||
237 | $ hg bundle --base null ../kw.hg |
|
237 | $ hg bundle --base null ../kw.hg | |
238 | 2 changesets found |
|
238 | 2 changesets found | |
239 | $ cd .. |
|
239 | $ cd .. | |
240 | $ hg init Test |
|
240 | $ hg init Test | |
241 | $ cd Test |
|
241 | $ cd Test | |
242 |
|
242 | |||
243 | Notify on pull to check whether keywords stay as is in email |
|
243 | Notify on pull to check whether keywords stay as is in email | |
244 | ie. if patch.diff wrapper acts as it should |
|
244 | ie. if patch.diff wrapper acts as it should | |
245 |
|
245 | |||
246 | $ cat <<EOF >> $HGRCPATH |
|
246 | $ cat <<EOF >> $HGRCPATH | |
247 | > [hooks] |
|
247 | > [hooks] | |
248 | > incoming.notify = python:hgext.notify.hook |
|
248 | > incoming.notify = python:hgext.notify.hook | |
249 | > [notify] |
|
249 | > [notify] | |
250 | > sources = pull |
|
250 | > sources = pull | |
251 | > diffstat = False |
|
251 | > diffstat = False | |
252 | > maxsubject = 15 |
|
252 | > maxsubject = 15 | |
253 | > [reposubs] |
|
253 | > [reposubs] | |
254 | > * = Test |
|
254 | > * = Test | |
255 | > EOF |
|
255 | > EOF | |
256 |
|
256 | |||
257 | Pull from bundle and trigger notify |
|
257 | Pull from bundle and trigger notify | |
258 |
|
258 | |||
259 | $ hg pull -u ../kw.hg |
|
259 | $ hg pull -u ../kw.hg | |
260 | pulling from ../kw.hg |
|
260 | pulling from ../kw.hg | |
261 | requesting all changes |
|
261 | requesting all changes | |
262 | adding changesets |
|
262 | adding changesets | |
263 | adding manifests |
|
263 | adding manifests | |
264 | adding file changes |
|
264 | adding file changes | |
265 | added 2 changesets with 3 changes to 3 files |
|
265 | added 2 changesets with 3 changes to 3 files | |
266 | new changesets a2392c293916:ef63ca68695b (2 drafts) |
|
266 | new changesets a2392c293916:ef63ca68695b (2 drafts) | |
267 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
267 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
268 | MIME-Version: 1.0 |
|
268 | MIME-Version: 1.0 | |
269 | Content-Type: text/plain; charset="us-ascii" |
|
269 | Content-Type: text/plain; charset="us-ascii" | |
270 | Content-Transfer-Encoding: 7bit |
|
270 | Content-Transfer-Encoding: 7bit | |
271 | Date: * (glob) |
|
271 | Date: * (glob) | |
272 | Subject: changeset in... |
|
272 | Subject: changeset in... | |
273 | From: mercurial |
|
273 | From: mercurial | |
274 | X-Hg-Notification: changeset a2392c293916 |
|
274 | X-Hg-Notification: changeset a2392c293916 | |
275 | Message-Id: <hg.a2392c293916*> (glob) |
|
275 | Message-Id: <hg.a2392c293916*> (glob) | |
276 | To: Test |
|
276 | To: Test | |
277 |
|
277 | |||
278 | changeset a2392c293916 in $TESTTMP/Test |
|
278 | changeset a2392c293916 in $TESTTMP/Test | |
279 | details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 |
|
279 | details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 | |
280 | description: |
|
280 | description: | |
281 | addsym |
|
281 | addsym | |
282 |
|
282 | |||
283 | diffs (6 lines): |
|
283 | diffs (6 lines): | |
284 |
|
284 | |||
285 | diff -r 000000000000 -r a2392c293916 sym |
|
285 | diff -r 000000000000 -r a2392c293916 sym | |
286 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
286 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
287 | +++ b/sym Sat Feb 09 20:25:47 2008 +0100 |
|
287 | +++ b/sym Sat Feb 09 20:25:47 2008 +0100 | |
288 | @@ -0,0 +1,1 @@ |
|
288 | @@ -0,0 +1,1 @@ | |
289 | +a |
|
289 | +a | |
290 | \ No newline at end of file |
|
290 | \ No newline at end of file | |
291 | MIME-Version: 1.0 |
|
291 | MIME-Version: 1.0 | |
292 | Content-Type: text/plain; charset="us-ascii" |
|
292 | Content-Type: text/plain; charset="us-ascii" | |
293 | Content-Transfer-Encoding: 7bit |
|
293 | Content-Transfer-Encoding: 7bit | |
294 | Date:* (glob) |
|
294 | Date:* (glob) | |
295 | Subject: changeset in... |
|
295 | Subject: changeset in... | |
296 | From: User Name <user@example.com> |
|
296 | From: User Name <user@example.com> | |
297 | X-Hg-Notification: changeset ef63ca68695b |
|
297 | X-Hg-Notification: changeset ef63ca68695b | |
298 | Message-Id: <hg.ef63ca68695b*> (glob) |
|
298 | Message-Id: <hg.ef63ca68695b*> (glob) | |
299 | To: Test |
|
299 | To: Test | |
300 |
|
300 | |||
301 | changeset ef63ca68695b in $TESTTMP/Test |
|
301 | changeset ef63ca68695b in $TESTTMP/Test | |
302 | details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b |
|
302 | details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b | |
303 | description: |
|
303 | description: | |
304 | absym |
|
304 | absym | |
305 |
|
305 | |||
306 | diffs (12 lines): |
|
306 | diffs (12 lines): | |
307 |
|
307 | |||
308 | diff -r a2392c293916 -r ef63ca68695b a |
|
308 | diff -r a2392c293916 -r ef63ca68695b a | |
309 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
309 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
310 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
310 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
311 | @@ -0,0 +1,3 @@ |
|
311 | @@ -0,0 +1,3 @@ | |
312 | +expand $Id$ |
|
312 | +expand $Id$ | |
313 | +do not process $Id: |
|
313 | +do not process $Id: | |
314 | +xxx $ |
|
314 | +xxx $ | |
315 | diff -r a2392c293916 -r ef63ca68695b b |
|
315 | diff -r a2392c293916 -r ef63ca68695b b | |
316 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
316 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
317 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
317 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 | |
318 | @@ -0,0 +1,1 @@ |
|
318 | @@ -0,0 +1,1 @@ | |
319 | +ignore $Id$ |
|
319 | +ignore $Id$ | |
320 |
|
320 | |||
321 | $ cp $HGRCPATH.nohooks $HGRCPATH |
|
321 | $ cp $HGRCPATH.nohooks $HGRCPATH | |
322 |
|
322 | |||
323 | Touch files and check with status |
|
323 | Touch files and check with status | |
324 |
|
324 | |||
325 | $ touch a b |
|
325 | $ touch a b | |
326 | $ hg status |
|
326 | $ hg status | |
327 |
|
327 | |||
328 | Update and expand |
|
328 | Update and expand | |
329 |
|
329 | |||
330 | $ rm sym a b |
|
330 | $ rm sym a b | |
331 | $ hg update -C |
|
331 | $ hg update -C | |
332 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
332 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
333 | $ cat a b |
|
333 | $ cat a b | |
334 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
334 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
335 | do not process $Id: |
|
335 | do not process $Id: | |
336 | xxx $ |
|
336 | xxx $ | |
337 | ignore $Id$ |
|
337 | ignore $Id$ | |
338 |
|
338 | |||
339 | Check whether expansion is filewise and file mode is preserved |
|
339 | Check whether expansion is filewise and file mode is preserved | |
340 |
|
340 | |||
341 | $ echo '$Id$' > c |
|
341 | $ echo '$Id$' > c | |
342 | $ echo 'tests for different changenodes' >> c |
|
342 | $ echo 'tests for different changenodes' >> c | |
343 | #if unix-permissions |
|
343 | #if unix-permissions | |
344 | $ chmod 600 c |
|
344 | $ chmod 600 c | |
345 | $ ls -l c | cut -b 1-10 |
|
345 | $ ls -l c | cut -b 1-10 | |
346 | -rw------- |
|
346 | -rw------- | |
347 | #endif |
|
347 | #endif | |
348 |
|
348 | |||
349 | commit file c |
|
349 | commit file c | |
350 |
|
350 | |||
351 | $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>' |
|
351 | $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>' | |
352 | adding c |
|
352 | adding c | |
353 | #if unix-permissions |
|
353 | #if unix-permissions | |
354 | $ ls -l c | cut -b 1-10 |
|
354 | $ ls -l c | cut -b 1-10 | |
355 | -rw------- |
|
355 | -rw------- | |
356 | #endif |
|
356 | #endif | |
357 |
|
357 | |||
358 | force expansion |
|
358 | force expansion | |
359 |
|
359 | |||
360 | $ hg -v kwexpand |
|
360 | $ hg -v kwexpand | |
361 | overwriting a expanding keywords |
|
361 | overwriting a expanding keywords | |
362 | overwriting c expanding keywords |
|
362 | overwriting c expanding keywords | |
363 |
|
363 | |||
364 | compare changenodes in a and c |
|
364 | compare changenodes in a and c | |
365 |
|
365 | |||
366 | $ cat a c |
|
366 | $ cat a c | |
367 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
367 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
368 | do not process $Id: |
|
368 | do not process $Id: | |
369 | xxx $ |
|
369 | xxx $ | |
370 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
370 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
371 | tests for different changenodes |
|
371 | tests for different changenodes | |
372 |
|
372 | |||
373 | record |
|
373 | record | |
374 |
|
374 | |||
375 | $ echo '$Id$' > r |
|
375 | $ echo '$Id$' > r | |
376 | $ hg add r |
|
376 | $ hg add r | |
377 |
|
377 | |||
378 | record chunk |
|
378 | record chunk | |
379 |
|
379 | |||
380 | >>> lines = open('a', 'rb').readlines() |
|
380 | >>> lines = open('a', 'rb').readlines() | |
381 | >>> lines.insert(1, 'foo\n') |
|
381 | >>> lines.insert(1, 'foo\n') | |
382 | >>> lines.append('bar\n') |
|
382 | >>> lines.append('bar\n') | |
383 | >>> open('a', 'wb').writelines(lines) |
|
383 | >>> open('a', 'wb').writelines(lines) | |
384 | $ hg record -d '10 1' -m rectest a<<EOF |
|
384 | $ hg record -d '10 1' -m rectest a<<EOF | |
385 | > y |
|
385 | > y | |
386 | > y |
|
386 | > y | |
387 | > n |
|
387 | > n | |
388 | > EOF |
|
388 | > EOF | |
389 | diff --git a/a b/a |
|
389 | diff --git a/a b/a | |
390 | 2 hunks, 2 lines changed |
|
390 | 2 hunks, 2 lines changed | |
391 | examine changes to 'a'? [Ynesfdaq?] y |
|
391 | examine changes to 'a'? [Ynesfdaq?] y | |
392 |
|
392 | |||
393 | @@ -1,3 +1,4 @@ |
|
393 | @@ -1,3 +1,4 @@ | |
394 | expand $Id$ |
|
394 | expand $Id$ | |
395 | +foo |
|
395 | +foo | |
396 | do not process $Id: |
|
396 | do not process $Id: | |
397 | xxx $ |
|
397 | xxx $ | |
398 | record change 1/2 to 'a'? [Ynesfdaq?] y |
|
398 | record change 1/2 to 'a'? [Ynesfdaq?] y | |
399 |
|
399 | |||
400 | @@ -2,2 +3,3 @@ |
|
400 | @@ -2,2 +3,3 @@ | |
401 | do not process $Id: |
|
401 | do not process $Id: | |
402 | xxx $ |
|
402 | xxx $ | |
403 | +bar |
|
403 | +bar | |
404 | record change 2/2 to 'a'? [Ynesfdaq?] n |
|
404 | record change 2/2 to 'a'? [Ynesfdaq?] n | |
405 |
|
405 | |||
406 |
|
406 | |||
407 | $ hg identify |
|
407 | $ hg identify | |
408 | 5f5eb23505c3+ tip |
|
408 | 5f5eb23505c3+ tip | |
409 | $ hg status |
|
409 | $ hg status | |
410 | M a |
|
410 | M a | |
411 | A r |
|
411 | A r | |
412 |
|
412 | |||
413 | Cat modified file a |
|
413 | Cat modified file a | |
414 |
|
414 | |||
415 | $ cat a |
|
415 | $ cat a | |
416 | expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $ |
|
416 | expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $ | |
417 | foo |
|
417 | foo | |
418 | do not process $Id: |
|
418 | do not process $Id: | |
419 | xxx $ |
|
419 | xxx $ | |
420 | bar |
|
420 | bar | |
421 |
|
421 | |||
422 | Diff remaining chunk |
|
422 | Diff remaining chunk | |
423 |
|
423 | |||
424 | $ hg diff a |
|
424 | $ hg diff a | |
425 | diff -r 5f5eb23505c3 a |
|
425 | diff -r 5f5eb23505c3 a | |
426 | --- a/a Thu Jan 01 00:00:09 1970 -0000 |
|
426 | --- a/a Thu Jan 01 00:00:09 1970 -0000 | |
427 | +++ b/a * (glob) |
|
427 | +++ b/a * (glob) | |
428 | @@ -2,3 +2,4 @@ |
|
428 | @@ -2,3 +2,4 @@ | |
429 | foo |
|
429 | foo | |
430 | do not process $Id: |
|
430 | do not process $Id: | |
431 | xxx $ |
|
431 | xxx $ | |
432 | +bar |
|
432 | +bar | |
433 |
|
433 | |||
434 | $ hg rollback |
|
434 | $ hg rollback | |
435 | repository tip rolled back to revision 2 (undo commit) |
|
435 | repository tip rolled back to revision 2 (undo commit) | |
436 | working directory now based on revision 2 |
|
436 | working directory now based on revision 2 | |
437 |
|
437 | |||
438 | Record all chunks in file a |
|
438 | Record all chunks in file a | |
439 |
|
439 | |||
440 | $ echo foo > msg |
|
440 | $ echo foo > msg | |
441 |
|
441 | |||
442 | - do not use "hg record -m" here! |
|
442 | - do not use "hg record -m" here! | |
443 |
|
443 | |||
444 | $ hg record -l msg -d '11 1' a<<EOF |
|
444 | $ hg record -l msg -d '11 1' a<<EOF | |
445 | > y |
|
445 | > y | |
446 | > y |
|
446 | > y | |
447 | > y |
|
447 | > y | |
448 | > EOF |
|
448 | > EOF | |
449 | diff --git a/a b/a |
|
449 | diff --git a/a b/a | |
450 | 2 hunks, 2 lines changed |
|
450 | 2 hunks, 2 lines changed | |
451 | examine changes to 'a'? [Ynesfdaq?] y |
|
451 | examine changes to 'a'? [Ynesfdaq?] y | |
452 |
|
452 | |||
453 | @@ -1,3 +1,4 @@ |
|
453 | @@ -1,3 +1,4 @@ | |
454 | expand $Id$ |
|
454 | expand $Id$ | |
455 | +foo |
|
455 | +foo | |
456 | do not process $Id: |
|
456 | do not process $Id: | |
457 | xxx $ |
|
457 | xxx $ | |
458 | record change 1/2 to 'a'? [Ynesfdaq?] y |
|
458 | record change 1/2 to 'a'? [Ynesfdaq?] y | |
459 |
|
459 | |||
460 | @@ -2,2 +3,3 @@ |
|
460 | @@ -2,2 +3,3 @@ | |
461 | do not process $Id: |
|
461 | do not process $Id: | |
462 | xxx $ |
|
462 | xxx $ | |
463 | +bar |
|
463 | +bar | |
464 | record change 2/2 to 'a'? [Ynesfdaq?] y |
|
464 | record change 2/2 to 'a'? [Ynesfdaq?] y | |
465 |
|
465 | |||
466 |
|
466 | |||
467 | File a should be clean |
|
467 | File a should be clean | |
468 |
|
468 | |||
469 | $ hg status -A a |
|
469 | $ hg status -A a | |
470 | C a |
|
470 | C a | |
471 |
|
471 | |||
472 | rollback and revert expansion |
|
472 | rollback and revert expansion | |
473 |
|
473 | |||
474 | $ cat a |
|
474 | $ cat a | |
475 | expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $ |
|
475 | expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $ | |
476 | foo |
|
476 | foo | |
477 | do not process $Id: |
|
477 | do not process $Id: | |
478 | xxx $ |
|
478 | xxx $ | |
479 | bar |
|
479 | bar | |
480 | $ hg --verbose rollback |
|
480 | $ hg --verbose rollback | |
481 | repository tip rolled back to revision 2 (undo commit) |
|
481 | repository tip rolled back to revision 2 (undo commit) | |
482 | working directory now based on revision 2 |
|
482 | working directory now based on revision 2 | |
483 | overwriting a expanding keywords |
|
483 | overwriting a expanding keywords | |
484 | $ hg status a |
|
484 | $ hg status a | |
485 | M a |
|
485 | M a | |
486 | $ cat a |
|
486 | $ cat a | |
487 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
487 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
488 | foo |
|
488 | foo | |
489 | do not process $Id: |
|
489 | do not process $Id: | |
490 | xxx $ |
|
490 | xxx $ | |
491 | bar |
|
491 | bar | |
492 | $ echo '$Id$' > y |
|
492 | $ echo '$Id$' > y | |
493 | $ echo '$Id$' > z |
|
493 | $ echo '$Id$' > z | |
494 | $ hg add y |
|
494 | $ hg add y | |
495 | $ hg commit -Am "rollback only" z |
|
495 | $ hg commit -Am "rollback only" z | |
496 | $ cat z |
|
496 | $ cat z | |
497 | $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ |
|
497 | $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ | |
498 | $ hg --verbose rollback |
|
498 | $ hg --verbose rollback | |
499 | repository tip rolled back to revision 2 (undo commit) |
|
499 | repository tip rolled back to revision 2 (undo commit) | |
500 | working directory now based on revision 2 |
|
500 | working directory now based on revision 2 | |
501 | overwriting z shrinking keywords |
|
501 | overwriting z shrinking keywords | |
502 |
|
502 | |||
503 | Only z should be overwritten |
|
503 | Only z should be overwritten | |
504 |
|
504 | |||
505 | $ hg status a y z |
|
505 | $ hg status a y z | |
506 | M a |
|
506 | M a | |
507 | A y |
|
507 | A y | |
508 | A z |
|
508 | A z | |
509 | $ cat z |
|
509 | $ cat z | |
510 | $Id$ |
|
510 | $Id$ | |
511 | $ hg forget y z |
|
511 | $ hg forget y z | |
512 | $ rm y z |
|
512 | $ rm y z | |
513 |
|
513 | |||
514 | record added file alone |
|
514 | record added file alone | |
515 |
|
515 | |||
516 | $ hg -v record -l msg -d '12 2' r<<EOF |
|
516 | $ hg -v record -l msg -d '12 2' r<<EOF | |
517 | > y |
|
517 | > y | |
518 | > y |
|
518 | > y | |
519 | > EOF |
|
519 | > EOF | |
520 | diff --git a/r b/r |
|
520 | diff --git a/r b/r | |
521 | new file mode 100644 |
|
521 | new file mode 100644 | |
522 | examine changes to 'r'? [Ynesfdaq?] y |
|
522 | examine changes to 'r'? [Ynesfdaq?] y | |
523 |
|
523 | |||
524 | @@ -0,0 +1,1 @@ |
|
524 | @@ -0,0 +1,1 @@ | |
525 | +$Id$ |
|
525 | +$Id$ | |
526 | record this change to 'r'? [Ynesfdaq?] y |
|
526 | record this change to 'r'? [Ynesfdaq?] y | |
527 |
|
527 | |||
528 | resolving manifests |
|
528 | resolving manifests | |
529 | patching file r |
|
529 | patching file r | |
530 | committing files: |
|
530 | committing files: | |
531 | r |
|
531 | r | |
532 | committing manifest |
|
532 | committing manifest | |
533 | committing changelog |
|
533 | committing changelog | |
534 | committed changeset 3:82a2f715724d |
|
534 | committed changeset 3:82a2f715724d | |
535 | overwriting r expanding keywords |
|
535 | overwriting r expanding keywords | |
536 | $ hg status r |
|
536 | $ hg status r | |
537 | $ hg --verbose rollback |
|
537 | $ hg --verbose rollback | |
538 | repository tip rolled back to revision 2 (undo commit) |
|
538 | repository tip rolled back to revision 2 (undo commit) | |
539 | working directory now based on revision 2 |
|
539 | working directory now based on revision 2 | |
540 | overwriting r shrinking keywords |
|
540 | overwriting r shrinking keywords | |
541 | $ hg forget r |
|
541 | $ hg forget r | |
542 | $ rm msg r |
|
542 | $ rm msg r | |
543 | $ hg update -C |
|
543 | $ hg update -C | |
544 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
544 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
545 |
|
545 | |||
546 | record added keyword ignored file |
|
546 | record added keyword ignored file | |
547 |
|
547 | |||
548 | $ echo '$Id$' > i |
|
548 | $ echo '$Id$' > i | |
549 | $ hg add i |
|
549 | $ hg add i | |
550 | $ hg --verbose record -d '13 1' -m recignored<<EOF |
|
550 | $ hg --verbose record -d '13 1' -m recignored<<EOF | |
551 | > y |
|
551 | > y | |
552 | > y |
|
552 | > y | |
553 | > EOF |
|
553 | > EOF | |
554 | diff --git a/i b/i |
|
554 | diff --git a/i b/i | |
555 | new file mode 100644 |
|
555 | new file mode 100644 | |
556 | examine changes to 'i'? [Ynesfdaq?] y |
|
556 | examine changes to 'i'? [Ynesfdaq?] y | |
557 |
|
557 | |||
558 | @@ -0,0 +1,1 @@ |
|
558 | @@ -0,0 +1,1 @@ | |
559 | +$Id$ |
|
559 | +$Id$ | |
560 | record this change to 'i'? [Ynesfdaq?] y |
|
560 | record this change to 'i'? [Ynesfdaq?] y | |
561 |
|
561 | |||
562 | resolving manifests |
|
562 | resolving manifests | |
563 | patching file i |
|
563 | patching file i | |
564 | committing files: |
|
564 | committing files: | |
565 | i |
|
565 | i | |
566 | committing manifest |
|
566 | committing manifest | |
567 | committing changelog |
|
567 | committing changelog | |
568 | committed changeset 3:9f40ceb5a072 |
|
568 | committed changeset 3:9f40ceb5a072 | |
569 | $ cat i |
|
569 | $ cat i | |
570 | $Id$ |
|
570 | $Id$ | |
571 | $ hg -q rollback |
|
571 | $ hg -q rollback | |
572 | $ hg forget i |
|
572 | $ hg forget i | |
573 | $ rm i |
|
573 | $ rm i | |
574 |
|
574 | |||
575 | amend |
|
575 | amend | |
576 |
|
576 | |||
577 | $ echo amend >> a |
|
577 | $ echo amend >> a | |
578 | $ echo amend >> b |
|
578 | $ echo amend >> b | |
579 | $ hg -q commit -d '14 1' -m 'prepare amend' |
|
579 | $ hg -q commit -d '14 1' -m 'prepare amend' | |
580 |
|
580 | |||
581 | $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords |
|
581 | $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords | |
582 | overwriting a expanding keywords |
|
582 | overwriting a expanding keywords | |
583 | $ hg -q id |
|
583 | $ hg -q id | |
584 | 67d8c481a6be |
|
584 | 67d8c481a6be | |
585 | $ head -1 a |
|
585 | $ head -1 a | |
586 | expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $ |
|
586 | expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $ | |
587 |
|
587 | |||
588 | $ hg -q strip --no-backup tip |
|
588 | $ hg -q strip --no-backup tip | |
589 |
|
589 | |||
590 | Test patch queue repo |
|
590 | Test patch queue repo | |
591 |
|
591 | |||
592 | $ hg init --mq |
|
592 | $ hg init --mq | |
593 | $ hg qimport -r tip -n mqtest.diff |
|
593 | $ hg qimport -r tip -n mqtest.diff | |
594 | $ hg commit --mq -m mqtest |
|
594 | $ hg commit --mq -m mqtest | |
595 |
|
595 | |||
596 | Keywords should not be expanded in patch |
|
596 | Keywords should not be expanded in patch | |
597 |
|
597 | |||
598 | $ cat .hg/patches/mqtest.diff |
|
598 | $ cat .hg/patches/mqtest.diff | |
599 | # HG changeset patch |
|
599 | # HG changeset patch | |
600 | # User User Name <user@example.com> |
|
600 | # User User Name <user@example.com> | |
601 | # Date 1 0 |
|
601 | # Date 1 0 | |
602 | # Thu Jan 01 00:00:01 1970 +0000 |
|
602 | # Thu Jan 01 00:00:01 1970 +0000 | |
603 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad |
|
603 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad | |
604 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
604 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 | |
605 | cndiff |
|
605 | cndiff | |
606 |
|
606 | |||
607 | diff -r ef63ca68695b -r 40a904bbbe4c c |
|
607 | diff -r ef63ca68695b -r 40a904bbbe4c c | |
608 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
608 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
609 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 |
|
609 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 | |
610 | @@ -0,0 +1,2 @@ |
|
610 | @@ -0,0 +1,2 @@ | |
611 | +$Id$ |
|
611 | +$Id$ | |
612 | +tests for different changenodes |
|
612 | +tests for different changenodes | |
613 |
|
613 | |||
614 | $ hg qpop |
|
614 | $ hg qpop | |
615 | popping mqtest.diff |
|
615 | popping mqtest.diff | |
616 | patch queue now empty |
|
616 | patch queue now empty | |
617 |
|
617 | |||
618 | qgoto, implying qpush, should expand |
|
618 | qgoto, implying qpush, should expand | |
619 |
|
619 | |||
620 | $ hg qgoto mqtest.diff |
|
620 | $ hg qgoto mqtest.diff | |
621 | applying mqtest.diff |
|
621 | applying mqtest.diff | |
622 | now at: mqtest.diff |
|
622 | now at: mqtest.diff | |
623 | $ cat c |
|
623 | $ cat c | |
624 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
624 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
625 | tests for different changenodes |
|
625 | tests for different changenodes | |
626 | $ hg cat c |
|
626 | $ hg cat c | |
627 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
627 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
628 | tests for different changenodes |
|
628 | tests for different changenodes | |
629 |
|
629 | |||
630 | Keywords should not be expanded in filelog |
|
630 | Keywords should not be expanded in filelog | |
631 |
|
631 | |||
632 | $ hg --config 'extensions.keyword=!' cat c |
|
632 | $ hg --config 'extensions.keyword=!' cat c | |
633 | $Id$ |
|
633 | $Id$ | |
634 | tests for different changenodes |
|
634 | tests for different changenodes | |
635 |
|
635 | |||
636 | qpop and move on |
|
636 | qpop and move on | |
637 |
|
637 | |||
638 | $ hg qpop |
|
638 | $ hg qpop | |
639 | popping mqtest.diff |
|
639 | popping mqtest.diff | |
640 | patch queue now empty |
|
640 | patch queue now empty | |
641 |
|
641 | |||
642 | Copy and show added kwfiles |
|
642 | Copy and show added kwfiles | |
643 |
|
643 | |||
644 | $ hg cp a c |
|
644 | $ hg cp a c | |
645 | $ hg kwfiles |
|
645 | $ hg kwfiles | |
646 | a |
|
646 | a | |
647 | c |
|
647 | c | |
648 |
|
648 | |||
649 | Commit and show expansion in original and copy |
|
649 | Commit and show expansion in original and copy | |
650 |
|
650 | |||
651 | $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' |
|
651 | $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' | |
652 | committing files: |
|
652 | committing files: | |
653 | c |
|
653 | c | |
654 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
|
654 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | |
655 | committing manifest |
|
655 | committing manifest | |
656 | committing changelog |
|
656 | committing changelog | |
657 | overwriting c expanding keywords |
|
657 | overwriting c expanding keywords | |
658 | updating the branch cache |
|
658 | updating the branch cache | |
659 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d |
|
659 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d | |
660 | $ cat a c |
|
660 | $ cat a c | |
661 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
661 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
662 | do not process $Id: |
|
662 | do not process $Id: | |
663 | xxx $ |
|
663 | xxx $ | |
664 | expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ |
|
664 | expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ | |
665 | do not process $Id: |
|
665 | do not process $Id: | |
666 | xxx $ |
|
666 | xxx $ | |
667 |
|
667 | |||
668 | Touch copied c and check its status |
|
668 | Touch copied c and check its status | |
669 |
|
669 | |||
670 | $ touch c |
|
670 | $ touch c | |
671 | $ hg status |
|
671 | $ hg status | |
672 |
|
672 | |||
673 | Copy kwfile to keyword ignored file unexpanding keywords |
|
673 | Copy kwfile to keyword ignored file unexpanding keywords | |
674 |
|
674 | |||
675 | $ hg --verbose copy a i |
|
675 | $ hg --verbose copy a i | |
676 | copying a to i |
|
676 | copying a to i | |
677 | overwriting i shrinking keywords |
|
677 | overwriting i shrinking keywords | |
678 | $ head -n 1 i |
|
678 | $ head -n 1 i | |
679 | expand $Id$ |
|
679 | expand $Id$ | |
680 | $ hg forget i |
|
680 | $ hg forget i | |
681 | $ rm i |
|
681 | $ rm i | |
682 |
|
682 | |||
683 | Copy ignored file to ignored file: no overwriting |
|
683 | Copy ignored file to ignored file: no overwriting | |
684 |
|
684 | |||
685 | $ hg --verbose copy b i |
|
685 | $ hg --verbose copy b i | |
686 | copying b to i |
|
686 | copying b to i | |
687 | $ hg forget i |
|
687 | $ hg forget i | |
688 | $ rm i |
|
688 | $ rm i | |
689 |
|
689 | |||
690 | cp symlink file; hg cp -A symlink file (part1) |
|
690 | cp symlink file; hg cp -A symlink file (part1) | |
691 | - copied symlink points to kwfile: overwrite |
|
691 | - copied symlink points to kwfile: overwrite | |
692 |
|
692 | |||
693 | #if symlink |
|
693 | #if symlink | |
694 | $ cp sym i |
|
694 | $ cp sym i | |
695 | $ ls -l i |
|
695 | $ ls -l i | |
696 | -rw-r--r--* (glob) |
|
696 | -rw-r--r--* (glob) | |
697 | $ head -1 i |
|
697 | $ head -1 i | |
698 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
698 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
699 | $ hg copy --after --verbose sym i |
|
699 | $ hg copy --after --verbose sym i | |
700 | copying sym to i |
|
700 | copying sym to i | |
701 | overwriting i shrinking keywords |
|
701 | overwriting i shrinking keywords | |
702 | $ head -1 i |
|
702 | $ head -1 i | |
703 | expand $Id$ |
|
703 | expand $Id$ | |
704 | $ hg forget i |
|
704 | $ hg forget i | |
705 | $ rm i |
|
705 | $ rm i | |
706 | #endif |
|
706 | #endif | |
707 |
|
707 | |||
708 | Test different options of hg kwfiles |
|
708 | Test different options of hg kwfiles | |
709 |
|
709 | |||
710 | $ hg kwfiles |
|
710 | $ hg kwfiles | |
711 | a |
|
711 | a | |
712 | c |
|
712 | c | |
713 | $ hg -v kwfiles --ignore |
|
713 | $ hg -v kwfiles --ignore | |
714 | I b |
|
714 | I b | |
715 | I sym |
|
715 | I sym | |
716 | $ hg kwfiles --all |
|
716 | $ hg kwfiles --all | |
717 | K a |
|
717 | K a | |
718 | K c |
|
718 | K c | |
719 | I b |
|
719 | I b | |
720 | I sym |
|
720 | I sym | |
721 |
|
721 | |||
722 | Diff specific revision |
|
722 | Diff specific revision | |
723 |
|
723 | |||
724 | $ hg diff --rev 1 |
|
724 | $ hg diff --rev 1 | |
725 | diff -r ef63ca68695b c |
|
725 | diff -r ef63ca68695b c | |
726 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
726 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
727 | +++ b/c * (glob) |
|
727 | +++ b/c * (glob) | |
728 | @@ -0,0 +1,3 @@ |
|
728 | @@ -0,0 +1,3 @@ | |
729 | +expand $Id$ |
|
729 | +expand $Id$ | |
730 | +do not process $Id: |
|
730 | +do not process $Id: | |
731 | +xxx $ |
|
731 | +xxx $ | |
732 |
|
732 | |||
733 | Status after rollback: |
|
733 | Status after rollback: | |
734 |
|
734 | |||
735 | $ hg rollback |
|
735 | $ hg rollback | |
736 | repository tip rolled back to revision 1 (undo commit) |
|
736 | repository tip rolled back to revision 1 (undo commit) | |
737 | working directory now based on revision 1 |
|
737 | working directory now based on revision 1 | |
738 | $ hg status |
|
738 | $ hg status | |
739 | A c |
|
739 | A c | |
740 | $ hg update --clean |
|
740 | $ hg update --clean | |
741 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
741 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
742 |
|
742 | |||
743 | #if symlink |
|
743 | #if symlink | |
744 |
|
744 | |||
745 | cp symlink file; hg cp -A symlink file (part2) |
|
745 | cp symlink file; hg cp -A symlink file (part2) | |
746 | - copied symlink points to kw ignored file: do not overwrite |
|
746 | - copied symlink points to kw ignored file: do not overwrite | |
747 |
|
747 | |||
748 | $ cat a > i |
|
748 | $ cat a > i | |
749 | $ ln -s i symignored |
|
749 | $ ln -s i symignored | |
750 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored |
|
750 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored | |
751 | $ cp symignored x |
|
751 | $ cp symignored x | |
752 | $ hg copy --after --verbose symignored x |
|
752 | $ hg copy --after --verbose symignored x | |
753 | copying symignored to x |
|
753 | copying symignored to x | |
754 | $ head -n 1 x |
|
754 | $ head -n 1 x | |
755 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
755 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
756 | $ hg forget x |
|
756 | $ hg forget x | |
757 | $ rm x |
|
757 | $ rm x | |
758 |
|
758 | |||
759 | $ hg rollback |
|
759 | $ hg rollback | |
760 | repository tip rolled back to revision 1 (undo commit) |
|
760 | repository tip rolled back to revision 1 (undo commit) | |
761 | working directory now based on revision 1 |
|
761 | working directory now based on revision 1 | |
762 | $ hg update --clean |
|
762 | $ hg update --clean | |
763 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
763 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
764 | $ rm i symignored |
|
764 | $ rm i symignored | |
765 |
|
765 | |||
766 | #endif |
|
766 | #endif | |
767 |
|
767 | |||
768 | Custom keywordmaps as argument to kwdemo |
|
768 | Custom keywordmaps as argument to kwdemo | |
769 |
|
769 | |||
770 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" |
|
770 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" | |
771 | [extensions] |
|
771 | [extensions] | |
772 | keyword = |
|
772 | keyword = | |
773 | [keyword] |
|
773 | [keyword] | |
774 | ** = |
|
774 | ** = | |
775 | b = ignore |
|
775 | b = ignore | |
776 | demo.txt = |
|
776 | demo.txt = | |
777 | i = ignore |
|
777 | i = ignore | |
778 | [keywordset] |
|
778 | [keywordset] | |
779 | svn = False |
|
779 | svn = False | |
780 | [keywordmaps] |
|
780 | [keywordmaps] | |
781 | Xinfo = {author}: {desc} |
|
781 | Xinfo = {author}: {desc} | |
782 | $Xinfo: test: hg keyword configuration and expansion example $ |
|
782 | $Xinfo: test: hg keyword configuration and expansion example $ | |
783 |
|
783 | |||
784 | Configure custom keywordmaps |
|
784 | Configure custom keywordmaps | |
785 |
|
785 | |||
786 | $ cat <<EOF >>$HGRCPATH |
|
786 | $ cat <<EOF >>$HGRCPATH | |
787 | > [keywordmaps] |
|
787 | > [keywordmaps] | |
788 | > Id = {file} {node|short} {date|rfc822date} {author|user} |
|
788 | > Id = {file} {node|short} {date|rfc822date} {author|user} | |
789 | > Xinfo = {author}: {desc} |
|
789 | > Xinfo = {author}: {desc} | |
790 | > EOF |
|
790 | > EOF | |
791 |
|
791 | |||
792 | Cat and hg cat files before custom expansion |
|
792 | Cat and hg cat files before custom expansion | |
793 |
|
793 | |||
794 | $ cat a b |
|
794 | $ cat a b | |
795 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
795 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
796 | do not process $Id: |
|
796 | do not process $Id: | |
797 | xxx $ |
|
797 | xxx $ | |
798 | ignore $Id$ |
|
798 | ignore $Id$ | |
799 | $ hg cat sym a b && echo |
|
799 | $ hg cat sym a b && echo | |
800 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ |
|
800 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ | |
801 | do not process $Id: |
|
801 | do not process $Id: | |
802 | xxx $ |
|
802 | xxx $ | |
803 | ignore $Id$ |
|
803 | ignore $Id$ | |
804 | a |
|
804 | a | |
805 |
|
805 | |||
806 | Write custom keyword and prepare multi-line commit message |
|
806 | Write custom keyword and prepare multi-line commit message | |
807 |
|
807 | |||
808 | $ echo '$Xinfo$' >> a |
|
808 | $ echo '$Xinfo$' >> a | |
809 | $ cat <<EOF >> log |
|
809 | $ cat <<EOF >> log | |
810 | > firstline |
|
810 | > firstline | |
811 | > secondline |
|
811 | > secondline | |
812 | > EOF |
|
812 | > EOF | |
813 |
|
813 | |||
814 | Interrupted commit should not change state |
|
814 | Interrupted commit should not change state | |
815 |
|
815 | |||
816 | $ hg commit |
|
816 | $ hg commit | |
817 | abort: empty commit message |
|
817 | abort: empty commit message | |
818 | [255] |
|
818 | [255] | |
819 | $ hg status |
|
819 | $ hg status | |
820 | M a |
|
820 | M a | |
821 | ? c |
|
821 | ? c | |
822 | ? log |
|
822 | ? log | |
823 |
|
823 | |||
824 | Commit with multi-line message and custom expansion |
|
824 | Commit with multi-line message and custom expansion | |
825 |
|
825 | |||
826 | $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' |
|
826 | $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' | |
827 | committing files: |
|
827 | committing files: | |
828 | a |
|
828 | a | |
829 | committing manifest |
|
829 | committing manifest | |
830 | committing changelog |
|
830 | committing changelog | |
831 | overwriting a expanding keywords |
|
831 | overwriting a expanding keywords | |
832 | updating the branch cache |
|
832 | updating the branch cache | |
833 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
833 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 | |
834 | $ rm log |
|
834 | $ rm log | |
835 |
|
835 | |||
836 | Stat, verify and show custom expansion (firstline) |
|
836 | Stat, verify and show custom expansion (firstline) | |
837 |
|
837 | |||
838 | $ hg status |
|
838 | $ hg status | |
839 | ? c |
|
839 | ? c | |
840 | $ hg verify |
|
840 | $ hg verify | |
841 | checking changesets |
|
841 | checking changesets | |
842 | checking manifests |
|
842 | checking manifests | |
843 | crosschecking files in changesets and manifests |
|
843 | crosschecking files in changesets and manifests | |
844 | checking files |
|
844 | checking files | |
845 | checked 3 changesets with 4 changes to 3 files |
|
845 | checked 3 changesets with 4 changes to 3 files | |
846 | $ cat a b |
|
846 | $ cat a b | |
847 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
847 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
848 | do not process $Id: |
|
848 | do not process $Id: | |
849 | xxx $ |
|
849 | xxx $ | |
850 | $Xinfo: User Name <user@example.com>: firstline $ |
|
850 | $Xinfo: User Name <user@example.com>: firstline $ | |
851 | ignore $Id$ |
|
851 | ignore $Id$ | |
852 | $ hg cat sym a b && echo |
|
852 | $ hg cat sym a b && echo | |
853 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
853 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
854 | do not process $Id: |
|
854 | do not process $Id: | |
855 | xxx $ |
|
855 | xxx $ | |
856 | $Xinfo: User Name <user@example.com>: firstline $ |
|
856 | $Xinfo: User Name <user@example.com>: firstline $ | |
857 | ignore $Id$ |
|
857 | ignore $Id$ | |
858 | a |
|
858 | a | |
859 |
|
859 | |||
860 | annotate |
|
860 | annotate | |
861 |
|
861 | |||
862 | $ hg annotate a |
|
862 | $ hg annotate a | |
863 | 1: expand $Id$ |
|
863 | 1: expand $Id$ | |
864 | 1: do not process $Id: |
|
864 | 1: do not process $Id: | |
865 | 1: xxx $ |
|
865 | 1: xxx $ | |
866 | 2: $Xinfo$ |
|
866 | 2: $Xinfo$ | |
867 |
|
867 | |||
868 | remove with status checks |
|
868 | remove with status checks | |
869 |
|
869 | |||
870 | $ hg debugrebuildstate |
|
870 | $ hg debugrebuildstate | |
871 | $ hg remove a |
|
871 | $ hg remove a | |
872 | $ hg --debug commit -m rma |
|
872 | $ hg --debug commit -m rma | |
873 | committing files: |
|
873 | committing files: | |
874 | committing manifest |
|
874 | committing manifest | |
875 | committing changelog |
|
875 | committing changelog | |
876 | updating the branch cache |
|
876 | updating the branch cache | |
877 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 |
|
877 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 | |
878 | $ hg status |
|
878 | $ hg status | |
879 | ? c |
|
879 | ? c | |
880 |
|
880 | |||
881 | Rollback, revert, and check expansion |
|
881 | Rollback, revert, and check expansion | |
882 |
|
882 | |||
883 | $ hg rollback |
|
883 | $ hg rollback | |
884 | repository tip rolled back to revision 2 (undo commit) |
|
884 | repository tip rolled back to revision 2 (undo commit) | |
885 | working directory now based on revision 2 |
|
885 | working directory now based on revision 2 | |
886 | $ hg status |
|
886 | $ hg status | |
887 | R a |
|
887 | R a | |
888 | ? c |
|
888 | ? c | |
889 | $ hg revert --no-backup --rev tip a |
|
889 | $ hg revert --no-backup --rev tip a | |
890 | $ cat a |
|
890 | $ cat a | |
891 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
891 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
892 | do not process $Id: |
|
892 | do not process $Id: | |
893 | xxx $ |
|
893 | xxx $ | |
894 | $Xinfo: User Name <user@example.com>: firstline $ |
|
894 | $Xinfo: User Name <user@example.com>: firstline $ | |
895 |
|
895 | |||
896 | Clone to test global and local configurations |
|
896 | Clone to test global and local configurations | |
897 |
|
897 | |||
898 | $ cd .. |
|
898 | $ cd .. | |
899 |
|
899 | |||
900 | Expansion in destination with global configuration |
|
900 | Expansion in destination with global configuration | |
901 |
|
901 | |||
902 | $ hg --quiet clone Test globalconf |
|
902 | $ hg --quiet clone Test globalconf | |
903 | $ cat globalconf/a |
|
903 | $ cat globalconf/a | |
904 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
904 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
905 | do not process $Id: |
|
905 | do not process $Id: | |
906 | xxx $ |
|
906 | xxx $ | |
907 | $Xinfo: User Name <user@example.com>: firstline $ |
|
907 | $Xinfo: User Name <user@example.com>: firstline $ | |
908 |
|
908 | |||
909 | No expansion in destination with local configuration in origin only |
|
909 | No expansion in destination with local configuration in origin only | |
910 |
|
910 | |||
911 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf |
|
911 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf | |
912 | $ cat localconf/a |
|
912 | $ cat localconf/a | |
913 | expand $Id$ |
|
913 | expand $Id$ | |
914 | do not process $Id: |
|
914 | do not process $Id: | |
915 | xxx $ |
|
915 | xxx $ | |
916 | $Xinfo$ |
|
916 | $Xinfo$ | |
917 |
|
917 | |||
918 | Clone to test incoming |
|
918 | Clone to test incoming | |
919 |
|
919 | |||
920 | $ hg clone -r1 Test Test-a |
|
920 | $ hg clone -r1 Test Test-a | |
921 | adding changesets |
|
921 | adding changesets | |
922 | adding manifests |
|
922 | adding manifests | |
923 | adding file changes |
|
923 | adding file changes | |
924 | added 2 changesets with 3 changes to 3 files |
|
924 | added 2 changesets with 3 changes to 3 files | |
925 | new changesets a2392c293916:ef63ca68695b |
|
925 | new changesets a2392c293916:ef63ca68695b | |
926 | updating to branch default |
|
926 | updating to branch default | |
927 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
927 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
928 | $ cd Test-a |
|
928 | $ cd Test-a | |
929 | $ cat <<EOF >> .hg/hgrc |
|
929 | $ cat <<EOF >> .hg/hgrc | |
930 | > [paths] |
|
930 | > [paths] | |
931 | > default = ../Test |
|
931 | > default = ../Test | |
932 | > EOF |
|
932 | > EOF | |
933 | $ hg incoming |
|
933 | $ hg incoming | |
934 | comparing with $TESTTMP/Test |
|
934 | comparing with $TESTTMP/Test | |
935 | searching for changes |
|
935 | searching for changes | |
936 | changeset: 2:bb948857c743 |
|
936 | changeset: 2:bb948857c743 | |
937 | tag: tip |
|
937 | tag: tip | |
938 | user: User Name <user@example.com> |
|
938 | user: User Name <user@example.com> | |
939 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
939 | date: Thu Jan 01 00:00:02 1970 +0000 | |
940 | summary: firstline |
|
940 | summary: firstline | |
941 |
|
941 | |||
942 | Imported patch should not be rejected |
|
942 | Imported patch should not be rejected | |
943 |
|
943 | |||
944 | >>> import re |
|
944 | >>> import re | |
945 | >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read()) |
|
945 | >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read()) | |
946 | >>> open('a', 'wb').write(text) |
|
946 | >>> open('a', 'wb').write(text) and None | |
947 | $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' |
|
947 | $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' | |
948 | committing files: |
|
948 | committing files: | |
949 | a |
|
949 | a | |
950 | committing manifest |
|
950 | committing manifest | |
951 | committing changelog |
|
951 | committing changelog | |
952 | overwriting a expanding keywords |
|
952 | overwriting a expanding keywords | |
953 | updating the branch cache |
|
953 | updating the branch cache | |
954 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 |
|
954 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 | |
955 | $ hg export -o ../rejecttest.diff tip |
|
955 | $ hg export -o ../rejecttest.diff tip | |
956 | $ cd ../Test |
|
956 | $ cd ../Test | |
957 | $ hg import ../rejecttest.diff |
|
957 | $ hg import ../rejecttest.diff | |
958 | applying ../rejecttest.diff |
|
958 | applying ../rejecttest.diff | |
959 | $ cat a b |
|
959 | $ cat a b | |
960 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
|
960 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
961 | do not process $Id: rejecttest |
|
961 | do not process $Id: rejecttest | |
962 | xxx $ |
|
962 | xxx $ | |
963 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
963 | $Xinfo: User Name <user@example.com>: rejects? $ | |
964 | ignore $Id$ |
|
964 | ignore $Id$ | |
965 |
|
965 | |||
966 | $ hg rollback |
|
966 | $ hg rollback | |
967 | repository tip rolled back to revision 2 (undo import) |
|
967 | repository tip rolled back to revision 2 (undo import) | |
968 | working directory now based on revision 2 |
|
968 | working directory now based on revision 2 | |
969 | $ hg update --clean |
|
969 | $ hg update --clean | |
970 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
970 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
971 |
|
971 | |||
972 | kwexpand/kwshrink on selected files |
|
972 | kwexpand/kwshrink on selected files | |
973 |
|
973 | |||
974 | $ mkdir x |
|
974 | $ mkdir x | |
975 | $ hg copy a x/a |
|
975 | $ hg copy a x/a | |
976 | $ hg --verbose kwshrink a |
|
976 | $ hg --verbose kwshrink a | |
977 | overwriting a shrinking keywords |
|
977 | overwriting a shrinking keywords | |
978 | - sleep required for dirstate.normal() check |
|
978 | - sleep required for dirstate.normal() check | |
979 | $ sleep 1 |
|
979 | $ sleep 1 | |
980 | $ hg status a |
|
980 | $ hg status a | |
981 | $ hg --verbose kwexpand a |
|
981 | $ hg --verbose kwexpand a | |
982 | overwriting a expanding keywords |
|
982 | overwriting a expanding keywords | |
983 | $ hg status a |
|
983 | $ hg status a | |
984 |
|
984 | |||
985 | kwexpand x/a should abort |
|
985 | kwexpand x/a should abort | |
986 |
|
986 | |||
987 | $ hg --verbose kwexpand x/a |
|
987 | $ hg --verbose kwexpand x/a | |
988 | abort: outstanding uncommitted changes |
|
988 | abort: outstanding uncommitted changes | |
989 | [255] |
|
989 | [255] | |
990 | $ cd x |
|
990 | $ cd x | |
991 | $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' |
|
991 | $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' | |
992 | committing files: |
|
992 | committing files: | |
993 | x/a |
|
993 | x/a | |
994 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
|
994 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | |
995 | committing manifest |
|
995 | committing manifest | |
996 | committing changelog |
|
996 | committing changelog | |
997 | overwriting x/a expanding keywords |
|
997 | overwriting x/a expanding keywords | |
998 | updating the branch cache |
|
998 | updating the branch cache | |
999 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
999 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 | |
1000 | $ cat a |
|
1000 | $ cat a | |
1001 | expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ |
|
1001 | expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ | |
1002 | do not process $Id: |
|
1002 | do not process $Id: | |
1003 | xxx $ |
|
1003 | xxx $ | |
1004 | $Xinfo: User Name <user@example.com>: xa $ |
|
1004 | $Xinfo: User Name <user@example.com>: xa $ | |
1005 |
|
1005 | |||
1006 | kwshrink a inside directory x |
|
1006 | kwshrink a inside directory x | |
1007 |
|
1007 | |||
1008 | $ hg --verbose kwshrink a |
|
1008 | $ hg --verbose kwshrink a | |
1009 | overwriting x/a shrinking keywords |
|
1009 | overwriting x/a shrinking keywords | |
1010 | $ cat a |
|
1010 | $ cat a | |
1011 | expand $Id$ |
|
1011 | expand $Id$ | |
1012 | do not process $Id: |
|
1012 | do not process $Id: | |
1013 | xxx $ |
|
1013 | xxx $ | |
1014 | $Xinfo$ |
|
1014 | $Xinfo$ | |
1015 | $ cd .. |
|
1015 | $ cd .. | |
1016 |
|
1016 | |||
1017 | kwexpand nonexistent |
|
1017 | kwexpand nonexistent | |
1018 |
|
1018 | |||
1019 | $ hg kwexpand nonexistent |
|
1019 | $ hg kwexpand nonexistent | |
1020 | nonexistent:* (glob) |
|
1020 | nonexistent:* (glob) | |
1021 |
|
1021 | |||
1022 |
|
1022 | |||
1023 | #if serve |
|
1023 | #if serve | |
1024 | hg serve |
|
1024 | hg serve | |
1025 | - expand with hgweb file |
|
1025 | - expand with hgweb file | |
1026 | - no expansion with hgweb annotate/changeset/filediff/comparison |
|
1026 | - no expansion with hgweb annotate/changeset/filediff/comparison | |
1027 | - expand with hgweb file, again |
|
1027 | - expand with hgweb file, again | |
1028 | - check errors |
|
1028 | - check errors | |
1029 |
|
1029 | |||
1030 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
1030 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
1031 | $ cat hg.pid >> $DAEMON_PIDS |
|
1031 | $ cat hg.pid >> $DAEMON_PIDS | |
1032 | $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' |
|
1032 | $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' | |
1033 | 200 Script output follows |
|
1033 | 200 Script output follows | |
1034 |
|
1034 | |||
1035 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
1035 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
1036 | do not process $Id: |
|
1036 | do not process $Id: | |
1037 | xxx $ |
|
1037 | xxx $ | |
1038 | $Xinfo: User Name <user@example.com>: firstline $ |
|
1038 | $Xinfo: User Name <user@example.com>: firstline $ | |
1039 | $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw' |
|
1039 | $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw' | |
1040 | 200 Script output follows |
|
1040 | 200 Script output follows | |
1041 |
|
1041 | |||
1042 |
|
1042 | |||
1043 | user@1: expand $Id$ |
|
1043 | user@1: expand $Id$ | |
1044 | user@1: do not process $Id: |
|
1044 | user@1: do not process $Id: | |
1045 | user@1: xxx $ |
|
1045 | user@1: xxx $ | |
1046 | user@2: $Xinfo$ |
|
1046 | user@2: $Xinfo$ | |
1047 |
|
1047 | |||
1048 |
|
1048 | |||
1049 |
|
1049 | |||
1050 |
|
1050 | |||
1051 | $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw' |
|
1051 | $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw' | |
1052 | 200 Script output follows |
|
1052 | 200 Script output follows | |
1053 |
|
1053 | |||
1054 |
|
1054 | |||
1055 | # HG changeset patch |
|
1055 | # HG changeset patch | |
1056 | # User User Name <user@example.com> |
|
1056 | # User User Name <user@example.com> | |
1057 | # Date 3 0 |
|
1057 | # Date 3 0 | |
1058 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
1058 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 | |
1059 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
1059 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 | |
1060 | xa |
|
1060 | xa | |
1061 |
|
1061 | |||
1062 | diff -r bb948857c743 -r b4560182a3f9 x/a |
|
1062 | diff -r bb948857c743 -r b4560182a3f9 x/a | |
1063 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1063 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1064 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 |
|
1064 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 | |
1065 | @@ -0,0 +1,4 @@ |
|
1065 | @@ -0,0 +1,4 @@ | |
1066 | +expand $Id$ |
|
1066 | +expand $Id$ | |
1067 | +do not process $Id: |
|
1067 | +do not process $Id: | |
1068 | +xxx $ |
|
1068 | +xxx $ | |
1069 | +$Xinfo$ |
|
1069 | +$Xinfo$ | |
1070 |
|
1070 | |||
1071 | $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw' |
|
1071 | $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw' | |
1072 | 200 Script output follows |
|
1072 | 200 Script output follows | |
1073 |
|
1073 | |||
1074 |
|
1074 | |||
1075 | diff -r ef63ca68695b -r bb948857c743 a |
|
1075 | diff -r ef63ca68695b -r bb948857c743 a | |
1076 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1076 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1077 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
1077 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 | |
1078 | @@ -1,3 +1,4 @@ |
|
1078 | @@ -1,3 +1,4 @@ | |
1079 | expand $Id$ |
|
1079 | expand $Id$ | |
1080 | do not process $Id: |
|
1080 | do not process $Id: | |
1081 | xxx $ |
|
1081 | xxx $ | |
1082 | +$Xinfo$ |
|
1082 | +$Xinfo$ | |
1083 |
|
1083 | |||
1084 |
|
1084 | |||
1085 |
|
1085 | |||
1086 |
|
1086 | |||
1087 | $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]' |
|
1087 | $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]' | |
1088 | <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td> |
|
1088 | <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td> | |
1089 | <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td> |
|
1089 | <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td> | |
1090 | <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td> |
|
1090 | <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td> | |
1091 | <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td> |
|
1091 | <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td> | |
1092 | <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td> |
|
1092 | <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td> | |
1093 |
|
1093 | |||
1094 | (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords |
|
1094 | (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords | |
1095 | at subsequent webcommands) |
|
1095 | at subsequent webcommands) | |
1096 |
|
1096 | |||
1097 | $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' |
|
1097 | $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' | |
1098 | 200 Script output follows |
|
1098 | 200 Script output follows | |
1099 |
|
1099 | |||
1100 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
1100 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
1101 | do not process $Id: |
|
1101 | do not process $Id: | |
1102 | xxx $ |
|
1102 | xxx $ | |
1103 | $Xinfo: User Name <user@example.com>: firstline $ |
|
1103 | $Xinfo: User Name <user@example.com>: firstline $ | |
1104 |
|
1104 | |||
1105 | $ killdaemons.py |
|
1105 | $ killdaemons.py | |
1106 | $ cat errors.log |
|
1106 | $ cat errors.log | |
1107 | #endif |
|
1107 | #endif | |
1108 |
|
1108 | |||
1109 | Prepare merge and resolve tests |
|
1109 | Prepare merge and resolve tests | |
1110 |
|
1110 | |||
1111 | $ echo '$Id$' > m |
|
1111 | $ echo '$Id$' > m | |
1112 | $ hg add m |
|
1112 | $ hg add m | |
1113 | $ hg commit -m 4kw |
|
1113 | $ hg commit -m 4kw | |
1114 | $ echo foo >> m |
|
1114 | $ echo foo >> m | |
1115 | $ hg commit -m 5foo |
|
1115 | $ hg commit -m 5foo | |
1116 |
|
1116 | |||
1117 | simplemerge |
|
1117 | simplemerge | |
1118 |
|
1118 | |||
1119 | $ hg update 4 |
|
1119 | $ hg update 4 | |
1120 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1120 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1121 | $ echo foo >> m |
|
1121 | $ echo foo >> m | |
1122 | $ hg commit -m 6foo |
|
1122 | $ hg commit -m 6foo | |
1123 | created new head |
|
1123 | created new head | |
1124 | $ hg merge |
|
1124 | $ hg merge | |
1125 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1125 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1126 | (branch merge, don't forget to commit) |
|
1126 | (branch merge, don't forget to commit) | |
1127 | $ hg commit -m simplemerge |
|
1127 | $ hg commit -m simplemerge | |
1128 | $ cat m |
|
1128 | $ cat m | |
1129 | $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1129 | $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1130 | foo |
|
1130 | foo | |
1131 |
|
1131 | |||
1132 | conflict: keyword should stay outside conflict zone |
|
1132 | conflict: keyword should stay outside conflict zone | |
1133 |
|
1133 | |||
1134 | $ hg update 4 |
|
1134 | $ hg update 4 | |
1135 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1135 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1136 | $ echo bar >> m |
|
1136 | $ echo bar >> m | |
1137 | $ hg commit -m 8bar |
|
1137 | $ hg commit -m 8bar | |
1138 | created new head |
|
1138 | created new head | |
1139 | $ hg merge |
|
1139 | $ hg merge | |
1140 | merging m |
|
1140 | merging m | |
1141 | warning: conflicts while merging m! (edit, then use 'hg resolve --mark') |
|
1141 | warning: conflicts while merging m! (edit, then use 'hg resolve --mark') | |
1142 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1142 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
1143 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
1143 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
1144 | [1] |
|
1144 | [1] | |
1145 | $ cat m |
|
1145 | $ cat m | |
1146 | $Id$ |
|
1146 | $Id$ | |
1147 | <<<<<<< working copy: 88a80c8d172e - test: 8bar |
|
1147 | <<<<<<< working copy: 88a80c8d172e - test: 8bar | |
1148 | bar |
|
1148 | bar | |
1149 | ======= |
|
1149 | ======= | |
1150 | foo |
|
1150 | foo | |
1151 | >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge |
|
1151 | >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge | |
1152 |
|
1152 | |||
1153 | resolve to local, m must contain hash of last change (local parent) |
|
1153 | resolve to local, m must contain hash of last change (local parent) | |
1154 |
|
1154 | |||
1155 | $ hg resolve -t internal:local -a |
|
1155 | $ hg resolve -t internal:local -a | |
1156 | (no more unresolved files) |
|
1156 | (no more unresolved files) | |
1157 | $ hg commit -m localresolve |
|
1157 | $ hg commit -m localresolve | |
1158 | $ cat m |
|
1158 | $ cat m | |
1159 | $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1159 | $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1160 | bar |
|
1160 | bar | |
1161 |
|
1161 | |||
1162 | Test restricted mode with transplant -b |
|
1162 | Test restricted mode with transplant -b | |
1163 |
|
1163 | |||
1164 | $ hg update 6 |
|
1164 | $ hg update 6 | |
1165 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1165 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1166 | $ hg branch foo |
|
1166 | $ hg branch foo | |
1167 | marked working directory as branch foo |
|
1167 | marked working directory as branch foo | |
1168 | (branches are permanent and global, did you want a bookmark?) |
|
1168 | (branches are permanent and global, did you want a bookmark?) | |
1169 | $ mv a a.bak |
|
1169 | $ mv a a.bak | |
1170 | $ echo foobranch > a |
|
1170 | $ echo foobranch > a | |
1171 | $ cat a.bak >> a |
|
1171 | $ cat a.bak >> a | |
1172 | $ rm a.bak |
|
1172 | $ rm a.bak | |
1173 | $ hg commit -m 9foobranch |
|
1173 | $ hg commit -m 9foobranch | |
1174 | $ hg update default |
|
1174 | $ hg update default | |
1175 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1175 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1176 | $ hg -y transplant -b foo tip |
|
1176 | $ hg -y transplant -b foo tip | |
1177 | applying 4aa30d025d50 |
|
1177 | applying 4aa30d025d50 | |
1178 | 4aa30d025d50 transplanted to e00abbf63521 |
|
1178 | 4aa30d025d50 transplanted to e00abbf63521 | |
1179 |
|
1179 | |||
1180 | Expansion in changeset but not in file |
|
1180 | Expansion in changeset but not in file | |
1181 |
|
1181 | |||
1182 | $ hg tip -p |
|
1182 | $ hg tip -p | |
1183 | changeset: 11:e00abbf63521 |
|
1183 | changeset: 11:e00abbf63521 | |
1184 | tag: tip |
|
1184 | tag: tip | |
1185 | parent: 9:800511b3a22d |
|
1185 | parent: 9:800511b3a22d | |
1186 | user: test |
|
1186 | user: test | |
1187 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1187 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1188 | summary: 9foobranch |
|
1188 | summary: 9foobranch | |
1189 |
|
1189 | |||
1190 | diff -r 800511b3a22d -r e00abbf63521 a |
|
1190 | diff -r 800511b3a22d -r e00abbf63521 a | |
1191 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1191 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1192 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1192 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1193 | @@ -1,3 +1,4 @@ |
|
1193 | @@ -1,3 +1,4 @@ | |
1194 | +foobranch |
|
1194 | +foobranch | |
1195 | expand $Id$ |
|
1195 | expand $Id$ | |
1196 | do not process $Id: |
|
1196 | do not process $Id: | |
1197 | xxx $ |
|
1197 | xxx $ | |
1198 |
|
1198 | |||
1199 | $ head -n 2 a |
|
1199 | $ head -n 2 a | |
1200 | foobranch |
|
1200 | foobranch | |
1201 | expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1201 | expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1202 |
|
1202 | |||
1203 | Turn off expansion |
|
1203 | Turn off expansion | |
1204 |
|
1204 | |||
1205 | $ hg -q rollback |
|
1205 | $ hg -q rollback | |
1206 | $ hg -q update -C |
|
1206 | $ hg -q update -C | |
1207 |
|
1207 | |||
1208 | kwshrink with unknown file u |
|
1208 | kwshrink with unknown file u | |
1209 |
|
1209 | |||
1210 | $ cp a u |
|
1210 | $ cp a u | |
1211 | $ hg --verbose kwshrink |
|
1211 | $ hg --verbose kwshrink | |
1212 | overwriting a shrinking keywords |
|
1212 | overwriting a shrinking keywords | |
1213 | overwriting m shrinking keywords |
|
1213 | overwriting m shrinking keywords | |
1214 | overwriting x/a shrinking keywords |
|
1214 | overwriting x/a shrinking keywords | |
1215 |
|
1215 | |||
1216 | Keywords shrunk in working directory, but not yet disabled |
|
1216 | Keywords shrunk in working directory, but not yet disabled | |
1217 | - cat shows unexpanded keywords |
|
1217 | - cat shows unexpanded keywords | |
1218 | - hg cat shows expanded keywords |
|
1218 | - hg cat shows expanded keywords | |
1219 |
|
1219 | |||
1220 | $ cat a b |
|
1220 | $ cat a b | |
1221 | expand $Id$ |
|
1221 | expand $Id$ | |
1222 | do not process $Id: |
|
1222 | do not process $Id: | |
1223 | xxx $ |
|
1223 | xxx $ | |
1224 | $Xinfo$ |
|
1224 | $Xinfo$ | |
1225 | ignore $Id$ |
|
1225 | ignore $Id$ | |
1226 | $ hg cat sym a b && echo |
|
1226 | $ hg cat sym a b && echo | |
1227 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
1227 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
1228 | do not process $Id: |
|
1228 | do not process $Id: | |
1229 | xxx $ |
|
1229 | xxx $ | |
1230 | $Xinfo: User Name <user@example.com>: firstline $ |
|
1230 | $Xinfo: User Name <user@example.com>: firstline $ | |
1231 | ignore $Id$ |
|
1231 | ignore $Id$ | |
1232 | a |
|
1232 | a | |
1233 |
|
1233 | |||
1234 | Now disable keyword expansion |
|
1234 | Now disable keyword expansion | |
1235 |
|
1235 | |||
1236 | $ cp $HGRCPATH $HGRCPATH.backup |
|
1236 | $ cp $HGRCPATH $HGRCPATH.backup | |
1237 | $ rm "$HGRCPATH" |
|
1237 | $ rm "$HGRCPATH" | |
1238 | $ cat a b |
|
1238 | $ cat a b | |
1239 | expand $Id$ |
|
1239 | expand $Id$ | |
1240 | do not process $Id: |
|
1240 | do not process $Id: | |
1241 | xxx $ |
|
1241 | xxx $ | |
1242 | $Xinfo$ |
|
1242 | $Xinfo$ | |
1243 | ignore $Id$ |
|
1243 | ignore $Id$ | |
1244 | $ hg cat sym a b && echo |
|
1244 | $ hg cat sym a b && echo | |
1245 | expand $Id$ |
|
1245 | expand $Id$ | |
1246 | do not process $Id: |
|
1246 | do not process $Id: | |
1247 | xxx $ |
|
1247 | xxx $ | |
1248 | $Xinfo$ |
|
1248 | $Xinfo$ | |
1249 | ignore $Id$ |
|
1249 | ignore $Id$ | |
1250 | a |
|
1250 | a | |
1251 |
|
1251 | |||
1252 | enable keyword expansion again |
|
1252 | enable keyword expansion again | |
1253 |
|
1253 | |||
1254 | $ cat $HGRCPATH.backup >> $HGRCPATH |
|
1254 | $ cat $HGRCPATH.backup >> $HGRCPATH | |
1255 |
|
1255 | |||
1256 | Test restricted mode with unshelve |
|
1256 | Test restricted mode with unshelve | |
1257 |
|
1257 | |||
1258 | $ cat <<EOF >> $HGRCPATH |
|
1258 | $ cat <<EOF >> $HGRCPATH | |
1259 | > [extensions] |
|
1259 | > [extensions] | |
1260 | > shelve = |
|
1260 | > shelve = | |
1261 | > EOF |
|
1261 | > EOF | |
1262 |
|
1262 | |||
1263 | $ echo xxxx >> a |
|
1263 | $ echo xxxx >> a | |
1264 | $ hg diff |
|
1264 | $ hg diff | |
1265 | diff -r 800511b3a22d a |
|
1265 | diff -r 800511b3a22d a | |
1266 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1266 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1267 | +++ b/a * (glob) |
|
1267 | +++ b/a * (glob) | |
1268 | @@ -2,3 +2,4 @@ |
|
1268 | @@ -2,3 +2,4 @@ | |
1269 | do not process $Id: |
|
1269 | do not process $Id: | |
1270 | xxx $ |
|
1270 | xxx $ | |
1271 | $Xinfo$ |
|
1271 | $Xinfo$ | |
1272 | +xxxx |
|
1272 | +xxxx | |
1273 | $ hg shelve -q --name tmp |
|
1273 | $ hg shelve -q --name tmp | |
1274 | $ hg shelve --list --patch |
|
1274 | $ hg shelve --list --patch | |
1275 | tmp (*)* changes to: localresolve (glob) |
|
1275 | tmp (*)* changes to: localresolve (glob) | |
1276 |
|
1276 | |||
1277 | diff --git a/a b/a |
|
1277 | diff --git a/a b/a | |
1278 | --- a/a |
|
1278 | --- a/a | |
1279 | +++ b/a |
|
1279 | +++ b/a | |
1280 | @@ -2,3 +2,4 @@ |
|
1280 | @@ -2,3 +2,4 @@ | |
1281 | do not process $Id: |
|
1281 | do not process $Id: | |
1282 | xxx $ |
|
1282 | xxx $ | |
1283 | $Xinfo$ |
|
1283 | $Xinfo$ | |
1284 | +xxxx |
|
1284 | +xxxx | |
1285 |
|
1285 | |||
1286 | $ hg update -q -C 10 |
|
1286 | $ hg update -q -C 10 | |
1287 | $ hg unshelve -q tmp |
|
1287 | $ hg unshelve -q tmp | |
1288 | $ hg diff |
|
1288 | $ hg diff | |
1289 | diff -r 4aa30d025d50 a |
|
1289 | diff -r 4aa30d025d50 a | |
1290 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1290 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1291 | +++ b/a * (glob) |
|
1291 | +++ b/a * (glob) | |
1292 | @@ -3,3 +3,4 @@ |
|
1292 | @@ -3,3 +3,4 @@ | |
1293 | do not process $Id: |
|
1293 | do not process $Id: | |
1294 | xxx $ |
|
1294 | xxx $ | |
1295 | $Xinfo$ |
|
1295 | $Xinfo$ | |
1296 | +xxxx |
|
1296 | +xxxx | |
1297 |
|
1297 | |||
1298 | Test restricted mode with rebase |
|
1298 | Test restricted mode with rebase | |
1299 |
|
1299 | |||
1300 | $ cat <<EOF >> $HGRCPATH |
|
1300 | $ cat <<EOF >> $HGRCPATH | |
1301 | > [extensions] |
|
1301 | > [extensions] | |
1302 | > rebase = |
|
1302 | > rebase = | |
1303 | > EOF |
|
1303 | > EOF | |
1304 |
|
1304 | |||
1305 | $ hg update -q -C 9 |
|
1305 | $ hg update -q -C 9 | |
1306 |
|
1306 | |||
1307 | $ echo xxxx >> a |
|
1307 | $ echo xxxx >> a | |
1308 | $ hg commit -m '#11' |
|
1308 | $ hg commit -m '#11' | |
1309 | $ hg diff -c 11 |
|
1309 | $ hg diff -c 11 | |
1310 | diff -r 800511b3a22d -r b07670694489 a |
|
1310 | diff -r 800511b3a22d -r b07670694489 a | |
1311 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1311 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1312 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1312 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1313 | @@ -2,3 +2,4 @@ |
|
1313 | @@ -2,3 +2,4 @@ | |
1314 | do not process $Id: |
|
1314 | do not process $Id: | |
1315 | xxx $ |
|
1315 | xxx $ | |
1316 | $Xinfo$ |
|
1316 | $Xinfo$ | |
1317 | +xxxx |
|
1317 | +xxxx | |
1318 |
|
1318 | |||
1319 | $ hg diff -c 10 |
|
1319 | $ hg diff -c 10 | |
1320 | diff -r 27d48ee14f67 -r 4aa30d025d50 a |
|
1320 | diff -r 27d48ee14f67 -r 4aa30d025d50 a | |
1321 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1321 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1322 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1322 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1323 | @@ -1,3 +1,4 @@ |
|
1323 | @@ -1,3 +1,4 @@ | |
1324 | +foobranch |
|
1324 | +foobranch | |
1325 | expand $Id$ |
|
1325 | expand $Id$ | |
1326 | do not process $Id: |
|
1326 | do not process $Id: | |
1327 | xxx $ |
|
1327 | xxx $ | |
1328 |
|
1328 | |||
1329 | $ hg rebase -q -s 10 -d 11 --keep |
|
1329 | $ hg rebase -q -s 10 -d 11 --keep | |
1330 | $ hg diff -r 9 -r 12 a |
|
1330 | $ hg diff -r 9 -r 12 a | |
1331 | diff -r 800511b3a22d -r 1939b927726c a |
|
1331 | diff -r 800511b3a22d -r 1939b927726c a | |
1332 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1332 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1333 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1333 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1334 | @@ -1,4 +1,6 @@ |
|
1334 | @@ -1,4 +1,6 @@ | |
1335 | +foobranch |
|
1335 | +foobranch | |
1336 | expand $Id$ |
|
1336 | expand $Id$ | |
1337 | do not process $Id: |
|
1337 | do not process $Id: | |
1338 | xxx $ |
|
1338 | xxx $ | |
1339 | $Xinfo$ |
|
1339 | $Xinfo$ | |
1340 | +xxxx |
|
1340 | +xxxx | |
1341 |
|
1341 | |||
1342 | Test restricted mode with graft |
|
1342 | Test restricted mode with graft | |
1343 |
|
1343 | |||
1344 | $ hg graft -q 10 |
|
1344 | $ hg graft -q 10 | |
1345 | $ hg diff -r 9 -r 13 a |
|
1345 | $ hg diff -r 9 -r 13 a | |
1346 | diff -r 800511b3a22d -r 01a68de1003a a |
|
1346 | diff -r 800511b3a22d -r 01a68de1003a a | |
1347 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1347 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1348 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1348 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1349 | @@ -1,4 +1,6 @@ |
|
1349 | @@ -1,4 +1,6 @@ | |
1350 | +foobranch |
|
1350 | +foobranch | |
1351 | expand $Id$ |
|
1351 | expand $Id$ | |
1352 | do not process $Id: |
|
1352 | do not process $Id: | |
1353 | xxx $ |
|
1353 | xxx $ | |
1354 | $Xinfo$ |
|
1354 | $Xinfo$ | |
1355 | +xxxx |
|
1355 | +xxxx | |
1356 |
|
1356 | |||
1357 | Test restricted mode with backout |
|
1357 | Test restricted mode with backout | |
1358 |
|
1358 | |||
1359 | $ hg backout -q 11 --no-commit |
|
1359 | $ hg backout -q 11 --no-commit | |
1360 | $ hg diff a |
|
1360 | $ hg diff a | |
1361 | diff -r 01a68de1003a a |
|
1361 | diff -r 01a68de1003a a | |
1362 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1362 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1363 | +++ b/a * (glob) |
|
1363 | +++ b/a * (glob) | |
1364 | @@ -3,4 +3,3 @@ |
|
1364 | @@ -3,4 +3,3 @@ | |
1365 | do not process $Id: |
|
1365 | do not process $Id: | |
1366 | xxx $ |
|
1366 | xxx $ | |
1367 | $Xinfo$ |
|
1367 | $Xinfo$ | |
1368 | -xxxx |
|
1368 | -xxxx | |
1369 |
|
1369 | |||
1370 | Test restricted mode with histedit |
|
1370 | Test restricted mode with histedit | |
1371 |
|
1371 | |||
1372 | $ cat <<EOF >> $HGRCPATH |
|
1372 | $ cat <<EOF >> $HGRCPATH | |
1373 | > [extensions] |
|
1373 | > [extensions] | |
1374 | > histedit = |
|
1374 | > histedit = | |
1375 | > EOF |
|
1375 | > EOF | |
1376 |
|
1376 | |||
1377 | $ hg commit -m 'backout #11' |
|
1377 | $ hg commit -m 'backout #11' | |
1378 | $ hg histedit -q --command - 13 <<EOF |
|
1378 | $ hg histedit -q --command - 13 <<EOF | |
1379 | > pick 49f5f2d940c3 14 backout #11 |
|
1379 | > pick 49f5f2d940c3 14 backout #11 | |
1380 | > pick 01a68de1003a 13 9foobranch |
|
1380 | > pick 01a68de1003a 13 9foobranch | |
1381 | > EOF |
|
1381 | > EOF | |
1382 |
|
1382 | |||
1383 | Test restricted mode with fetch (with merge) |
|
1383 | Test restricted mode with fetch (with merge) | |
1384 |
|
1384 | |||
1385 | $ cat <<EOF >> $HGRCPATH |
|
1385 | $ cat <<EOF >> $HGRCPATH | |
1386 | > [extensions] |
|
1386 | > [extensions] | |
1387 | > fetch = |
|
1387 | > fetch = | |
1388 | > EOF |
|
1388 | > EOF | |
1389 |
|
1389 | |||
1390 | $ hg clone -q -r 9 . ../fetch-merge |
|
1390 | $ hg clone -q -r 9 . ../fetch-merge | |
1391 | $ cd ../fetch-merge |
|
1391 | $ cd ../fetch-merge | |
1392 | $ hg -R ../Test export 10 | hg import -q - |
|
1392 | $ hg -R ../Test export 10 | hg import -q - | |
1393 | $ hg fetch -q -r 11 |
|
1393 | $ hg fetch -q -r 11 | |
1394 | $ hg diff -r 9 a |
|
1394 | $ hg diff -r 9 a | |
1395 | diff -r 800511b3a22d a |
|
1395 | diff -r 800511b3a22d a | |
1396 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1396 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1397 | +++ b/a * (glob) |
|
1397 | +++ b/a * (glob) | |
1398 | @@ -1,4 +1,6 @@ |
|
1398 | @@ -1,4 +1,6 @@ | |
1399 | +foobranch |
|
1399 | +foobranch | |
1400 | expand $Id$ |
|
1400 | expand $Id$ | |
1401 | do not process $Id: |
|
1401 | do not process $Id: | |
1402 | xxx $ |
|
1402 | xxx $ | |
1403 | $Xinfo$ |
|
1403 | $Xinfo$ | |
1404 | +xxxx |
|
1404 | +xxxx | |
1405 |
|
1405 | |||
1406 | Test that patch.diff(), which is implied by "hg diff" or so, doesn't |
|
1406 | Test that patch.diff(), which is implied by "hg diff" or so, doesn't | |
1407 | suppress expanding keywords at subsequent commands |
|
1407 | suppress expanding keywords at subsequent commands | |
1408 |
|
1408 | |||
1409 | #if windows |
|
1409 | #if windows | |
1410 | $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" |
|
1410 | $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" | |
1411 | #else |
|
1411 | #else | |
1412 | $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" |
|
1412 | $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" | |
1413 | #endif |
|
1413 | #endif | |
1414 | $ export PYTHONPATH |
|
1414 | $ export PYTHONPATH | |
1415 |
|
1415 | |||
1416 | $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new |
|
1416 | $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new | |
1417 | $ mv $HGRCPATH.new $HGRCPATH |
|
1417 | $ mv $HGRCPATH.new $HGRCPATH | |
1418 |
|
1418 | |||
1419 | >>> from __future__ import print_function |
|
1419 | >>> from __future__ import print_function | |
1420 | >>> from hgclient import check, readchannel, runcommand |
|
1420 | >>> from hgclient import check, readchannel, runcommand | |
1421 | >>> @check |
|
1421 | >>> @check | |
1422 | ... def check(server): |
|
1422 | ... def check(server): | |
1423 | ... # hello block |
|
1423 | ... # hello block | |
1424 | ... readchannel(server) |
|
1424 | ... readchannel(server) | |
1425 | ... |
|
1425 | ... | |
1426 | ... runcommand(server, ['cat', 'm']) |
|
1426 | ... runcommand(server, ['cat', 'm']) | |
1427 | ... runcommand(server, ['diff', '-c', '.', 'm']) |
|
1427 | ... runcommand(server, ['diff', '-c', '.', 'm']) | |
1428 | ... runcommand(server, ['cat', 'm']) |
|
1428 | ... runcommand(server, ['cat', 'm']) | |
1429 | *** runcommand cat m |
|
1429 | *** runcommand cat m | |
1430 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1430 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1431 | bar |
|
1431 | bar | |
1432 | *** runcommand diff -c . m |
|
1432 | *** runcommand diff -c . m | |
1433 | *** runcommand cat m |
|
1433 | *** runcommand cat m | |
1434 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1434 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1435 | bar |
|
1435 | bar | |
1436 |
|
1436 | |||
1437 | $ cd .. |
|
1437 | $ cd .. | |
1438 |
|
1438 | |||
1439 | #if serve |
|
1439 | #if serve | |
1440 |
|
1440 | |||
1441 | Test that keywords are expanded only in repositories, which enable |
|
1441 | Test that keywords are expanded only in repositories, which enable | |
1442 | keyword extension, even if multiple repositories are served in a |
|
1442 | keyword extension, even if multiple repositories are served in a | |
1443 | process |
|
1443 | process | |
1444 |
|
1444 | |||
1445 | $ cat >> fetch-merge/.hg/hgrc <<EOF |
|
1445 | $ cat >> fetch-merge/.hg/hgrc <<EOF | |
1446 | > [extensions] |
|
1446 | > [extensions] | |
1447 | > keyword = ! |
|
1447 | > keyword = ! | |
1448 | > EOF |
|
1448 | > EOF | |
1449 |
|
1449 | |||
1450 | $ cat > paths.conf <<EOF |
|
1450 | $ cat > paths.conf <<EOF | |
1451 | > [paths] |
|
1451 | > [paths] | |
1452 | > enabled=Test |
|
1452 | > enabled=Test | |
1453 | > disabled=fetch-merge |
|
1453 | > disabled=fetch-merge | |
1454 | > EOF |
|
1454 | > EOF | |
1455 |
|
1455 | |||
1456 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf |
|
1456 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf | |
1457 | $ cat hg.pid >> $DAEMON_PIDS |
|
1457 | $ cat hg.pid >> $DAEMON_PIDS | |
1458 |
|
1458 | |||
1459 | $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' |
|
1459 | $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' | |
1460 | 200 Script output follows |
|
1460 | 200 Script output follows | |
1461 |
|
1461 | |||
1462 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1462 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1463 | bar |
|
1463 | bar | |
1464 |
|
1464 | |||
1465 | $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw' |
|
1465 | $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw' | |
1466 | 200 Script output follows |
|
1466 | 200 Script output follows | |
1467 |
|
1467 | |||
1468 | $Id$ |
|
1468 | $Id$ | |
1469 | bar |
|
1469 | bar | |
1470 |
|
1470 | |||
1471 | (check expansion again, for safety) |
|
1471 | (check expansion again, for safety) | |
1472 |
|
1472 | |||
1473 | $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' |
|
1473 | $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' | |
1474 | 200 Script output follows |
|
1474 | 200 Script output follows | |
1475 |
|
1475 | |||
1476 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1476 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1477 | bar |
|
1477 | bar | |
1478 |
|
1478 | |||
1479 | $ killdaemons.py |
|
1479 | $ killdaemons.py | |
1480 | #endif |
|
1480 | #endif |
@@ -1,464 +1,464 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
1 | #testcases sshv1 sshv2 | |
2 |
|
2 | |||
3 | #if sshv2 |
|
3 | #if sshv2 | |
4 | $ cat >> $HGRCPATH << EOF |
|
4 | $ cat >> $HGRCPATH << EOF | |
5 | > [experimental] |
|
5 | > [experimental] | |
6 | > sshpeer.advertise-v2 = true |
|
6 | > sshpeer.advertise-v2 = true | |
7 | > sshserver.support-v2 = true |
|
7 | > sshserver.support-v2 = true | |
8 | > EOF |
|
8 | > EOF | |
9 | #endif |
|
9 | #endif | |
10 |
|
10 | |||
11 | This file contains testcases that tend to be related to the wire protocol part |
|
11 | This file contains testcases that tend to be related to the wire protocol part | |
12 | of largefiles. |
|
12 | of largefiles. | |
13 |
|
13 | |||
14 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE |
|
14 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE | |
15 | $ mkdir "${USERCACHE}" |
|
15 | $ mkdir "${USERCACHE}" | |
16 | $ cat >> $HGRCPATH <<EOF |
|
16 | $ cat >> $HGRCPATH <<EOF | |
17 | > [extensions] |
|
17 | > [extensions] | |
18 | > largefiles= |
|
18 | > largefiles= | |
19 | > purge= |
|
19 | > purge= | |
20 | > rebase= |
|
20 | > rebase= | |
21 | > transplant= |
|
21 | > transplant= | |
22 | > [phases] |
|
22 | > [phases] | |
23 | > publish=False |
|
23 | > publish=False | |
24 | > [largefiles] |
|
24 | > [largefiles] | |
25 | > minsize=2 |
|
25 | > minsize=2 | |
26 | > patterns=glob:**.dat |
|
26 | > patterns=glob:**.dat | |
27 | > usercache=${USERCACHE} |
|
27 | > usercache=${USERCACHE} | |
28 | > [web] |
|
28 | > [web] | |
29 | > allow-archive = zip |
|
29 | > allow-archive = zip | |
30 | > [hooks] |
|
30 | > [hooks] | |
31 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" |
|
31 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" | |
32 | > EOF |
|
32 | > EOF | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | #if serve |
|
35 | #if serve | |
36 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
36 | vanilla clients not locked out from largefiles servers on vanilla repos | |
37 | $ mkdir r1 |
|
37 | $ mkdir r1 | |
38 | $ cd r1 |
|
38 | $ cd r1 | |
39 | $ hg init |
|
39 | $ hg init | |
40 | $ echo c1 > f1 |
|
40 | $ echo c1 > f1 | |
41 | $ hg add f1 |
|
41 | $ hg add f1 | |
42 | $ hg commit -m "m1" |
|
42 | $ hg commit -m "m1" | |
43 | Invoking status precommit hook |
|
43 | Invoking status precommit hook | |
44 | A f1 |
|
44 | A f1 | |
45 | $ cd .. |
|
45 | $ cd .. | |
46 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
46 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid | |
47 | $ cat hg.pid >> $DAEMON_PIDS |
|
47 | $ cat hg.pid >> $DAEMON_PIDS | |
48 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
48 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 | |
49 | requesting all changes |
|
49 | requesting all changes | |
50 | adding changesets |
|
50 | adding changesets | |
51 | adding manifests |
|
51 | adding manifests | |
52 | adding file changes |
|
52 | adding file changes | |
53 | added 1 changesets with 1 changes to 1 files |
|
53 | added 1 changesets with 1 changes to 1 files | |
54 | new changesets b6eb3a2e2efe (1 drafts) |
|
54 | new changesets b6eb3a2e2efe (1 drafts) | |
55 | updating to branch default |
|
55 | updating to branch default | |
56 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
56 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
57 |
|
57 | |||
58 | largefiles clients still work with vanilla servers |
|
58 | largefiles clients still work with vanilla servers | |
59 | $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
59 | $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid | |
60 | $ cat hg.pid >> $DAEMON_PIDS |
|
60 | $ cat hg.pid >> $DAEMON_PIDS | |
61 | $ hg clone http://localhost:$HGPORT1 r3 |
|
61 | $ hg clone http://localhost:$HGPORT1 r3 | |
62 | requesting all changes |
|
62 | requesting all changes | |
63 | adding changesets |
|
63 | adding changesets | |
64 | adding manifests |
|
64 | adding manifests | |
65 | adding file changes |
|
65 | adding file changes | |
66 | added 1 changesets with 1 changes to 1 files |
|
66 | added 1 changesets with 1 changes to 1 files | |
67 | new changesets b6eb3a2e2efe (1 drafts) |
|
67 | new changesets b6eb3a2e2efe (1 drafts) | |
68 | updating to branch default |
|
68 | updating to branch default | |
69 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
70 | #endif |
|
70 | #endif | |
71 |
|
71 | |||
72 | vanilla clients locked out from largefiles http repos |
|
72 | vanilla clients locked out from largefiles http repos | |
73 | $ mkdir r4 |
|
73 | $ mkdir r4 | |
74 | $ cd r4 |
|
74 | $ cd r4 | |
75 | $ hg init |
|
75 | $ hg init | |
76 | $ echo c1 > f1 |
|
76 | $ echo c1 > f1 | |
77 | $ hg add --large f1 |
|
77 | $ hg add --large f1 | |
78 | $ hg commit -m "m1" |
|
78 | $ hg commit -m "m1" | |
79 | Invoking status precommit hook |
|
79 | Invoking status precommit hook | |
80 | A f1 |
|
80 | A f1 | |
81 | $ cd .. |
|
81 | $ cd .. | |
82 |
|
82 | |||
83 | largefiles can be pushed locally (issue3583) |
|
83 | largefiles can be pushed locally (issue3583) | |
84 | $ hg init dest |
|
84 | $ hg init dest | |
85 | $ cd r4 |
|
85 | $ cd r4 | |
86 | $ hg outgoing ../dest |
|
86 | $ hg outgoing ../dest | |
87 | comparing with ../dest |
|
87 | comparing with ../dest | |
88 | searching for changes |
|
88 | searching for changes | |
89 | changeset: 0:639881c12b4c |
|
89 | changeset: 0:639881c12b4c | |
90 | tag: tip |
|
90 | tag: tip | |
91 | user: test |
|
91 | user: test | |
92 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
92 | date: Thu Jan 01 00:00:00 1970 +0000 | |
93 | summary: m1 |
|
93 | summary: m1 | |
94 |
|
94 | |||
95 | $ hg push ../dest |
|
95 | $ hg push ../dest | |
96 | pushing to ../dest |
|
96 | pushing to ../dest | |
97 | searching for changes |
|
97 | searching for changes | |
98 | adding changesets |
|
98 | adding changesets | |
99 | adding manifests |
|
99 | adding manifests | |
100 | adding file changes |
|
100 | adding file changes | |
101 | added 1 changesets with 1 changes to 1 files |
|
101 | added 1 changesets with 1 changes to 1 files | |
102 |
|
102 | |||
103 | exit code with nothing outgoing (issue3611) |
|
103 | exit code with nothing outgoing (issue3611) | |
104 | $ hg outgoing ../dest |
|
104 | $ hg outgoing ../dest | |
105 | comparing with ../dest |
|
105 | comparing with ../dest | |
106 | searching for changes |
|
106 | searching for changes | |
107 | no changes found |
|
107 | no changes found | |
108 | [1] |
|
108 | [1] | |
109 | $ cd .. |
|
109 | $ cd .. | |
110 |
|
110 | |||
111 | #if serve |
|
111 | #if serve | |
112 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
112 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid | |
113 | $ cat hg.pid >> $DAEMON_PIDS |
|
113 | $ cat hg.pid >> $DAEMON_PIDS | |
114 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
114 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 | |
115 | abort: remote error: |
|
115 | abort: remote error: | |
116 |
|
116 | |||
117 | This repository uses the largefiles extension. |
|
117 | This repository uses the largefiles extension. | |
118 |
|
118 | |||
119 | Please enable it in your Mercurial config file. |
|
119 | Please enable it in your Mercurial config file. | |
120 | [255] |
|
120 | [255] | |
121 |
|
121 | |||
122 | used all HGPORTs, kill all daemons |
|
122 | used all HGPORTs, kill all daemons | |
123 | $ killdaemons.py |
|
123 | $ killdaemons.py | |
124 | #endif |
|
124 | #endif | |
125 |
|
125 | |||
126 | vanilla clients locked out from largefiles ssh repos |
|
126 | vanilla clients locked out from largefiles ssh repos | |
127 | $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 |
|
127 | $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 | |
128 | remote: |
|
128 | remote: | |
129 | remote: This repository uses the largefiles extension. |
|
129 | remote: This repository uses the largefiles extension. | |
130 | remote: |
|
130 | remote: | |
131 | remote: Please enable it in your Mercurial config file. |
|
131 | remote: Please enable it in your Mercurial config file. | |
132 | remote: |
|
132 | remote: | |
133 | remote: - |
|
133 | remote: - | |
134 | abort: remote error |
|
134 | abort: remote error | |
135 | (check previous remote output) |
|
135 | (check previous remote output) | |
136 | [255] |
|
136 | [255] | |
137 |
|
137 | |||
138 | #if serve |
|
138 | #if serve | |
139 |
|
139 | |||
140 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
140 | largefiles clients refuse to push largefiles repos to vanilla servers | |
141 | $ mkdir r6 |
|
141 | $ mkdir r6 | |
142 | $ cd r6 |
|
142 | $ cd r6 | |
143 | $ hg init |
|
143 | $ hg init | |
144 | $ echo c1 > f1 |
|
144 | $ echo c1 > f1 | |
145 | $ hg add f1 |
|
145 | $ hg add f1 | |
146 | $ hg commit -m "m1" |
|
146 | $ hg commit -m "m1" | |
147 | Invoking status precommit hook |
|
147 | Invoking status precommit hook | |
148 | A f1 |
|
148 | A f1 | |
149 | $ cat >> .hg/hgrc <<! |
|
149 | $ cat >> .hg/hgrc <<! | |
150 | > [web] |
|
150 | > [web] | |
151 | > push_ssl = false |
|
151 | > push_ssl = false | |
152 | > allow_push = * |
|
152 | > allow_push = * | |
153 | > ! |
|
153 | > ! | |
154 | $ cd .. |
|
154 | $ cd .. | |
155 | $ hg clone r6 r7 |
|
155 | $ hg clone r6 r7 | |
156 | updating to branch default |
|
156 | updating to branch default | |
157 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
157 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
158 | $ cd r7 |
|
158 | $ cd r7 | |
159 | $ echo c2 > f2 |
|
159 | $ echo c2 > f2 | |
160 | $ hg add --large f2 |
|
160 | $ hg add --large f2 | |
161 | $ hg commit -m "m2" |
|
161 | $ hg commit -m "m2" | |
162 | Invoking status precommit hook |
|
162 | Invoking status precommit hook | |
163 | A f2 |
|
163 | A f2 | |
164 | $ hg verify --large |
|
164 | $ hg verify --large | |
165 | checking changesets |
|
165 | checking changesets | |
166 | checking manifests |
|
166 | checking manifests | |
167 | crosschecking files in changesets and manifests |
|
167 | crosschecking files in changesets and manifests | |
168 | checking files |
|
168 | checking files | |
169 | checked 2 changesets with 2 changes to 2 files |
|
169 | checked 2 changesets with 2 changes to 2 files | |
170 | searching 1 changesets for largefiles |
|
170 | searching 1 changesets for largefiles | |
171 | verified existence of 1 revisions of 1 largefiles |
|
171 | verified existence of 1 revisions of 1 largefiles | |
172 | $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid |
|
172 | $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid | |
173 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
173 | $ cat ../hg.pid >> $DAEMON_PIDS | |
174 | $ hg push http://localhost:$HGPORT |
|
174 | $ hg push http://localhost:$HGPORT | |
175 | pushing to http://localhost:$HGPORT/ |
|
175 | pushing to http://localhost:$HGPORT/ | |
176 | searching for changes |
|
176 | searching for changes | |
177 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
177 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store | |
178 | [255] |
|
178 | [255] | |
179 | $ cd .. |
|
179 | $ cd .. | |
180 |
|
180 | |||
181 | putlfile errors are shown (issue3123) |
|
181 | putlfile errors are shown (issue3123) | |
182 | Corrupt the cached largefile in r7 and move it out of the servers usercache |
|
182 | Corrupt the cached largefile in r7 and move it out of the servers usercache | |
183 | $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 . |
|
183 | $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 . | |
184 | $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
184 | $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
185 | $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" |
|
185 | $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" | |
186 | $ hg init empty |
|
186 | $ hg init empty | |
187 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
187 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ | |
188 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
188 | > --config 'web.allow_push=*' --config web.push_ssl=False | |
189 | $ cat hg.pid >> $DAEMON_PIDS |
|
189 | $ cat hg.pid >> $DAEMON_PIDS | |
190 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
190 | $ hg push -R r7 http://localhost:$HGPORT1 | |
191 | pushing to http://localhost:$HGPORT1/ |
|
191 | pushing to http://localhost:$HGPORT1/ | |
192 | searching for changes |
|
192 | searching for changes | |
193 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
193 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash | |
194 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ |
|
194 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ | |
195 | [255] |
|
195 | [255] | |
196 | $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
196 | $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
197 | Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic |
|
197 | Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic | |
198 | $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
198 | $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
199 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
199 | $ hg push -R r7 http://localhost:$HGPORT1 | |
200 | pushing to http://localhost:$HGPORT1/ |
|
200 | pushing to http://localhost:$HGPORT1/ | |
201 | searching for changes |
|
201 | searching for changes | |
202 | remote: adding changesets |
|
202 | remote: adding changesets | |
203 | remote: adding manifests |
|
203 | remote: adding manifests | |
204 | remote: adding file changes |
|
204 | remote: adding file changes | |
205 | remote: added 2 changesets with 2 changes to 2 files |
|
205 | remote: added 2 changesets with 2 changes to 2 files | |
206 | $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
206 | $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
207 | server side corruption |
|
207 | server side corruption | |
208 | $ rm -rf empty |
|
208 | $ rm -rf empty | |
209 |
|
209 | |||
210 | Push a largefiles repository to a served empty repository |
|
210 | Push a largefiles repository to a served empty repository | |
211 | $ hg init r8 |
|
211 | $ hg init r8 | |
212 | $ echo c3 > r8/f1 |
|
212 | $ echo c3 > r8/f1 | |
213 | $ hg add --large r8/f1 -R r8 |
|
213 | $ hg add --large r8/f1 -R r8 | |
214 | $ hg commit -m "m1" -R r8 |
|
214 | $ hg commit -m "m1" -R r8 | |
215 | Invoking status precommit hook |
|
215 | Invoking status precommit hook | |
216 | A f1 |
|
216 | A f1 | |
217 | $ hg init empty |
|
217 | $ hg init empty | |
218 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ |
|
218 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ | |
219 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
219 | > --config 'web.allow_push=*' --config web.push_ssl=False | |
220 | $ cat hg.pid >> $DAEMON_PIDS |
|
220 | $ cat hg.pid >> $DAEMON_PIDS | |
221 | $ rm "${USERCACHE}"/* |
|
221 | $ rm "${USERCACHE}"/* | |
222 | $ hg push -R r8 http://localhost:$HGPORT2/#default |
|
222 | $ hg push -R r8 http://localhost:$HGPORT2/#default | |
223 | pushing to http://localhost:$HGPORT2/ |
|
223 | pushing to http://localhost:$HGPORT2/ | |
224 | searching for changes |
|
224 | searching for changes | |
225 | remote: adding changesets |
|
225 | remote: adding changesets | |
226 | remote: adding manifests |
|
226 | remote: adding manifests | |
227 | remote: adding file changes |
|
227 | remote: adding file changes | |
228 | remote: added 1 changesets with 1 changes to 1 files |
|
228 | remote: added 1 changesets with 1 changes to 1 files | |
229 | $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
229 | $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] | |
230 | $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
230 | $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] | |
231 |
|
231 | |||
232 | Clone over http, no largefiles pulled on clone. |
|
232 | Clone over http, no largefiles pulled on clone. | |
233 |
|
233 | |||
234 | $ hg clone http://localhost:$HGPORT2/#default http-clone -U |
|
234 | $ hg clone http://localhost:$HGPORT2/#default http-clone -U | |
235 | adding changesets |
|
235 | adding changesets | |
236 | adding manifests |
|
236 | adding manifests | |
237 | adding file changes |
|
237 | adding file changes | |
238 | added 1 changesets with 1 changes to 1 files |
|
238 | added 1 changesets with 1 changes to 1 files | |
239 | new changesets cf03e5bb9936 (1 drafts) |
|
239 | new changesets cf03e5bb9936 (1 drafts) | |
240 |
|
240 | |||
241 | Archive contains largefiles |
|
241 | Archive contains largefiles | |
242 | >>> import os |
|
242 | >>> import os | |
243 | >>> import urllib2 |
|
243 | >>> import urllib2 | |
244 | >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2'] |
|
244 | >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2'] | |
245 | >>> with open('archive.zip', 'w') as f: |
|
245 | >>> with open('archive.zip', 'w') as f: | |
246 | ... f.write(urllib2.urlopen(u).read()) |
|
246 | ... f.write(urllib2.urlopen(u).read()) and None | |
247 |
$ |
|
247 | $ unzip -t archive.zip | |
248 | Archive: archive.zip |
|
248 | Archive: archive.zip | |
249 | testing: empty-default/.hg_archival.txt*OK (glob) |
|
249 | testing: empty-default/.hg_archival.txt*OK (glob) | |
250 | testing: empty-default/f1*OK (glob) |
|
250 | testing: empty-default/f1*OK (glob) | |
251 | No errors detected in compressed data of archive.zip. |
|
251 | No errors detected in compressed data of archive.zip. | |
252 |
|
252 | |||
253 | test 'verify' with remotestore: |
|
253 | test 'verify' with remotestore: | |
254 |
|
254 | |||
255 | $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
255 | $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
256 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . |
|
256 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . | |
257 | $ hg -R http-clone verify --large --lfa |
|
257 | $ hg -R http-clone verify --large --lfa | |
258 | checking changesets |
|
258 | checking changesets | |
259 | checking manifests |
|
259 | checking manifests | |
260 | crosschecking files in changesets and manifests |
|
260 | crosschecking files in changesets and manifests | |
261 | checking files |
|
261 | checking files | |
262 | checked 1 changesets with 1 changes to 1 files |
|
262 | checked 1 changesets with 1 changes to 1 files | |
263 | searching 1 changesets for largefiles |
|
263 | searching 1 changesets for largefiles | |
264 | changeset 0:cf03e5bb9936: f1 missing |
|
264 | changeset 0:cf03e5bb9936: f1 missing | |
265 | verified existence of 1 revisions of 1 largefiles |
|
265 | verified existence of 1 revisions of 1 largefiles | |
266 | [1] |
|
266 | [1] | |
267 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ |
|
267 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ | |
268 | $ hg -R http-clone -q verify --large --lfa |
|
268 | $ hg -R http-clone -q verify --large --lfa | |
269 |
|
269 | |||
270 | largefiles pulled on update - a largefile missing on the server: |
|
270 | largefiles pulled on update - a largefile missing on the server: | |
271 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . |
|
271 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . | |
272 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache |
|
272 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache | |
273 | getting changed largefiles |
|
273 | getting changed largefiles | |
274 | f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/ |
|
274 | f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/ | |
275 | 0 largefiles updated, 0 removed |
|
275 | 0 largefiles updated, 0 removed | |
276 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
276 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
277 | $ hg -R http-clone st |
|
277 | $ hg -R http-clone st | |
278 | ! f1 |
|
278 | ! f1 | |
279 | $ hg -R http-clone up -Cqr null |
|
279 | $ hg -R http-clone up -Cqr null | |
280 |
|
280 | |||
281 | largefiles pulled on update - a largefile corrupted on the server: |
|
281 | largefiles pulled on update - a largefile corrupted on the server: | |
282 | $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
282 | $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
283 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache |
|
283 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache | |
284 | getting changed largefiles |
|
284 | getting changed largefiles | |
285 | f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27) |
|
285 | f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27) | |
286 | 0 largefiles updated, 0 removed |
|
286 | 0 largefiles updated, 0 removed | |
287 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
287 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
288 | $ hg -R http-clone st |
|
288 | $ hg -R http-clone st | |
289 | ! f1 |
|
289 | ! f1 | |
290 | $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
290 | $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] | |
291 | $ [ ! -f http-clone/f1 ] |
|
291 | $ [ ! -f http-clone/f1 ] | |
292 | $ [ ! -f http-clone-usercache ] |
|
292 | $ [ ! -f http-clone-usercache ] | |
293 | $ hg -R http-clone verify --large --lfc |
|
293 | $ hg -R http-clone verify --large --lfc | |
294 | checking changesets |
|
294 | checking changesets | |
295 | checking manifests |
|
295 | checking manifests | |
296 | crosschecking files in changesets and manifests |
|
296 | crosschecking files in changesets and manifests | |
297 | checking files |
|
297 | checking files | |
298 | checked 1 changesets with 1 changes to 1 files |
|
298 | checked 1 changesets with 1 changes to 1 files | |
299 | searching 1 changesets for largefiles |
|
299 | searching 1 changesets for largefiles | |
300 | verified contents of 1 revisions of 1 largefiles |
|
300 | verified contents of 1 revisions of 1 largefiles | |
301 | $ hg -R http-clone up -Cqr null |
|
301 | $ hg -R http-clone up -Cqr null | |
302 |
|
302 | |||
303 | largefiles pulled on update - no server side problems: |
|
303 | largefiles pulled on update - no server side problems: | |
304 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ |
|
304 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ | |
305 | $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true |
|
305 | $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true | |
306 | resolving manifests |
|
306 | resolving manifests | |
307 | branchmerge: False, force: False, partial: False |
|
307 | branchmerge: False, force: False, partial: False | |
308 | ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936 |
|
308 | ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936 | |
309 | .hglf/f1: remote created -> g |
|
309 | .hglf/f1: remote created -> g | |
310 | getting .hglf/f1 |
|
310 | getting .hglf/f1 | |
311 | updating: .hglf/f1 1/1 files (100.00%) |
|
311 | updating: .hglf/f1 1/1 files (100.00%) | |
312 | getting changed largefiles |
|
312 | getting changed largefiles | |
313 | using http://localhost:$HGPORT2/ |
|
313 | using http://localhost:$HGPORT2/ | |
314 | sending capabilities command |
|
314 | sending capabilities command | |
315 | sending statlfile command |
|
315 | sending statlfile command | |
316 | getting largefiles: 0/1 files (0.00%) |
|
316 | getting largefiles: 0/1 files (0.00%) | |
317 | getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
317 | getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
318 | sending getlfile command |
|
318 | sending getlfile command | |
319 | found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store |
|
319 | found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store | |
320 | 1 largefiles updated, 0 removed |
|
320 | 1 largefiles updated, 0 removed | |
321 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
321 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
322 |
|
322 | |||
323 | $ ls http-clone-usercache/* |
|
323 | $ ls http-clone-usercache/* | |
324 | http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
324 | http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
325 |
|
325 | |||
326 | $ rm -rf empty http-clone* |
|
326 | $ rm -rf empty http-clone* | |
327 |
|
327 | |||
328 | used all HGPORTs, kill all daemons |
|
328 | used all HGPORTs, kill all daemons | |
329 | $ killdaemons.py |
|
329 | $ killdaemons.py | |
330 |
|
330 | |||
331 | largefiles should batch verify remote calls |
|
331 | largefiles should batch verify remote calls | |
332 |
|
332 | |||
333 | $ hg init batchverifymain |
|
333 | $ hg init batchverifymain | |
334 | $ cd batchverifymain |
|
334 | $ cd batchverifymain | |
335 | $ echo "aaa" >> a |
|
335 | $ echo "aaa" >> a | |
336 | $ hg add --large a |
|
336 | $ hg add --large a | |
337 | $ hg commit -m "a" |
|
337 | $ hg commit -m "a" | |
338 | Invoking status precommit hook |
|
338 | Invoking status precommit hook | |
339 | A a |
|
339 | A a | |
340 | $ echo "bbb" >> b |
|
340 | $ echo "bbb" >> b | |
341 | $ hg add --large b |
|
341 | $ hg add --large b | |
342 | $ hg commit -m "b" |
|
342 | $ hg commit -m "b" | |
343 | Invoking status precommit hook |
|
343 | Invoking status precommit hook | |
344 | A b |
|
344 | A b | |
345 | $ cd .. |
|
345 | $ cd .. | |
346 | $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \ |
|
346 | $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \ | |
347 | > -A access.log |
|
347 | > -A access.log | |
348 | $ cat hg.pid >> $DAEMON_PIDS |
|
348 | $ cat hg.pid >> $DAEMON_PIDS | |
349 | $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone |
|
349 | $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone | |
350 | requesting all changes |
|
350 | requesting all changes | |
351 | adding changesets |
|
351 | adding changesets | |
352 | adding manifests |
|
352 | adding manifests | |
353 | adding file changes |
|
353 | adding file changes | |
354 | added 2 changesets with 2 changes to 2 files |
|
354 | added 2 changesets with 2 changes to 2 files | |
355 | new changesets 567253b0f523:04d19c27a332 (2 drafts) |
|
355 | new changesets 567253b0f523:04d19c27a332 (2 drafts) | |
356 | $ hg -R batchverifyclone verify --large --lfa |
|
356 | $ hg -R batchverifyclone verify --large --lfa | |
357 | checking changesets |
|
357 | checking changesets | |
358 | checking manifests |
|
358 | checking manifests | |
359 | crosschecking files in changesets and manifests |
|
359 | crosschecking files in changesets and manifests | |
360 | checking files |
|
360 | checking files | |
361 | checked 2 changesets with 2 changes to 2 files |
|
361 | checked 2 changesets with 2 changes to 2 files | |
362 | searching 2 changesets for largefiles |
|
362 | searching 2 changesets for largefiles | |
363 | verified existence of 2 revisions of 2 largefiles |
|
363 | verified existence of 2 revisions of 2 largefiles | |
364 | $ tail -1 access.log |
|
364 | $ tail -1 access.log | |
365 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
365 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) | |
366 | $ hg -R batchverifyclone update |
|
366 | $ hg -R batchverifyclone update | |
367 | getting changed largefiles |
|
367 | getting changed largefiles | |
368 | 2 largefiles updated, 0 removed |
|
368 | 2 largefiles updated, 0 removed | |
369 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
369 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
370 |
|
370 | |||
371 | Clear log file before next test |
|
371 | Clear log file before next test | |
372 |
|
372 | |||
373 | $ printf "" > access.log |
|
373 | $ printf "" > access.log | |
374 |
|
374 | |||
375 | Verify should check file on remote server only when file is not |
|
375 | Verify should check file on remote server only when file is not | |
376 | available locally. |
|
376 | available locally. | |
377 |
|
377 | |||
378 | $ echo "ccc" >> batchverifymain/c |
|
378 | $ echo "ccc" >> batchverifymain/c | |
379 | $ hg -R batchverifymain status |
|
379 | $ hg -R batchverifymain status | |
380 | ? c |
|
380 | ? c | |
381 | $ hg -R batchverifymain add --large batchverifymain/c |
|
381 | $ hg -R batchverifymain add --large batchverifymain/c | |
382 | $ hg -R batchverifymain commit -m "c" |
|
382 | $ hg -R batchverifymain commit -m "c" | |
383 | Invoking status precommit hook |
|
383 | Invoking status precommit hook | |
384 | A c |
|
384 | A c | |
385 | $ hg -R batchverifyclone pull |
|
385 | $ hg -R batchverifyclone pull | |
386 | pulling from http://localhost:$HGPORT/ |
|
386 | pulling from http://localhost:$HGPORT/ | |
387 | searching for changes |
|
387 | searching for changes | |
388 | adding changesets |
|
388 | adding changesets | |
389 | adding manifests |
|
389 | adding manifests | |
390 | adding file changes |
|
390 | adding file changes | |
391 | added 1 changesets with 1 changes to 1 files |
|
391 | added 1 changesets with 1 changes to 1 files | |
392 | new changesets 6bba8cb6935d (1 drafts) |
|
392 | new changesets 6bba8cb6935d (1 drafts) | |
393 | (run 'hg update' to get a working copy) |
|
393 | (run 'hg update' to get a working copy) | |
394 | $ hg -R batchverifyclone verify --lfa |
|
394 | $ hg -R batchverifyclone verify --lfa | |
395 | checking changesets |
|
395 | checking changesets | |
396 | checking manifests |
|
396 | checking manifests | |
397 | crosschecking files in changesets and manifests |
|
397 | crosschecking files in changesets and manifests | |
398 | checking files |
|
398 | checking files | |
399 | checked 3 changesets with 3 changes to 3 files |
|
399 | checked 3 changesets with 3 changes to 3 files | |
400 | searching 3 changesets for largefiles |
|
400 | searching 3 changesets for largefiles | |
401 | verified existence of 3 revisions of 3 largefiles |
|
401 | verified existence of 3 revisions of 3 largefiles | |
402 | $ tail -1 access.log |
|
402 | $ tail -1 access.log | |
403 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
403 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) | |
404 |
|
404 | |||
405 | $ killdaemons.py |
|
405 | $ killdaemons.py | |
406 |
|
406 | |||
407 | largefiles should not ask for password again after successful authorization |
|
407 | largefiles should not ask for password again after successful authorization | |
408 |
|
408 | |||
409 | $ hg init credentialmain |
|
409 | $ hg init credentialmain | |
410 | $ cd credentialmain |
|
410 | $ cd credentialmain | |
411 | $ echo "aaa" >> a |
|
411 | $ echo "aaa" >> a | |
412 | $ hg add --large a |
|
412 | $ hg add --large a | |
413 | $ hg commit -m "a" |
|
413 | $ hg commit -m "a" | |
414 | Invoking status precommit hook |
|
414 | Invoking status precommit hook | |
415 | A a |
|
415 | A a | |
416 |
|
416 | |||
417 | Before running server clear the user cache to force clone to download |
|
417 | Before running server clear the user cache to force clone to download | |
418 | a large file from the server rather than to get it from the cache |
|
418 | a large file from the server rather than to get it from the cache | |
419 |
|
419 | |||
420 | $ rm "${USERCACHE}"/* |
|
420 | $ rm "${USERCACHE}"/* | |
421 |
|
421 | |||
422 | $ cd .. |
|
422 | $ cd .. | |
423 | $ cat << EOT > userpass.py |
|
423 | $ cat << EOT > userpass.py | |
424 | > import base64 |
|
424 | > import base64 | |
425 | > from mercurial.hgweb import common |
|
425 | > from mercurial.hgweb import common | |
426 | > def perform_authentication(hgweb, req, op): |
|
426 | > def perform_authentication(hgweb, req, op): | |
427 | > auth = req.headers.get(b'Authorization') |
|
427 | > auth = req.headers.get(b'Authorization') | |
428 | > if not auth: |
|
428 | > if not auth: | |
429 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', |
|
429 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', | |
430 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) |
|
430 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) | |
431 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']: |
|
431 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']: | |
432 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') |
|
432 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') | |
433 | > def extsetup(): |
|
433 | > def extsetup(): | |
434 | > common.permhooks.insert(0, perform_authentication) |
|
434 | > common.permhooks.insert(0, perform_authentication) | |
435 | > EOT |
|
435 | > EOT | |
436 | $ hg serve --config extensions.x=userpass.py -R credentialmain \ |
|
436 | $ hg serve --config extensions.x=userpass.py -R credentialmain \ | |
437 | > -d -p $HGPORT --pid-file hg.pid -A access.log |
|
437 | > -d -p $HGPORT --pid-file hg.pid -A access.log | |
438 | $ cat hg.pid >> $DAEMON_PIDS |
|
438 | $ cat hg.pid >> $DAEMON_PIDS | |
439 | $ cat << EOF > get_pass.py |
|
439 | $ cat << EOF > get_pass.py | |
440 | > import getpass |
|
440 | > import getpass | |
441 | > def newgetpass(arg): |
|
441 | > def newgetpass(arg): | |
442 | > return "pass" |
|
442 | > return "pass" | |
443 | > getpass.getpass = newgetpass |
|
443 | > getpass.getpass = newgetpass | |
444 | > EOF |
|
444 | > EOF | |
445 | $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \ |
|
445 | $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \ | |
446 | > http://user@localhost:$HGPORT credentialclone |
|
446 | > http://user@localhost:$HGPORT credentialclone | |
447 | http authorization required for http://localhost:$HGPORT/ |
|
447 | http authorization required for http://localhost:$HGPORT/ | |
448 | realm: mercurial |
|
448 | realm: mercurial | |
449 | user: user |
|
449 | user: user | |
450 | password: requesting all changes |
|
450 | password: requesting all changes | |
451 | adding changesets |
|
451 | adding changesets | |
452 | adding manifests |
|
452 | adding manifests | |
453 | adding file changes |
|
453 | adding file changes | |
454 | added 1 changesets with 1 changes to 1 files |
|
454 | added 1 changesets with 1 changes to 1 files | |
455 | new changesets 567253b0f523 (1 drafts) |
|
455 | new changesets 567253b0f523 (1 drafts) | |
456 | updating to branch default |
|
456 | updating to branch default | |
457 | getting changed largefiles |
|
457 | getting changed largefiles | |
458 | 1 largefiles updated, 0 removed |
|
458 | 1 largefiles updated, 0 removed | |
459 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
459 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
460 |
|
460 | |||
461 | $ killdaemons.py |
|
461 | $ killdaemons.py | |
462 | $ rm hg.pid access.log |
|
462 | $ rm hg.pid access.log | |
463 |
|
463 | |||
464 | #endif |
|
464 | #endif |
@@ -1,1172 +1,1172 b'' | |||||
1 | #require no-reposimplestore no-chg |
|
1 | #require no-reposimplestore no-chg | |
2 |
|
2 | |||
3 | $ hg init requirements |
|
3 | $ hg init requirements | |
4 | $ cd requirements |
|
4 | $ cd requirements | |
5 |
|
5 | |||
6 | # LFS not loaded by default. |
|
6 | # LFS not loaded by default. | |
7 |
|
7 | |||
8 | $ hg config extensions |
|
8 | $ hg config extensions | |
9 | [1] |
|
9 | [1] | |
10 |
|
10 | |||
11 | # Adding lfs to requires file will auto-load lfs extension. |
|
11 | # Adding lfs to requires file will auto-load lfs extension. | |
12 |
|
12 | |||
13 | $ echo lfs >> .hg/requires |
|
13 | $ echo lfs >> .hg/requires | |
14 | $ hg config extensions |
|
14 | $ hg config extensions | |
15 | extensions.lfs= |
|
15 | extensions.lfs= | |
16 |
|
16 | |||
17 | # But only if there is no config entry for the extension already. |
|
17 | # But only if there is no config entry for the extension already. | |
18 |
|
18 | |||
19 | $ cat > .hg/hgrc << EOF |
|
19 | $ cat > .hg/hgrc << EOF | |
20 | > [extensions] |
|
20 | > [extensions] | |
21 | > lfs=! |
|
21 | > lfs=! | |
22 | > EOF |
|
22 | > EOF | |
23 |
|
23 | |||
24 | $ hg config extensions |
|
24 | $ hg config extensions | |
25 | abort: repository requires features unknown to this Mercurial: lfs! |
|
25 | abort: repository requires features unknown to this Mercurial: lfs! | |
26 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
26 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
27 | [255] |
|
27 | [255] | |
28 |
|
28 | |||
29 | $ cat > .hg/hgrc << EOF |
|
29 | $ cat > .hg/hgrc << EOF | |
30 | > [extensions] |
|
30 | > [extensions] | |
31 | > lfs= |
|
31 | > lfs= | |
32 | > EOF |
|
32 | > EOF | |
33 |
|
33 | |||
34 | $ hg config extensions |
|
34 | $ hg config extensions | |
35 | extensions.lfs= |
|
35 | extensions.lfs= | |
36 |
|
36 | |||
37 | $ cat > .hg/hgrc << EOF |
|
37 | $ cat > .hg/hgrc << EOF | |
38 | > [extensions] |
|
38 | > [extensions] | |
39 | > lfs = missing.py |
|
39 | > lfs = missing.py | |
40 | > EOF |
|
40 | > EOF | |
41 |
|
41 | |||
42 | $ hg config extensions |
|
42 | $ hg config extensions | |
43 | *** failed to import extension lfs from missing.py: [Errno 2] $ENOENT$: 'missing.py' |
|
43 | *** failed to import extension lfs from missing.py: [Errno 2] $ENOENT$: 'missing.py' | |
44 | abort: repository requires features unknown to this Mercurial: lfs! |
|
44 | abort: repository requires features unknown to this Mercurial: lfs! | |
45 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
45 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
46 | [255] |
|
46 | [255] | |
47 |
|
47 | |||
48 | $ cd .. |
|
48 | $ cd .. | |
49 |
|
49 | |||
50 | # Initial setup |
|
50 | # Initial setup | |
51 |
|
51 | |||
52 | $ cat >> $HGRCPATH << EOF |
|
52 | $ cat >> $HGRCPATH << EOF | |
53 | > [extensions] |
|
53 | > [extensions] | |
54 | > lfs= |
|
54 | > lfs= | |
55 | > [lfs] |
|
55 | > [lfs] | |
56 | > # Test deprecated config |
|
56 | > # Test deprecated config | |
57 | > threshold=1000B |
|
57 | > threshold=1000B | |
58 | > EOF |
|
58 | > EOF | |
59 |
|
59 | |||
60 | $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
|
60 | $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
61 |
|
61 | |||
62 | # Prepare server and enable extension |
|
62 | # Prepare server and enable extension | |
63 | $ hg init server |
|
63 | $ hg init server | |
64 | $ hg clone -q server client |
|
64 | $ hg clone -q server client | |
65 | $ cd client |
|
65 | $ cd client | |
66 |
|
66 | |||
67 | # Commit small file |
|
67 | # Commit small file | |
68 | $ echo s > smallfile |
|
68 | $ echo s > smallfile | |
69 | $ echo '**.py = LF' > .hgeol |
|
69 | $ echo '**.py = LF' > .hgeol | |
70 | $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file" |
|
70 | $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file" | |
71 | hg: parse error: unsupported file pattern: size(">1000B") |
|
71 | hg: parse error: unsupported file pattern: size(">1000B") | |
72 | (paths must be prefixed with "path:") |
|
72 | (paths must be prefixed with "path:") | |
73 | [255] |
|
73 | [255] | |
74 | $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file" |
|
74 | $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file" | |
75 |
|
75 | |||
76 | # Commit large file |
|
76 | # Commit large file | |
77 | $ echo $LONG > largefile |
|
77 | $ echo $LONG > largefile | |
78 | $ grep lfs .hg/requires |
|
78 | $ grep lfs .hg/requires | |
79 | [1] |
|
79 | [1] | |
80 | $ hg commit --traceback -Aqm "add large file" |
|
80 | $ hg commit --traceback -Aqm "add large file" | |
81 | $ grep lfs .hg/requires |
|
81 | $ grep lfs .hg/requires | |
82 | lfs |
|
82 | lfs | |
83 |
|
83 | |||
84 | # Ensure metadata is stored |
|
84 | # Ensure metadata is stored | |
85 | $ hg debugdata largefile 0 |
|
85 | $ hg debugdata largefile 0 | |
86 | version https://git-lfs.github.com/spec/v1 |
|
86 | version https://git-lfs.github.com/spec/v1 | |
87 | oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
87 | oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
88 | size 1501 |
|
88 | size 1501 | |
89 | x-is-binary 0 |
|
89 | x-is-binary 0 | |
90 |
|
90 | |||
91 | # Check the blobstore is populated |
|
91 | # Check the blobstore is populated | |
92 | $ find .hg/store/lfs/objects | sort |
|
92 | $ find .hg/store/lfs/objects | sort | |
93 | .hg/store/lfs/objects |
|
93 | .hg/store/lfs/objects | |
94 | .hg/store/lfs/objects/f1 |
|
94 | .hg/store/lfs/objects/f1 | |
95 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
95 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
96 |
|
96 | |||
97 | # Check the blob stored contains the actual contents of the file |
|
97 | # Check the blob stored contains the actual contents of the file | |
98 | $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
98 | $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
99 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
|
99 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
100 |
|
100 | |||
101 | # Push changes to the server |
|
101 | # Push changes to the server | |
102 |
|
102 | |||
103 | $ hg push |
|
103 | $ hg push | |
104 | pushing to $TESTTMP/server |
|
104 | pushing to $TESTTMP/server | |
105 | searching for changes |
|
105 | searching for changes | |
106 | abort: lfs.url needs to be configured |
|
106 | abort: lfs.url needs to be configured | |
107 | [255] |
|
107 | [255] | |
108 |
|
108 | |||
109 | $ cat >> $HGRCPATH << EOF |
|
109 | $ cat >> $HGRCPATH << EOF | |
110 | > [lfs] |
|
110 | > [lfs] | |
111 | > url=file:$TESTTMP/dummy-remote/ |
|
111 | > url=file:$TESTTMP/dummy-remote/ | |
112 | > EOF |
|
112 | > EOF | |
113 |
|
113 | |||
114 | Push to a local non-lfs repo with the extension enabled will add the |
|
114 | Push to a local non-lfs repo with the extension enabled will add the | |
115 | lfs requirement |
|
115 | lfs requirement | |
116 |
|
116 | |||
117 | $ grep lfs $TESTTMP/server/.hg/requires |
|
117 | $ grep lfs $TESTTMP/server/.hg/requires | |
118 | [1] |
|
118 | [1] | |
119 | $ hg push -v | egrep -v '^(uncompressed| )' |
|
119 | $ hg push -v | egrep -v '^(uncompressed| )' | |
120 | pushing to $TESTTMP/server |
|
120 | pushing to $TESTTMP/server | |
121 | searching for changes |
|
121 | searching for changes | |
122 | lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store |
|
122 | lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store | |
123 | 2 changesets found |
|
123 | 2 changesets found | |
124 | adding changesets |
|
124 | adding changesets | |
125 | adding manifests |
|
125 | adding manifests | |
126 | adding file changes |
|
126 | adding file changes | |
127 | added 2 changesets with 3 changes to 3 files |
|
127 | added 2 changesets with 3 changes to 3 files | |
128 | calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs |
|
128 | calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs | |
129 | $ grep lfs $TESTTMP/server/.hg/requires |
|
129 | $ grep lfs $TESTTMP/server/.hg/requires | |
130 | lfs |
|
130 | lfs | |
131 |
|
131 | |||
132 | # Unknown URL scheme |
|
132 | # Unknown URL scheme | |
133 |
|
133 | |||
134 | $ hg push --config lfs.url=ftp://foobar |
|
134 | $ hg push --config lfs.url=ftp://foobar | |
135 | abort: lfs: unknown url scheme: ftp |
|
135 | abort: lfs: unknown url scheme: ftp | |
136 | [255] |
|
136 | [255] | |
137 |
|
137 | |||
138 | $ cd ../ |
|
138 | $ cd ../ | |
139 |
|
139 | |||
140 | # Initialize new client (not cloning) and setup extension |
|
140 | # Initialize new client (not cloning) and setup extension | |
141 | $ hg init client2 |
|
141 | $ hg init client2 | |
142 | $ cd client2 |
|
142 | $ cd client2 | |
143 | $ cat >> .hg/hgrc <<EOF |
|
143 | $ cat >> .hg/hgrc <<EOF | |
144 | > [paths] |
|
144 | > [paths] | |
145 | > default = $TESTTMP/server |
|
145 | > default = $TESTTMP/server | |
146 | > EOF |
|
146 | > EOF | |
147 |
|
147 | |||
148 | # Pull from server |
|
148 | # Pull from server | |
149 |
|
149 | |||
150 | Pulling a local lfs repo into a local non-lfs repo with the extension |
|
150 | Pulling a local lfs repo into a local non-lfs repo with the extension | |
151 | enabled adds the lfs requirement |
|
151 | enabled adds the lfs requirement | |
152 |
|
152 | |||
153 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires |
|
153 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires | |
154 | $TESTTMP/server/.hg/requires:lfs |
|
154 | $TESTTMP/server/.hg/requires:lfs | |
155 | $ hg pull default |
|
155 | $ hg pull default | |
156 | pulling from $TESTTMP/server |
|
156 | pulling from $TESTTMP/server | |
157 | requesting all changes |
|
157 | requesting all changes | |
158 | adding changesets |
|
158 | adding changesets | |
159 | adding manifests |
|
159 | adding manifests | |
160 | adding file changes |
|
160 | adding file changes | |
161 | added 2 changesets with 3 changes to 3 files |
|
161 | added 2 changesets with 3 changes to 3 files | |
162 | new changesets 0ead593177f7:b88141481348 |
|
162 | new changesets 0ead593177f7:b88141481348 | |
163 | (run 'hg update' to get a working copy) |
|
163 | (run 'hg update' to get a working copy) | |
164 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires |
|
164 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires | |
165 | .hg/requires:lfs |
|
165 | .hg/requires:lfs | |
166 | $TESTTMP/server/.hg/requires:lfs |
|
166 | $TESTTMP/server/.hg/requires:lfs | |
167 |
|
167 | |||
168 | # Check the blobstore is not yet populated |
|
168 | # Check the blobstore is not yet populated | |
169 | $ [ -d .hg/store/lfs/objects ] |
|
169 | $ [ -d .hg/store/lfs/objects ] | |
170 | [1] |
|
170 | [1] | |
171 |
|
171 | |||
172 | # Update to the last revision containing the large file |
|
172 | # Update to the last revision containing the large file | |
173 | $ hg update |
|
173 | $ hg update | |
174 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
174 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
175 |
|
175 | |||
176 | # Check the blobstore has been populated on update |
|
176 | # Check the blobstore has been populated on update | |
177 | $ find .hg/store/lfs/objects | sort |
|
177 | $ find .hg/store/lfs/objects | sort | |
178 | .hg/store/lfs/objects |
|
178 | .hg/store/lfs/objects | |
179 | .hg/store/lfs/objects/f1 |
|
179 | .hg/store/lfs/objects/f1 | |
180 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
180 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
181 |
|
181 | |||
182 | # Check the contents of the file are fetched from blobstore when requested |
|
182 | # Check the contents of the file are fetched from blobstore when requested | |
183 | $ hg cat -r . largefile |
|
183 | $ hg cat -r . largefile | |
184 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
|
184 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
185 |
|
185 | |||
186 | # Check the file has been copied in the working copy |
|
186 | # Check the file has been copied in the working copy | |
187 | $ cat largefile |
|
187 | $ cat largefile | |
188 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
|
188 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
189 |
|
189 | |||
190 | $ cd .. |
|
190 | $ cd .. | |
191 |
|
191 | |||
192 | # Check rename, and switch between large and small files |
|
192 | # Check rename, and switch between large and small files | |
193 |
|
193 | |||
194 | $ hg init repo3 |
|
194 | $ hg init repo3 | |
195 | $ cd repo3 |
|
195 | $ cd repo3 | |
196 | $ cat >> .hg/hgrc << EOF |
|
196 | $ cat >> .hg/hgrc << EOF | |
197 | > [lfs] |
|
197 | > [lfs] | |
198 | > track=size(">10B") |
|
198 | > track=size(">10B") | |
199 | > EOF |
|
199 | > EOF | |
200 |
|
200 | |||
201 | $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large |
|
201 | $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large | |
202 | $ echo SHORTER > small |
|
202 | $ echo SHORTER > small | |
203 | $ hg add . -q |
|
203 | $ hg add . -q | |
204 | $ hg commit -m 'commit with lfs content' |
|
204 | $ hg commit -m 'commit with lfs content' | |
205 |
|
205 | |||
206 | $ hg files -r . 'set:added()' |
|
206 | $ hg files -r . 'set:added()' | |
207 | large |
|
207 | large | |
208 | small |
|
208 | small | |
209 | $ hg files -r . 'set:added() & lfs()' |
|
209 | $ hg files -r . 'set:added() & lfs()' | |
210 | large |
|
210 | large | |
211 |
|
211 | |||
212 | $ hg mv large l |
|
212 | $ hg mv large l | |
213 | $ hg mv small s |
|
213 | $ hg mv small s | |
214 | $ hg status 'set:removed()' |
|
214 | $ hg status 'set:removed()' | |
215 | R large |
|
215 | R large | |
216 | R small |
|
216 | R small | |
217 | $ hg status 'set:removed() & lfs()' |
|
217 | $ hg status 'set:removed() & lfs()' | |
218 | R large |
|
218 | R large | |
219 | $ hg commit -m 'renames' |
|
219 | $ hg commit -m 'renames' | |
220 |
|
220 | |||
221 | $ hg files -r . 'set:copied()' |
|
221 | $ hg files -r . 'set:copied()' | |
222 | l |
|
222 | l | |
223 | s |
|
223 | s | |
224 | $ hg files -r . 'set:copied() & lfs()' |
|
224 | $ hg files -r . 'set:copied() & lfs()' | |
225 | l |
|
225 | l | |
226 | $ hg status --change . 'set:removed()' |
|
226 | $ hg status --change . 'set:removed()' | |
227 | R large |
|
227 | R large | |
228 | R small |
|
228 | R small | |
229 | $ hg status --change . 'set:removed() & lfs()' |
|
229 | $ hg status --change . 'set:removed() & lfs()' | |
230 | R large |
|
230 | R large | |
231 |
|
231 | |||
232 | $ echo SHORT > l |
|
232 | $ echo SHORT > l | |
233 | $ echo BECOME-LARGER-FROM-SHORTER > s |
|
233 | $ echo BECOME-LARGER-FROM-SHORTER > s | |
234 | $ hg commit -m 'large to small, small to large' |
|
234 | $ hg commit -m 'large to small, small to large' | |
235 |
|
235 | |||
236 | $ echo 1 >> l |
|
236 | $ echo 1 >> l | |
237 | $ echo 2 >> s |
|
237 | $ echo 2 >> s | |
238 | $ hg commit -m 'random modifications' |
|
238 | $ hg commit -m 'random modifications' | |
239 |
|
239 | |||
240 | $ echo RESTORE-TO-BE-LARGE > l |
|
240 | $ echo RESTORE-TO-BE-LARGE > l | |
241 | $ echo SHORTER > s |
|
241 | $ echo SHORTER > s | |
242 | $ hg commit -m 'switch large and small again' |
|
242 | $ hg commit -m 'switch large and small again' | |
243 |
|
243 | |||
244 | # Test lfs_files template |
|
244 | # Test lfs_files template | |
245 |
|
245 | |||
246 | $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n' |
|
246 | $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n' | |
247 | 0 large |
|
247 | 0 large | |
248 | 1 l, large |
|
248 | 1 l, large | |
249 | 2 s |
|
249 | 2 s | |
250 | 3 s |
|
250 | 3 s | |
251 | 4 l |
|
251 | 4 l | |
252 |
|
252 | |||
253 | # Push and pull the above repo |
|
253 | # Push and pull the above repo | |
254 |
|
254 | |||
255 | $ hg --cwd .. init repo4 |
|
255 | $ hg --cwd .. init repo4 | |
256 | $ hg push ../repo4 |
|
256 | $ hg push ../repo4 | |
257 | pushing to ../repo4 |
|
257 | pushing to ../repo4 | |
258 | searching for changes |
|
258 | searching for changes | |
259 | adding changesets |
|
259 | adding changesets | |
260 | adding manifests |
|
260 | adding manifests | |
261 | adding file changes |
|
261 | adding file changes | |
262 | added 5 changesets with 10 changes to 4 files |
|
262 | added 5 changesets with 10 changes to 4 files | |
263 |
|
263 | |||
264 | $ hg --cwd .. init repo5 |
|
264 | $ hg --cwd .. init repo5 | |
265 | $ hg --cwd ../repo5 pull ../repo3 |
|
265 | $ hg --cwd ../repo5 pull ../repo3 | |
266 | pulling from ../repo3 |
|
266 | pulling from ../repo3 | |
267 | requesting all changes |
|
267 | requesting all changes | |
268 | adding changesets |
|
268 | adding changesets | |
269 | adding manifests |
|
269 | adding manifests | |
270 | adding file changes |
|
270 | adding file changes | |
271 | added 5 changesets with 10 changes to 4 files |
|
271 | added 5 changesets with 10 changes to 4 files | |
272 | new changesets fd47a419c4f7:5adf850972b9 |
|
272 | new changesets fd47a419c4f7:5adf850972b9 | |
273 | (run 'hg update' to get a working copy) |
|
273 | (run 'hg update' to get a working copy) | |
274 |
|
274 | |||
275 | $ cd .. |
|
275 | $ cd .. | |
276 |
|
276 | |||
277 | # Test clone |
|
277 | # Test clone | |
278 |
|
278 | |||
279 | $ hg init repo6 |
|
279 | $ hg init repo6 | |
280 | $ cd repo6 |
|
280 | $ cd repo6 | |
281 | $ cat >> .hg/hgrc << EOF |
|
281 | $ cat >> .hg/hgrc << EOF | |
282 | > [lfs] |
|
282 | > [lfs] | |
283 | > track=size(">30B") |
|
283 | > track=size(">30B") | |
284 | > EOF |
|
284 | > EOF | |
285 |
|
285 | |||
286 | $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large |
|
286 | $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large | |
287 | $ echo SMALL > small |
|
287 | $ echo SMALL > small | |
288 | $ hg commit -Aqm 'create a lfs file' large small |
|
288 | $ hg commit -Aqm 'create a lfs file' large small | |
289 | $ hg debuglfsupload -r 'all()' -v |
|
289 | $ hg debuglfsupload -r 'all()' -v | |
290 | lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store |
|
290 | lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store | |
291 |
|
291 | |||
292 | $ cd .. |
|
292 | $ cd .. | |
293 |
|
293 | |||
294 | $ hg clone repo6 repo7 |
|
294 | $ hg clone repo6 repo7 | |
295 | updating to branch default |
|
295 | updating to branch default | |
296 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
296 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
297 | $ cd repo7 |
|
297 | $ cd repo7 | |
298 | $ cat large |
|
298 | $ cat large | |
299 | LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES |
|
299 | LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES | |
300 | $ cat small |
|
300 | $ cat small | |
301 | SMALL |
|
301 | SMALL | |
302 |
|
302 | |||
303 | $ cd .. |
|
303 | $ cd .. | |
304 |
|
304 | |||
305 | $ hg --config extensions.share= share repo7 sharedrepo |
|
305 | $ hg --config extensions.share= share repo7 sharedrepo | |
306 | updating working directory |
|
306 | updating working directory | |
307 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
307 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
308 | $ grep lfs sharedrepo/.hg/requires |
|
308 | $ grep lfs sharedrepo/.hg/requires | |
309 | lfs |
|
309 | lfs | |
310 |
|
310 | |||
311 | # Test rename and status |
|
311 | # Test rename and status | |
312 |
|
312 | |||
313 | $ hg init repo8 |
|
313 | $ hg init repo8 | |
314 | $ cd repo8 |
|
314 | $ cd repo8 | |
315 | $ cat >> .hg/hgrc << EOF |
|
315 | $ cat >> .hg/hgrc << EOF | |
316 | > [lfs] |
|
316 | > [lfs] | |
317 | > track=size(">10B") |
|
317 | > track=size(">10B") | |
318 | > EOF |
|
318 | > EOF | |
319 |
|
319 | |||
320 | $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1 |
|
320 | $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1 | |
321 | $ echo SMALL > a2 |
|
321 | $ echo SMALL > a2 | |
322 | $ hg commit -m a -A a1 a2 |
|
322 | $ hg commit -m a -A a1 a2 | |
323 | $ hg status |
|
323 | $ hg status | |
324 | $ hg mv a1 b1 |
|
324 | $ hg mv a1 b1 | |
325 | $ hg mv a2 a1 |
|
325 | $ hg mv a2 a1 | |
326 | $ hg mv b1 a2 |
|
326 | $ hg mv b1 a2 | |
327 | $ hg commit -m b |
|
327 | $ hg commit -m b | |
328 | $ hg status |
|
328 | $ hg status | |
329 | >>> with open('a2', 'wb') as f: |
|
329 | >>> with open('a2', 'wb') as f: | |
330 | ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA') |
|
330 | ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA') and None | |
331 | >>> with open('a1', 'wb') as f: |
|
331 | >>> with open('a1', 'wb') as f: | |
332 | ... f.write(b'\1\nMETA\n') |
|
332 | ... f.write(b'\1\nMETA\n') and None | |
333 |
$ |
|
333 | $ hg commit -m meta | |
334 | $ hg status |
|
334 | $ hg status | |
335 | $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n' |
|
335 | $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n' | |
336 | 2: | | |
|
336 | 2: | | | |
337 | 1: a1 (a2)a2 (a1) | | |
|
337 | 1: a1 (a2)a2 (a1) | | | |
338 | 0: | | a1 a2 |
|
338 | 0: | | a1 a2 | |
339 |
|
339 | |||
340 | $ for n in a1 a2; do |
|
340 | $ for n in a1 a2; do | |
341 | > for r in 0 1 2; do |
|
341 | > for r in 0 1 2; do | |
342 | > printf '\n%s @ %s\n' $n $r |
|
342 | > printf '\n%s @ %s\n' $n $r | |
343 | > hg debugdata $n $r |
|
343 | > hg debugdata $n $r | |
344 | > done |
|
344 | > done | |
345 | > done |
|
345 | > done | |
346 |
|
346 | |||
347 | a1 @ 0 |
|
347 | a1 @ 0 | |
348 | version https://git-lfs.github.com/spec/v1 |
|
348 | version https://git-lfs.github.com/spec/v1 | |
349 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
349 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
350 | size 29 |
|
350 | size 29 | |
351 | x-is-binary 0 |
|
351 | x-is-binary 0 | |
352 |
|
352 | |||
353 | a1 @ 1 |
|
353 | a1 @ 1 | |
354 | \x01 (esc) |
|
354 | \x01 (esc) | |
355 | copy: a2 |
|
355 | copy: a2 | |
356 | copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9 |
|
356 | copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9 | |
357 | \x01 (esc) |
|
357 | \x01 (esc) | |
358 | SMALL |
|
358 | SMALL | |
359 |
|
359 | |||
360 | a1 @ 2 |
|
360 | a1 @ 2 | |
361 | \x01 (esc) |
|
361 | \x01 (esc) | |
362 | \x01 (esc) |
|
362 | \x01 (esc) | |
363 | \x01 (esc) |
|
363 | \x01 (esc) | |
364 | META |
|
364 | META | |
365 |
|
365 | |||
366 | a2 @ 0 |
|
366 | a2 @ 0 | |
367 | SMALL |
|
367 | SMALL | |
368 |
|
368 | |||
369 | a2 @ 1 |
|
369 | a2 @ 1 | |
370 | version https://git-lfs.github.com/spec/v1 |
|
370 | version https://git-lfs.github.com/spec/v1 | |
371 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
371 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
372 | size 29 |
|
372 | size 29 | |
373 | x-hg-copy a1 |
|
373 | x-hg-copy a1 | |
374 | x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4 |
|
374 | x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4 | |
375 | x-is-binary 0 |
|
375 | x-is-binary 0 | |
376 |
|
376 | |||
377 | a2 @ 2 |
|
377 | a2 @ 2 | |
378 | version https://git-lfs.github.com/spec/v1 |
|
378 | version https://git-lfs.github.com/spec/v1 | |
379 | oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943 |
|
379 | oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943 | |
380 | size 32 |
|
380 | size 32 | |
381 | x-is-binary 0 |
|
381 | x-is-binary 0 | |
382 |
|
382 | |||
383 | # Verify commit hashes include rename metadata |
|
383 | # Verify commit hashes include rename metadata | |
384 |
|
384 | |||
385 | $ hg log -T '{rev}:{node|short} {desc}\n' |
|
385 | $ hg log -T '{rev}:{node|short} {desc}\n' | |
386 | 2:0fae949de7fa meta |
|
386 | 2:0fae949de7fa meta | |
387 | 1:9cd6bdffdac0 b |
|
387 | 1:9cd6bdffdac0 b | |
388 | 0:7f96794915f7 a |
|
388 | 0:7f96794915f7 a | |
389 |
|
389 | |||
390 | $ cd .. |
|
390 | $ cd .. | |
391 |
|
391 | |||
392 | # Test bundle |
|
392 | # Test bundle | |
393 |
|
393 | |||
394 | $ hg init repo9 |
|
394 | $ hg init repo9 | |
395 | $ cd repo9 |
|
395 | $ cd repo9 | |
396 | $ cat >> .hg/hgrc << EOF |
|
396 | $ cat >> .hg/hgrc << EOF | |
397 | > [lfs] |
|
397 | > [lfs] | |
398 | > track=size(">10B") |
|
398 | > track=size(">10B") | |
399 | > [diff] |
|
399 | > [diff] | |
400 | > git=1 |
|
400 | > git=1 | |
401 | > EOF |
|
401 | > EOF | |
402 |
|
402 | |||
403 | $ for i in 0 single two three 4; do |
|
403 | $ for i in 0 single two three 4; do | |
404 | > echo 'THIS-IS-LFS-'$i > a |
|
404 | > echo 'THIS-IS-LFS-'$i > a | |
405 | > hg commit -m a-$i -A a |
|
405 | > hg commit -m a-$i -A a | |
406 | > done |
|
406 | > done | |
407 |
|
407 | |||
408 | $ hg update 2 -q |
|
408 | $ hg update 2 -q | |
409 | $ echo 'THIS-IS-LFS-2-CHILD' > a |
|
409 | $ echo 'THIS-IS-LFS-2-CHILD' > a | |
410 | $ hg commit -m branching -q |
|
410 | $ hg commit -m branching -q | |
411 |
|
411 | |||
412 | $ hg bundle --base 1 bundle.hg -v |
|
412 | $ hg bundle --base 1 bundle.hg -v | |
413 | lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store |
|
413 | lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store | |
414 | lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store |
|
414 | lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store | |
415 | lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store |
|
415 | lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store | |
416 | lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store |
|
416 | lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store | |
417 | 4 changesets found |
|
417 | 4 changesets found | |
418 | uncompressed size of bundle content: |
|
418 | uncompressed size of bundle content: | |
419 | * (changelog) (glob) |
|
419 | * (changelog) (glob) | |
420 | * (manifests) (glob) |
|
420 | * (manifests) (glob) | |
421 | * a (glob) |
|
421 | * a (glob) | |
422 | $ hg --config extensions.strip= strip -r 2 --no-backup --force -q |
|
422 | $ hg --config extensions.strip= strip -r 2 --no-backup --force -q | |
423 | $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a |
|
423 | $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a | |
424 | 5 branching |
|
424 | 5 branching | |
425 | diff --git a/a b/a |
|
425 | diff --git a/a b/a | |
426 | --- a/a |
|
426 | --- a/a | |
427 | +++ b/a |
|
427 | +++ b/a | |
428 | @@ -1,1 +1,1 @@ |
|
428 | @@ -1,1 +1,1 @@ | |
429 | -THIS-IS-LFS-two |
|
429 | -THIS-IS-LFS-two | |
430 | +THIS-IS-LFS-2-CHILD |
|
430 | +THIS-IS-LFS-2-CHILD | |
431 |
|
431 | |||
432 | 4 a-4 |
|
432 | 4 a-4 | |
433 | diff --git a/a b/a |
|
433 | diff --git a/a b/a | |
434 | --- a/a |
|
434 | --- a/a | |
435 | +++ b/a |
|
435 | +++ b/a | |
436 | @@ -1,1 +1,1 @@ |
|
436 | @@ -1,1 +1,1 @@ | |
437 | -THIS-IS-LFS-three |
|
437 | -THIS-IS-LFS-three | |
438 | +THIS-IS-LFS-4 |
|
438 | +THIS-IS-LFS-4 | |
439 |
|
439 | |||
440 | 3 a-three |
|
440 | 3 a-three | |
441 | diff --git a/a b/a |
|
441 | diff --git a/a b/a | |
442 | --- a/a |
|
442 | --- a/a | |
443 | +++ b/a |
|
443 | +++ b/a | |
444 | @@ -1,1 +1,1 @@ |
|
444 | @@ -1,1 +1,1 @@ | |
445 | -THIS-IS-LFS-two |
|
445 | -THIS-IS-LFS-two | |
446 | +THIS-IS-LFS-three |
|
446 | +THIS-IS-LFS-three | |
447 |
|
447 | |||
448 | 2 a-two |
|
448 | 2 a-two | |
449 | diff --git a/a b/a |
|
449 | diff --git a/a b/a | |
450 | --- a/a |
|
450 | --- a/a | |
451 | +++ b/a |
|
451 | +++ b/a | |
452 | @@ -1,1 +1,1 @@ |
|
452 | @@ -1,1 +1,1 @@ | |
453 | -THIS-IS-LFS-single |
|
453 | -THIS-IS-LFS-single | |
454 | +THIS-IS-LFS-two |
|
454 | +THIS-IS-LFS-two | |
455 |
|
455 | |||
456 | 1 a-single |
|
456 | 1 a-single | |
457 | diff --git a/a b/a |
|
457 | diff --git a/a b/a | |
458 | --- a/a |
|
458 | --- a/a | |
459 | +++ b/a |
|
459 | +++ b/a | |
460 | @@ -1,1 +1,1 @@ |
|
460 | @@ -1,1 +1,1 @@ | |
461 | -THIS-IS-LFS-0 |
|
461 | -THIS-IS-LFS-0 | |
462 | +THIS-IS-LFS-single |
|
462 | +THIS-IS-LFS-single | |
463 |
|
463 | |||
464 | 0 a-0 |
|
464 | 0 a-0 | |
465 | diff --git a/a b/a |
|
465 | diff --git a/a b/a | |
466 | new file mode 100644 |
|
466 | new file mode 100644 | |
467 | --- /dev/null |
|
467 | --- /dev/null | |
468 | +++ b/a |
|
468 | +++ b/a | |
469 | @@ -0,0 +1,1 @@ |
|
469 | @@ -0,0 +1,1 @@ | |
470 | +THIS-IS-LFS-0 |
|
470 | +THIS-IS-LFS-0 | |
471 |
|
471 | |||
472 | $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q |
|
472 | $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q | |
473 | $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a |
|
473 | $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a | |
474 | 5 branching |
|
474 | 5 branching | |
475 | diff --git a/a b/a |
|
475 | diff --git a/a b/a | |
476 | --- a/a |
|
476 | --- a/a | |
477 | +++ b/a |
|
477 | +++ b/a | |
478 | @@ -1,1 +1,1 @@ |
|
478 | @@ -1,1 +1,1 @@ | |
479 | -THIS-IS-LFS-two |
|
479 | -THIS-IS-LFS-two | |
480 | +THIS-IS-LFS-2-CHILD |
|
480 | +THIS-IS-LFS-2-CHILD | |
481 |
|
481 | |||
482 | 4 a-4 |
|
482 | 4 a-4 | |
483 | diff --git a/a b/a |
|
483 | diff --git a/a b/a | |
484 | --- a/a |
|
484 | --- a/a | |
485 | +++ b/a |
|
485 | +++ b/a | |
486 | @@ -1,1 +1,1 @@ |
|
486 | @@ -1,1 +1,1 @@ | |
487 | -THIS-IS-LFS-three |
|
487 | -THIS-IS-LFS-three | |
488 | +THIS-IS-LFS-4 |
|
488 | +THIS-IS-LFS-4 | |
489 |
|
489 | |||
490 | 3 a-three |
|
490 | 3 a-three | |
491 | diff --git a/a b/a |
|
491 | diff --git a/a b/a | |
492 | --- a/a |
|
492 | --- a/a | |
493 | +++ b/a |
|
493 | +++ b/a | |
494 | @@ -1,1 +1,1 @@ |
|
494 | @@ -1,1 +1,1 @@ | |
495 | -THIS-IS-LFS-two |
|
495 | -THIS-IS-LFS-two | |
496 | +THIS-IS-LFS-three |
|
496 | +THIS-IS-LFS-three | |
497 |
|
497 | |||
498 | 2 a-two |
|
498 | 2 a-two | |
499 | diff --git a/a b/a |
|
499 | diff --git a/a b/a | |
500 | --- a/a |
|
500 | --- a/a | |
501 | +++ b/a |
|
501 | +++ b/a | |
502 | @@ -1,1 +1,1 @@ |
|
502 | @@ -1,1 +1,1 @@ | |
503 | -THIS-IS-LFS-single |
|
503 | -THIS-IS-LFS-single | |
504 | +THIS-IS-LFS-two |
|
504 | +THIS-IS-LFS-two | |
505 |
|
505 | |||
506 | 1 a-single |
|
506 | 1 a-single | |
507 | diff --git a/a b/a |
|
507 | diff --git a/a b/a | |
508 | --- a/a |
|
508 | --- a/a | |
509 | +++ b/a |
|
509 | +++ b/a | |
510 | @@ -1,1 +1,1 @@ |
|
510 | @@ -1,1 +1,1 @@ | |
511 | -THIS-IS-LFS-0 |
|
511 | -THIS-IS-LFS-0 | |
512 | +THIS-IS-LFS-single |
|
512 | +THIS-IS-LFS-single | |
513 |
|
513 | |||
514 | 0 a-0 |
|
514 | 0 a-0 | |
515 | diff --git a/a b/a |
|
515 | diff --git a/a b/a | |
516 | new file mode 100644 |
|
516 | new file mode 100644 | |
517 | --- /dev/null |
|
517 | --- /dev/null | |
518 | +++ b/a |
|
518 | +++ b/a | |
519 | @@ -0,0 +1,1 @@ |
|
519 | @@ -0,0 +1,1 @@ | |
520 | +THIS-IS-LFS-0 |
|
520 | +THIS-IS-LFS-0 | |
521 |
|
521 | |||
522 | $ cd .. |
|
522 | $ cd .. | |
523 |
|
523 | |||
524 | # Test isbinary |
|
524 | # Test isbinary | |
525 |
|
525 | |||
526 | $ hg init repo10 |
|
526 | $ hg init repo10 | |
527 | $ cd repo10 |
|
527 | $ cd repo10 | |
528 | $ cat >> .hg/hgrc << EOF |
|
528 | $ cat >> .hg/hgrc << EOF | |
529 | > [extensions] |
|
529 | > [extensions] | |
530 | > lfs= |
|
530 | > lfs= | |
531 | > [lfs] |
|
531 | > [lfs] | |
532 | > track=all() |
|
532 | > track=all() | |
533 | > EOF |
|
533 | > EOF | |
534 | $ "$PYTHON" <<'EOF' |
|
534 | $ "$PYTHON" <<'EOF' | |
535 | > def write(path, content): |
|
535 | > def write(path, content): | |
536 | > with open(path, 'wb') as f: |
|
536 | > with open(path, 'wb') as f: | |
537 | > f.write(content) |
|
537 | > f.write(content) | |
538 | > write('a', b'\0\0') |
|
538 | > write('a', b'\0\0') | |
539 | > write('b', b'\1\n') |
|
539 | > write('b', b'\1\n') | |
540 | > write('c', b'\1\n\0') |
|
540 | > write('c', b'\1\n\0') | |
541 | > write('d', b'xx') |
|
541 | > write('d', b'xx') | |
542 | > EOF |
|
542 | > EOF | |
543 | $ hg add a b c d |
|
543 | $ hg add a b c d | |
544 | $ hg diff --stat |
|
544 | $ hg diff --stat | |
545 | a | Bin |
|
545 | a | Bin | |
546 | b | 1 + |
|
546 | b | 1 + | |
547 | c | Bin |
|
547 | c | Bin | |
548 | d | 1 + |
|
548 | d | 1 + | |
549 | 4 files changed, 2 insertions(+), 0 deletions(-) |
|
549 | 4 files changed, 2 insertions(+), 0 deletions(-) | |
550 | $ hg commit -m binarytest |
|
550 | $ hg commit -m binarytest | |
551 | $ cat > $TESTTMP/dumpbinary.py << EOF |
|
551 | $ cat > $TESTTMP/dumpbinary.py << EOF | |
552 | > from mercurial.utils import ( |
|
552 | > from mercurial.utils import ( | |
553 | > stringutil, |
|
553 | > stringutil, | |
554 | > ) |
|
554 | > ) | |
555 | > def reposetup(ui, repo): |
|
555 | > def reposetup(ui, repo): | |
556 | > for n in (b'a', b'b', b'c', b'd'): |
|
556 | > for n in (b'a', b'b', b'c', b'd'): | |
557 | > ui.write((b'%s: binary=%s\n') |
|
557 | > ui.write((b'%s: binary=%s\n') | |
558 | > % (n, stringutil.pprint(repo[b'.'][n].isbinary()))) |
|
558 | > % (n, stringutil.pprint(repo[b'.'][n].isbinary()))) | |
559 | > EOF |
|
559 | > EOF | |
560 | $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace |
|
560 | $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace | |
561 | a: binary=True |
|
561 | a: binary=True | |
562 | b: binary=False |
|
562 | b: binary=False | |
563 | c: binary=True |
|
563 | c: binary=True | |
564 | d: binary=False |
|
564 | d: binary=False | |
565 | b55353847f02 tip |
|
565 | b55353847f02 tip | |
566 |
|
566 | |||
567 | Binary blobs don't need to be present to be skipped in filesets. (And their |
|
567 | Binary blobs don't need to be present to be skipped in filesets. (And their | |
568 | absence doesn't cause an abort.) |
|
568 | absence doesn't cause an abort.) | |
569 |
|
569 | |||
570 | $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7 |
|
570 | $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7 | |
571 | $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e |
|
571 | $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e | |
572 |
|
572 | |||
573 | $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True' |
|
573 | $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True' | |
574 | lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store |
|
574 | lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store | |
575 | 2 b |
|
575 | 2 b | |
576 | lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store |
|
576 | lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store | |
577 |
|
577 | |||
578 | $ hg files --debug -r . 'set:binary()' --config 'experimental.lfs.disableusercache=True' |
|
578 | $ hg files --debug -r . 'set:binary()' --config 'experimental.lfs.disableusercache=True' | |
579 | 2 a |
|
579 | 2 a | |
580 | 3 c |
|
580 | 3 c | |
581 |
|
581 | |||
582 | $ cd .. |
|
582 | $ cd .. | |
583 |
|
583 | |||
584 | # Test fctx.cmp fastpath - diff without LFS blobs |
|
584 | # Test fctx.cmp fastpath - diff without LFS blobs | |
585 |
|
585 | |||
586 | $ hg init repo12 |
|
586 | $ hg init repo12 | |
587 | $ cd repo12 |
|
587 | $ cd repo12 | |
588 | $ cat >> .hg/hgrc <<EOF |
|
588 | $ cat >> .hg/hgrc <<EOF | |
589 | > [lfs] |
|
589 | > [lfs] | |
590 | > threshold=1 |
|
590 | > threshold=1 | |
591 | > EOF |
|
591 | > EOF | |
592 | $ cat > ../patch.diff <<EOF |
|
592 | $ cat > ../patch.diff <<EOF | |
593 | > # HG changeset patch |
|
593 | > # HG changeset patch | |
594 | > 2 |
|
594 | > 2 | |
595 | > |
|
595 | > | |
596 | > diff --git a/a b/a |
|
596 | > diff --git a/a b/a | |
597 | > old mode 100644 |
|
597 | > old mode 100644 | |
598 | > new mode 100755 |
|
598 | > new mode 100755 | |
599 | > EOF |
|
599 | > EOF | |
600 |
|
600 | |||
601 | $ for i in 1 2 3; do |
|
601 | $ for i in 1 2 3; do | |
602 | > cp ../repo10/a a |
|
602 | > cp ../repo10/a a | |
603 | > if [ $i = 3 ]; then |
|
603 | > if [ $i = 3 ]; then | |
604 | > # make a content-only change |
|
604 | > # make a content-only change | |
605 | > hg import -q --bypass ../patch.diff |
|
605 | > hg import -q --bypass ../patch.diff | |
606 | > hg update -q |
|
606 | > hg update -q | |
607 | > rm ../patch.diff |
|
607 | > rm ../patch.diff | |
608 | > else |
|
608 | > else | |
609 | > echo $i >> a |
|
609 | > echo $i >> a | |
610 | > hg commit -m $i -A a |
|
610 | > hg commit -m $i -A a | |
611 | > fi |
|
611 | > fi | |
612 | > done |
|
612 | > done | |
613 | $ [ -d .hg/store/lfs/objects ] |
|
613 | $ [ -d .hg/store/lfs/objects ] | |
614 |
|
614 | |||
615 | $ cd .. |
|
615 | $ cd .. | |
616 |
|
616 | |||
617 | $ hg clone repo12 repo13 --noupdate |
|
617 | $ hg clone repo12 repo13 --noupdate | |
618 | $ cd repo13 |
|
618 | $ cd repo13 | |
619 | $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git |
|
619 | $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git | |
620 | 2 |
|
620 | 2 | |
621 | diff --git a/a b/a |
|
621 | diff --git a/a b/a | |
622 | old mode 100644 |
|
622 | old mode 100644 | |
623 | new mode 100755 |
|
623 | new mode 100755 | |
624 |
|
624 | |||
625 | 2 |
|
625 | 2 | |
626 | diff --git a/a b/a |
|
626 | diff --git a/a b/a | |
627 | Binary file a has changed |
|
627 | Binary file a has changed | |
628 |
|
628 | |||
629 | 1 |
|
629 | 1 | |
630 | diff --git a/a b/a |
|
630 | diff --git a/a b/a | |
631 | new file mode 100644 |
|
631 | new file mode 100644 | |
632 | Binary file a has changed |
|
632 | Binary file a has changed | |
633 |
|
633 | |||
634 | $ [ -d .hg/store/lfs/objects ] |
|
634 | $ [ -d .hg/store/lfs/objects ] | |
635 | [1] |
|
635 | [1] | |
636 |
|
636 | |||
637 | $ cd .. |
|
637 | $ cd .. | |
638 |
|
638 | |||
639 | # Test filter |
|
639 | # Test filter | |
640 |
|
640 | |||
641 | $ hg init repo11 |
|
641 | $ hg init repo11 | |
642 | $ cd repo11 |
|
642 | $ cd repo11 | |
643 | $ cat >> .hg/hgrc << EOF |
|
643 | $ cat >> .hg/hgrc << EOF | |
644 | > [lfs] |
|
644 | > [lfs] | |
645 | > track=(**.a & size(">5B")) | (**.b & !size(">5B")) |
|
645 | > track=(**.a & size(">5B")) | (**.b & !size(">5B")) | |
646 | > | (**.c & "path:d" & !"path:d/c.c") | size(">10B") |
|
646 | > | (**.c & "path:d" & !"path:d/c.c") | size(">10B") | |
647 | > EOF |
|
647 | > EOF | |
648 |
|
648 | |||
649 | $ mkdir a |
|
649 | $ mkdir a | |
650 | $ echo aaaaaa > a/1.a |
|
650 | $ echo aaaaaa > a/1.a | |
651 | $ echo a > a/2.a |
|
651 | $ echo a > a/2.a | |
652 | $ echo aaaaaa > 1.b |
|
652 | $ echo aaaaaa > 1.b | |
653 | $ echo a > 2.b |
|
653 | $ echo a > 2.b | |
654 | $ echo a > 1.c |
|
654 | $ echo a > 1.c | |
655 | $ mkdir d |
|
655 | $ mkdir d | |
656 | $ echo a > d/c.c |
|
656 | $ echo a > d/c.c | |
657 | $ echo a > d/d.c |
|
657 | $ echo a > d/d.c | |
658 | $ echo aaaaaaaaaaaa > x |
|
658 | $ echo aaaaaaaaaaaa > x | |
659 | $ hg add . -q |
|
659 | $ hg add . -q | |
660 | $ hg commit -m files |
|
660 | $ hg commit -m files | |
661 |
|
661 | |||
662 | $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do |
|
662 | $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do | |
663 | > if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then |
|
663 | > if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then | |
664 | > echo "${p}: is lfs" |
|
664 | > echo "${p}: is lfs" | |
665 | > else |
|
665 | > else | |
666 | > echo "${p}: not lfs" |
|
666 | > echo "${p}: not lfs" | |
667 | > fi |
|
667 | > fi | |
668 | > done |
|
668 | > done | |
669 | a/1.a: is lfs |
|
669 | a/1.a: is lfs | |
670 | a/2.a: not lfs |
|
670 | a/2.a: not lfs | |
671 | 1.b: not lfs |
|
671 | 1.b: not lfs | |
672 | 2.b: is lfs |
|
672 | 2.b: is lfs | |
673 | 1.c: not lfs |
|
673 | 1.c: not lfs | |
674 | d/c.c: not lfs |
|
674 | d/c.c: not lfs | |
675 | d/d.c: is lfs |
|
675 | d/d.c: is lfs | |
676 | x: is lfs |
|
676 | x: is lfs | |
677 |
|
677 | |||
678 | $ cd .. |
|
678 | $ cd .. | |
679 |
|
679 | |||
680 | # Verify the repos |
|
680 | # Verify the repos | |
681 |
|
681 | |||
682 | $ cat > $TESTTMP/dumpflog.py << EOF |
|
682 | $ cat > $TESTTMP/dumpflog.py << EOF | |
683 | > # print raw revision sizes, flags, and hashes for certain files |
|
683 | > # print raw revision sizes, flags, and hashes for certain files | |
684 | > import hashlib |
|
684 | > import hashlib | |
685 | > from mercurial.node import short |
|
685 | > from mercurial.node import short | |
686 | > from mercurial import ( |
|
686 | > from mercurial import ( | |
687 | > pycompat, |
|
687 | > pycompat, | |
688 | > revlog, |
|
688 | > revlog, | |
689 | > ) |
|
689 | > ) | |
690 | > from mercurial.utils import ( |
|
690 | > from mercurial.utils import ( | |
691 | > stringutil, |
|
691 | > stringutil, | |
692 | > ) |
|
692 | > ) | |
693 | > def hash(rawtext): |
|
693 | > def hash(rawtext): | |
694 | > h = hashlib.sha512() |
|
694 | > h = hashlib.sha512() | |
695 | > h.update(rawtext) |
|
695 | > h.update(rawtext) | |
696 | > return pycompat.sysbytes(h.hexdigest()[:4]) |
|
696 | > return pycompat.sysbytes(h.hexdigest()[:4]) | |
697 | > def reposetup(ui, repo): |
|
697 | > def reposetup(ui, repo): | |
698 | > # these 2 files are interesting |
|
698 | > # these 2 files are interesting | |
699 | > for name in [b'l', b's']: |
|
699 | > for name in [b'l', b's']: | |
700 | > fl = repo.file(name) |
|
700 | > fl = repo.file(name) | |
701 | > if len(fl) == 0: |
|
701 | > if len(fl) == 0: | |
702 | > continue |
|
702 | > continue | |
703 | > sizes = [fl._revlog.rawsize(i) for i in fl] |
|
703 | > sizes = [fl._revlog.rawsize(i) for i in fl] | |
704 | > texts = [fl.revision(i, raw=True) for i in fl] |
|
704 | > texts = [fl.revision(i, raw=True) for i in fl] | |
705 | > flags = [int(fl._revlog.flags(i)) for i in fl] |
|
705 | > flags = [int(fl._revlog.flags(i)) for i in fl] | |
706 | > hashes = [hash(t) for t in texts] |
|
706 | > hashes = [hash(t) for t in texts] | |
707 | > pycompat.stdout.write(b' %s: rawsizes=%r flags=%r hashes=%s\n' |
|
707 | > pycompat.stdout.write(b' %s: rawsizes=%r flags=%r hashes=%s\n' | |
708 | > % (name, sizes, flags, stringutil.pprint(hashes))) |
|
708 | > % (name, sizes, flags, stringutil.pprint(hashes))) | |
709 | > EOF |
|
709 | > EOF | |
710 |
|
710 | |||
711 | $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \ |
|
711 | $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \ | |
712 | > repo10; do |
|
712 | > repo10; do | |
713 | > echo 'repo:' $i |
|
713 | > echo 'repo:' $i | |
714 | > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q |
|
714 | > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q | |
715 | > done |
|
715 | > done | |
716 | repo: client |
|
716 | repo: client | |
717 | repo: client2 |
|
717 | repo: client2 | |
718 | repo: server |
|
718 | repo: server | |
719 | repo: repo3 |
|
719 | repo: repo3 | |
720 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] |
|
720 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] | |
721 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] |
|
721 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] | |
722 | repo: repo4 |
|
722 | repo: repo4 | |
723 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] |
|
723 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] | |
724 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] |
|
724 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] | |
725 | repo: repo5 |
|
725 | repo: repo5 | |
726 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] |
|
726 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] | |
727 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] |
|
727 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] | |
728 | repo: repo6 |
|
728 | repo: repo6 | |
729 | repo: repo7 |
|
729 | repo: repo7 | |
730 | repo: repo8 |
|
730 | repo: repo8 | |
731 | repo: repo9 |
|
731 | repo: repo9 | |
732 | repo: repo10 |
|
732 | repo: repo10 | |
733 |
|
733 | |||
734 | repo13 doesn't have any cached lfs files and its source never pushed its |
|
734 | repo13 doesn't have any cached lfs files and its source never pushed its | |
735 | files. Therefore, the files don't exist in the remote store. Use the files in |
|
735 | files. Therefore, the files don't exist in the remote store. Use the files in | |
736 | the user cache. |
|
736 | the user cache. | |
737 |
|
737 | |||
738 | $ test -d $TESTTMP/repo13/.hg/store/lfs/objects |
|
738 | $ test -d $TESTTMP/repo13/.hg/store/lfs/objects | |
739 | [1] |
|
739 | [1] | |
740 |
|
740 | |||
741 | $ hg --config extensions.share= share repo13 repo14 |
|
741 | $ hg --config extensions.share= share repo13 repo14 | |
742 | updating working directory |
|
742 | updating working directory | |
743 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
743 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
744 | $ hg -R repo14 -q verify |
|
744 | $ hg -R repo14 -q verify | |
745 |
|
745 | |||
746 | $ hg clone repo13 repo15 |
|
746 | $ hg clone repo13 repo15 | |
747 | updating to branch default |
|
747 | updating to branch default | |
748 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
748 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
749 | $ hg -R repo15 -q verify |
|
749 | $ hg -R repo15 -q verify | |
750 |
|
750 | |||
751 | If the source repo doesn't have the blob (maybe it was pulled or cloned with |
|
751 | If the source repo doesn't have the blob (maybe it was pulled or cloned with | |
752 | --noupdate), the blob is still accessible via the global cache to send to the |
|
752 | --noupdate), the blob is still accessible via the global cache to send to the | |
753 | remote store. |
|
753 | remote store. | |
754 |
|
754 | |||
755 | $ rm -rf $TESTTMP/repo15/.hg/store/lfs |
|
755 | $ rm -rf $TESTTMP/repo15/.hg/store/lfs | |
756 | $ hg init repo16 |
|
756 | $ hg init repo16 | |
757 | $ hg -R repo15 push repo16 |
|
757 | $ hg -R repo15 push repo16 | |
758 | pushing to repo16 |
|
758 | pushing to repo16 | |
759 | searching for changes |
|
759 | searching for changes | |
760 | adding changesets |
|
760 | adding changesets | |
761 | adding manifests |
|
761 | adding manifests | |
762 | adding file changes |
|
762 | adding file changes | |
763 | added 3 changesets with 2 changes to 1 files |
|
763 | added 3 changesets with 2 changes to 1 files | |
764 | $ hg -R repo15 -q verify |
|
764 | $ hg -R repo15 -q verify | |
765 |
|
765 | |||
766 | Test damaged file scenarios. (This also damages the usercache because of the |
|
766 | Test damaged file scenarios. (This also damages the usercache because of the | |
767 | hardlinks.) |
|
767 | hardlinks.) | |
768 |
|
768 | |||
769 | $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
769 | $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
770 |
|
770 | |||
771 | Repo with damaged lfs objects in any revision will fail verification. |
|
771 | Repo with damaged lfs objects in any revision will fail verification. | |
772 |
|
772 | |||
773 | $ hg -R repo5 verify |
|
773 | $ hg -R repo5 verify | |
774 | checking changesets |
|
774 | checking changesets | |
775 | checking manifests |
|
775 | checking manifests | |
776 | crosschecking files in changesets and manifests |
|
776 | crosschecking files in changesets and manifests | |
777 | checking files |
|
777 | checking files | |
778 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
778 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
779 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
779 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
780 | checked 5 changesets with 10 changes to 4 files |
|
780 | checked 5 changesets with 10 changes to 4 files | |
781 | 2 integrity errors encountered! |
|
781 | 2 integrity errors encountered! | |
782 | (first damaged changeset appears to be 0) |
|
782 | (first damaged changeset appears to be 0) | |
783 | [1] |
|
783 | [1] | |
784 |
|
784 | |||
785 | Updates work after cloning a damaged repo, if the damaged lfs objects aren't in |
|
785 | Updates work after cloning a damaged repo, if the damaged lfs objects aren't in | |
786 | the update destination. Those objects won't be added to the new repo's store |
|
786 | the update destination. Those objects won't be added to the new repo's store | |
787 | because they aren't accessed. |
|
787 | because they aren't accessed. | |
788 |
|
788 | |||
789 | $ hg clone -v repo5 fromcorrupt |
|
789 | $ hg clone -v repo5 fromcorrupt | |
790 | updating to branch default |
|
790 | updating to branch default | |
791 | resolving manifests |
|
791 | resolving manifests | |
792 | getting l |
|
792 | getting l | |
793 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache |
|
793 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache | |
794 | getting s |
|
794 | getting s | |
795 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
795 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
796 | $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
796 | $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
797 | [1] |
|
797 | [1] | |
798 |
|
798 | |||
799 | Verify will copy/link all lfs objects into the local store that aren't already |
|
799 | Verify will copy/link all lfs objects into the local store that aren't already | |
800 | present. Bypass the corrupted usercache to show that verify works when fed by |
|
800 | present. Bypass the corrupted usercache to show that verify works when fed by | |
801 | the (uncorrupted) remote store. |
|
801 | the (uncorrupted) remote store. | |
802 |
|
802 | |||
803 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v |
|
803 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v | |
804 | repository uses revlog format 1 |
|
804 | repository uses revlog format 1 | |
805 | checking changesets |
|
805 | checking changesets | |
806 | checking manifests |
|
806 | checking manifests | |
807 | crosschecking files in changesets and manifests |
|
807 | crosschecking files in changesets and manifests | |
808 | checking files |
|
808 | checking files | |
809 | lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache |
|
809 | lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache | |
810 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store |
|
810 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store | |
811 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
811 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
812 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store |
|
812 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store | |
813 | lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache |
|
813 | lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache | |
814 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
814 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
815 | lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache |
|
815 | lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache | |
816 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
816 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
817 | checked 5 changesets with 10 changes to 4 files |
|
817 | checked 5 changesets with 10 changes to 4 files | |
818 |
|
818 | |||
819 | Verify will not copy/link a corrupted file from the usercache into the local |
|
819 | Verify will not copy/link a corrupted file from the usercache into the local | |
820 | store, and poison it. (The verify with a good remote now works.) |
|
820 | store, and poison it. (The verify with a good remote now works.) | |
821 |
|
821 | |||
822 | $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
822 | $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
823 | $ hg -R fromcorrupt verify -v |
|
823 | $ hg -R fromcorrupt verify -v | |
824 | repository uses revlog format 1 |
|
824 | repository uses revlog format 1 | |
825 | checking changesets |
|
825 | checking changesets | |
826 | checking manifests |
|
826 | checking manifests | |
827 | crosschecking files in changesets and manifests |
|
827 | crosschecking files in changesets and manifests | |
828 | checking files |
|
828 | checking files | |
829 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
829 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
830 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
830 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
831 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
831 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
832 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
832 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
833 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
833 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
834 | checked 5 changesets with 10 changes to 4 files |
|
834 | checked 5 changesets with 10 changes to 4 files | |
835 | 2 integrity errors encountered! |
|
835 | 2 integrity errors encountered! | |
836 | (first damaged changeset appears to be 0) |
|
836 | (first damaged changeset appears to be 0) | |
837 | [1] |
|
837 | [1] | |
838 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v |
|
838 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v | |
839 | repository uses revlog format 1 |
|
839 | repository uses revlog format 1 | |
840 | checking changesets |
|
840 | checking changesets | |
841 | checking manifests |
|
841 | checking manifests | |
842 | crosschecking files in changesets and manifests |
|
842 | crosschecking files in changesets and manifests | |
843 | checking files |
|
843 | checking files | |
844 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache |
|
844 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache | |
845 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
845 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
846 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store |
|
846 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store | |
847 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
847 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
848 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
848 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
849 | checked 5 changesets with 10 changes to 4 files |
|
849 | checked 5 changesets with 10 changes to 4 files | |
850 |
|
850 | |||
851 | Damaging a file required by the update destination fails the update. |
|
851 | Damaging a file required by the update destination fails the update. | |
852 |
|
852 | |||
853 | $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
853 | $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
854 | $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2 |
|
854 | $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2 | |
855 | updating to branch default |
|
855 | updating to branch default | |
856 | resolving manifests |
|
856 | resolving manifests | |
857 | abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
857 | abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
858 | [255] |
|
858 | [255] | |
859 |
|
859 | |||
860 | A corrupted lfs blob is not transferred from a file://remotestore to the |
|
860 | A corrupted lfs blob is not transferred from a file://remotestore to the | |
861 | usercache or local store. |
|
861 | usercache or local store. | |
862 |
|
862 | |||
863 | $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
863 | $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
864 | [1] |
|
864 | [1] | |
865 | $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
865 | $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
866 | [1] |
|
866 | [1] | |
867 |
|
867 | |||
868 | $ hg -R fromcorrupt2 verify |
|
868 | $ hg -R fromcorrupt2 verify | |
869 | checking changesets |
|
869 | checking changesets | |
870 | checking manifests |
|
870 | checking manifests | |
871 | crosschecking files in changesets and manifests |
|
871 | crosschecking files in changesets and manifests | |
872 | checking files |
|
872 | checking files | |
873 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
873 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
874 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
874 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
875 | checked 5 changesets with 10 changes to 4 files |
|
875 | checked 5 changesets with 10 changes to 4 files | |
876 | 2 integrity errors encountered! |
|
876 | 2 integrity errors encountered! | |
877 | (first damaged changeset appears to be 0) |
|
877 | (first damaged changeset appears to be 0) | |
878 | [1] |
|
878 | [1] | |
879 |
|
879 | |||
880 | Corrupt local files are not sent upstream. (The alternate dummy remote |
|
880 | Corrupt local files are not sent upstream. (The alternate dummy remote | |
881 | avoids the corrupt lfs object in the original remote.) |
|
881 | avoids the corrupt lfs object in the original remote.) | |
882 |
|
882 | |||
883 | $ mkdir $TESTTMP/dummy-remote2 |
|
883 | $ mkdir $TESTTMP/dummy-remote2 | |
884 | $ hg init dest |
|
884 | $ hg init dest | |
885 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest |
|
885 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest | |
886 | pushing to dest |
|
886 | pushing to dest | |
887 | searching for changes |
|
887 | searching for changes | |
888 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
888 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
889 | abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
889 | abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
890 | (run hg verify) |
|
890 | (run hg verify) | |
891 | [255] |
|
891 | [255] | |
892 |
|
892 | |||
893 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v |
|
893 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v | |
894 | repository uses revlog format 1 |
|
894 | repository uses revlog format 1 | |
895 | checking changesets |
|
895 | checking changesets | |
896 | checking manifests |
|
896 | checking manifests | |
897 | crosschecking files in changesets and manifests |
|
897 | crosschecking files in changesets and manifests | |
898 | checking files |
|
898 | checking files | |
899 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
899 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
900 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
900 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
901 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
901 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
902 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
902 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
903 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
903 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
904 | checked 5 changesets with 10 changes to 4 files |
|
904 | checked 5 changesets with 10 changes to 4 files | |
905 | 2 integrity errors encountered! |
|
905 | 2 integrity errors encountered! | |
906 | (first damaged changeset appears to be 0) |
|
906 | (first damaged changeset appears to be 0) | |
907 | [1] |
|
907 | [1] | |
908 |
|
908 | |||
909 | $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 |
|
909 | $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | |
910 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
910 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
911 | $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 |
|
911 | $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | |
912 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
912 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
913 | $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
913 | $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
914 | [1] |
|
914 | [1] | |
915 |
|
915 | |||
916 | Accessing a corrupt file will complain |
|
916 | Accessing a corrupt file will complain | |
917 |
|
917 | |||
918 | $ hg --cwd fromcorrupt2 cat -r 0 large |
|
918 | $ hg --cwd fromcorrupt2 cat -r 0 large | |
919 | abort: integrity check failed on data/large.i:0! |
|
919 | abort: integrity check failed on data/large.i:0! | |
920 | [255] |
|
920 | [255] | |
921 |
|
921 | |||
922 | lfs -> normal -> lfs round trip conversions are possible. The 'none()' |
|
922 | lfs -> normal -> lfs round trip conversions are possible. The 'none()' | |
923 | predicate on the command line will override whatever is configured globally and |
|
923 | predicate on the command line will override whatever is configured globally and | |
924 | locally, and ensures everything converts to a regular file. For lfs -> normal, |
|
924 | locally, and ensures everything converts to a regular file. For lfs -> normal, | |
925 | there's no 'lfs' destination repo requirement. For normal -> lfs, there is. |
|
925 | there's no 'lfs' destination repo requirement. For normal -> lfs, there is. | |
926 |
|
926 | |||
927 | $ hg --config extensions.convert= --config 'lfs.track=none()' \ |
|
927 | $ hg --config extensions.convert= --config 'lfs.track=none()' \ | |
928 | > convert repo8 convert_normal |
|
928 | > convert repo8 convert_normal | |
929 | initializing destination convert_normal repository |
|
929 | initializing destination convert_normal repository | |
930 | scanning source... |
|
930 | scanning source... | |
931 | sorting... |
|
931 | sorting... | |
932 | converting... |
|
932 | converting... | |
933 | 2 a |
|
933 | 2 a | |
934 | 1 b |
|
934 | 1 b | |
935 | 0 meta |
|
935 | 0 meta | |
936 | $ grep 'lfs' convert_normal/.hg/requires |
|
936 | $ grep 'lfs' convert_normal/.hg/requires | |
937 | [1] |
|
937 | [1] | |
938 | $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}' |
|
938 | $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}' | |
939 | THIS-IS-LFS-BECAUSE-10-BYTES |
|
939 | THIS-IS-LFS-BECAUSE-10-BYTES | |
940 |
|
940 | |||
941 | $ hg --config extensions.convert= --config lfs.threshold=10B \ |
|
941 | $ hg --config extensions.convert= --config lfs.threshold=10B \ | |
942 | > convert convert_normal convert_lfs |
|
942 | > convert convert_normal convert_lfs | |
943 | initializing destination convert_lfs repository |
|
943 | initializing destination convert_lfs repository | |
944 | scanning source... |
|
944 | scanning source... | |
945 | sorting... |
|
945 | sorting... | |
946 | converting... |
|
946 | converting... | |
947 | 2 a |
|
947 | 2 a | |
948 | 1 b |
|
948 | 1 b | |
949 | 0 meta |
|
949 | 0 meta | |
950 |
|
950 | |||
951 | $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}' |
|
951 | $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}' | |
952 | version https://git-lfs.github.com/spec/v1 |
|
952 | version https://git-lfs.github.com/spec/v1 | |
953 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
953 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
954 | size 29 |
|
954 | size 29 | |
955 | x-is-binary 0 |
|
955 | x-is-binary 0 | |
956 | $ hg --cwd convert_lfs debugdata a1 0 |
|
956 | $ hg --cwd convert_lfs debugdata a1 0 | |
957 | version https://git-lfs.github.com/spec/v1 |
|
957 | version https://git-lfs.github.com/spec/v1 | |
958 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
958 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
959 | size 29 |
|
959 | size 29 | |
960 | x-is-binary 0 |
|
960 | x-is-binary 0 | |
961 | $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}" |
|
961 | $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}" | |
962 | version=https://git-lfs.github.com/spec/v1 |
|
962 | version=https://git-lfs.github.com/spec/v1 | |
963 | oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
963 | oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
964 | size=29 |
|
964 | size=29 | |
965 | x-is-binary=0 |
|
965 | x-is-binary=0 | |
966 | $ hg --cwd convert_lfs log -r 0 \ |
|
966 | $ hg --cwd convert_lfs log -r 0 \ | |
967 | > -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}' |
|
967 | > -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}' | |
968 | sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
968 | sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
969 | sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
969 | sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
970 | $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}' |
|
970 | $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}' | |
971 | version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0 |
|
971 | version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0 | |
972 | $ hg --cwd convert_lfs \ |
|
972 | $ hg --cwd convert_lfs \ | |
973 | > log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}' |
|
973 | > log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}' | |
974 | 0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
974 | 0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
975 | 1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
975 | 1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
976 | 2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943 |
|
976 | 2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943 | |
977 |
|
977 | |||
978 | $ grep 'lfs' convert_lfs/.hg/requires |
|
978 | $ grep 'lfs' convert_lfs/.hg/requires | |
979 | lfs |
|
979 | lfs | |
980 |
|
980 | |||
981 | The hashes in all stages of the conversion are unchanged. |
|
981 | The hashes in all stages of the conversion are unchanged. | |
982 |
|
982 | |||
983 | $ hg -R repo8 log -T '{node|short}\n' |
|
983 | $ hg -R repo8 log -T '{node|short}\n' | |
984 | 0fae949de7fa |
|
984 | 0fae949de7fa | |
985 | 9cd6bdffdac0 |
|
985 | 9cd6bdffdac0 | |
986 | 7f96794915f7 |
|
986 | 7f96794915f7 | |
987 | $ hg -R convert_normal log -T '{node|short}\n' |
|
987 | $ hg -R convert_normal log -T '{node|short}\n' | |
988 | 0fae949de7fa |
|
988 | 0fae949de7fa | |
989 | 9cd6bdffdac0 |
|
989 | 9cd6bdffdac0 | |
990 | 7f96794915f7 |
|
990 | 7f96794915f7 | |
991 | $ hg -R convert_lfs log -T '{node|short}\n' |
|
991 | $ hg -R convert_lfs log -T '{node|short}\n' | |
992 | 0fae949de7fa |
|
992 | 0fae949de7fa | |
993 | 9cd6bdffdac0 |
|
993 | 9cd6bdffdac0 | |
994 | 7f96794915f7 |
|
994 | 7f96794915f7 | |
995 |
|
995 | |||
996 | This convert is trickier, because it contains deleted files (via `hg mv`) |
|
996 | This convert is trickier, because it contains deleted files (via `hg mv`) | |
997 |
|
997 | |||
998 | $ hg --config extensions.convert= --config lfs.threshold=1000M \ |
|
998 | $ hg --config extensions.convert= --config lfs.threshold=1000M \ | |
999 | > convert repo3 convert_normal2 |
|
999 | > convert repo3 convert_normal2 | |
1000 | initializing destination convert_normal2 repository |
|
1000 | initializing destination convert_normal2 repository | |
1001 | scanning source... |
|
1001 | scanning source... | |
1002 | sorting... |
|
1002 | sorting... | |
1003 | converting... |
|
1003 | converting... | |
1004 | 4 commit with lfs content |
|
1004 | 4 commit with lfs content | |
1005 | 3 renames |
|
1005 | 3 renames | |
1006 | 2 large to small, small to large |
|
1006 | 2 large to small, small to large | |
1007 | 1 random modifications |
|
1007 | 1 random modifications | |
1008 | 0 switch large and small again |
|
1008 | 0 switch large and small again | |
1009 | $ grep 'lfs' convert_normal2/.hg/requires |
|
1009 | $ grep 'lfs' convert_normal2/.hg/requires | |
1010 | [1] |
|
1010 | [1] | |
1011 | $ hg --cwd convert_normal2 debugdata large 0 |
|
1011 | $ hg --cwd convert_normal2 debugdata large 0 | |
1012 | LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS |
|
1012 | LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS | |
1013 |
|
1013 | |||
1014 | $ hg --config extensions.convert= --config lfs.threshold=10B \ |
|
1014 | $ hg --config extensions.convert= --config lfs.threshold=10B \ | |
1015 | > convert convert_normal2 convert_lfs2 |
|
1015 | > convert convert_normal2 convert_lfs2 | |
1016 | initializing destination convert_lfs2 repository |
|
1016 | initializing destination convert_lfs2 repository | |
1017 | scanning source... |
|
1017 | scanning source... | |
1018 | sorting... |
|
1018 | sorting... | |
1019 | converting... |
|
1019 | converting... | |
1020 | 4 commit with lfs content |
|
1020 | 4 commit with lfs content | |
1021 | 3 renames |
|
1021 | 3 renames | |
1022 | 2 large to small, small to large |
|
1022 | 2 large to small, small to large | |
1023 | 1 random modifications |
|
1023 | 1 random modifications | |
1024 | 0 switch large and small again |
|
1024 | 0 switch large and small again | |
1025 | $ grep 'lfs' convert_lfs2/.hg/requires |
|
1025 | $ grep 'lfs' convert_lfs2/.hg/requires | |
1026 | lfs |
|
1026 | lfs | |
1027 | $ hg --cwd convert_lfs2 debugdata large 0 |
|
1027 | $ hg --cwd convert_lfs2 debugdata large 0 | |
1028 | version https://git-lfs.github.com/spec/v1 |
|
1028 | version https://git-lfs.github.com/spec/v1 | |
1029 | oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
1029 | oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
1030 | size 39 |
|
1030 | size 39 | |
1031 | x-is-binary 0 |
|
1031 | x-is-binary 0 | |
1032 |
|
1032 | |||
1033 | $ hg -R convert_lfs2 config --debug extensions | grep lfs |
|
1033 | $ hg -R convert_lfs2 config --debug extensions | grep lfs | |
1034 | $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob) |
|
1034 | $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob) | |
1035 |
|
1035 | |||
1036 | Committing deleted files works: |
|
1036 | Committing deleted files works: | |
1037 |
|
1037 | |||
1038 | $ hg init $TESTTMP/repo-del |
|
1038 | $ hg init $TESTTMP/repo-del | |
1039 | $ cd $TESTTMP/repo-del |
|
1039 | $ cd $TESTTMP/repo-del | |
1040 | $ echo 1 > A |
|
1040 | $ echo 1 > A | |
1041 | $ hg commit -m 'add A' -A A |
|
1041 | $ hg commit -m 'add A' -A A | |
1042 | $ hg rm A |
|
1042 | $ hg rm A | |
1043 | $ hg commit -m 'rm A' |
|
1043 | $ hg commit -m 'rm A' | |
1044 |
|
1044 | |||
1045 | Bad .hglfs files will block the commit with a useful message |
|
1045 | Bad .hglfs files will block the commit with a useful message | |
1046 |
|
1046 | |||
1047 | $ cat > .hglfs << EOF |
|
1047 | $ cat > .hglfs << EOF | |
1048 | > [track] |
|
1048 | > [track] | |
1049 | > **.test = size(">5B") |
|
1049 | > **.test = size(">5B") | |
1050 | > bad file ... no commit |
|
1050 | > bad file ... no commit | |
1051 | > EOF |
|
1051 | > EOF | |
1052 |
|
1052 | |||
1053 | $ echo x > file.txt |
|
1053 | $ echo x > file.txt | |
1054 | $ hg ci -Aqm 'should fail' |
|
1054 | $ hg ci -Aqm 'should fail' | |
1055 | hg: parse error at .hglfs:3: bad file ... no commit |
|
1055 | hg: parse error at .hglfs:3: bad file ... no commit | |
1056 | [255] |
|
1056 | [255] | |
1057 |
|
1057 | |||
1058 | $ cat > .hglfs << EOF |
|
1058 | $ cat > .hglfs << EOF | |
1059 | > [track] |
|
1059 | > [track] | |
1060 | > **.test = size(">5B") |
|
1060 | > **.test = size(">5B") | |
1061 | > ** = nonexistent() |
|
1061 | > ** = nonexistent() | |
1062 | > EOF |
|
1062 | > EOF | |
1063 |
|
1063 | |||
1064 | $ hg ci -Aqm 'should fail' |
|
1064 | $ hg ci -Aqm 'should fail' | |
1065 | abort: parse error in .hglfs: unknown identifier: nonexistent |
|
1065 | abort: parse error in .hglfs: unknown identifier: nonexistent | |
1066 | [255] |
|
1066 | [255] | |
1067 |
|
1067 | |||
1068 | '**' works out to mean all files. |
|
1068 | '**' works out to mean all files. | |
1069 |
|
1069 | |||
1070 | $ cat > .hglfs << EOF |
|
1070 | $ cat > .hglfs << EOF | |
1071 | > [track] |
|
1071 | > [track] | |
1072 | > path:.hglfs = none() |
|
1072 | > path:.hglfs = none() | |
1073 | > **.test = size(">5B") |
|
1073 | > **.test = size(">5B") | |
1074 | > **.exclude = none() |
|
1074 | > **.exclude = none() | |
1075 | > ** = size(">10B") |
|
1075 | > ** = size(">10B") | |
1076 | > EOF |
|
1076 | > EOF | |
1077 |
|
1077 | |||
1078 | The LFS policy takes effect without tracking the .hglfs file |
|
1078 | The LFS policy takes effect without tracking the .hglfs file | |
1079 |
|
1079 | |||
1080 | $ echo 'largefile' > lfs.test |
|
1080 | $ echo 'largefile' > lfs.test | |
1081 | $ echo '012345678901234567890' > nolfs.exclude |
|
1081 | $ echo '012345678901234567890' > nolfs.exclude | |
1082 | $ echo '01234567890123456' > lfs.catchall |
|
1082 | $ echo '01234567890123456' > lfs.catchall | |
1083 | $ hg add * |
|
1083 | $ hg add * | |
1084 | $ hg ci -qm 'before add .hglfs' |
|
1084 | $ hg ci -qm 'before add .hglfs' | |
1085 | $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' |
|
1085 | $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' | |
1086 | 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9 |
|
1086 | 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9 | |
1087 | lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c |
|
1087 | lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c | |
1088 |
|
1088 | |||
1089 | The .hglfs file works when tracked |
|
1089 | The .hglfs file works when tracked | |
1090 |
|
1090 | |||
1091 | $ echo 'largefile2' > lfs.test |
|
1091 | $ echo 'largefile2' > lfs.test | |
1092 | $ echo '012345678901234567890a' > nolfs.exclude |
|
1092 | $ echo '012345678901234567890a' > nolfs.exclude | |
1093 | $ echo '01234567890123456a' > lfs.catchall |
|
1093 | $ echo '01234567890123456a' > lfs.catchall | |
1094 | $ hg ci -Aqm 'after adding .hglfs' |
|
1094 | $ hg ci -Aqm 'after adding .hglfs' | |
1095 | $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' |
|
1095 | $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' | |
1096 | 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573 |
|
1096 | 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573 | |
1097 | lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6 |
|
1097 | lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6 | |
1098 |
|
1098 | |||
1099 | The LFS policy stops when the .hglfs is gone |
|
1099 | The LFS policy stops when the .hglfs is gone | |
1100 |
|
1100 | |||
1101 | $ mv .hglfs .hglfs_ |
|
1101 | $ mv .hglfs .hglfs_ | |
1102 | $ echo 'largefile3' > lfs.test |
|
1102 | $ echo 'largefile3' > lfs.test | |
1103 | $ echo '012345678901234567890abc' > nolfs.exclude |
|
1103 | $ echo '012345678901234567890abc' > nolfs.exclude | |
1104 | $ echo '01234567890123456abc' > lfs.catchall |
|
1104 | $ echo '01234567890123456abc' > lfs.catchall | |
1105 | $ hg ci -qm 'file test' -X .hglfs |
|
1105 | $ hg ci -qm 'file test' -X .hglfs | |
1106 | $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' |
|
1106 | $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' | |
1107 | 4: |
|
1107 | 4: | |
1108 |
|
1108 | |||
1109 | $ mv .hglfs_ .hglfs |
|
1109 | $ mv .hglfs_ .hglfs | |
1110 | $ echo '012345678901234567890abc' > lfs.test |
|
1110 | $ echo '012345678901234567890abc' > lfs.test | |
1111 | $ hg ci -m 'back to lfs' |
|
1111 | $ hg ci -m 'back to lfs' | |
1112 | $ hg rm lfs.test |
|
1112 | $ hg rm lfs.test | |
1113 | $ hg ci -qm 'remove lfs' |
|
1113 | $ hg ci -qm 'remove lfs' | |
1114 |
|
1114 | |||
1115 | {lfs_files} will list deleted files too |
|
1115 | {lfs_files} will list deleted files too | |
1116 |
|
1116 | |||
1117 | $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}" |
|
1117 | $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}" | |
1118 | 6 lfs.test: |
|
1118 | 6 lfs.test: | |
1119 | 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6 |
|
1119 | 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6 | |
1120 | 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573 |
|
1120 | 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573 | |
1121 | 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6 |
|
1121 | 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6 | |
1122 | 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9 |
|
1122 | 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9 | |
1123 | 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c |
|
1123 | 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c | |
1124 |
|
1124 | |||
1125 | $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n' |
|
1125 | $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n' | |
1126 | 2 lfs.catchall, lfs.test |
|
1126 | 2 lfs.catchall, lfs.test | |
1127 | 3 lfs.catchall, lfs.test |
|
1127 | 3 lfs.catchall, lfs.test | |
1128 | 5 lfs.test |
|
1128 | 5 lfs.test | |
1129 | 6 lfs.test |
|
1129 | 6 lfs.test | |
1130 |
|
1130 | |||
1131 | $ cd .. |
|
1131 | $ cd .. | |
1132 |
|
1132 | |||
1133 | Unbundling adds a requirement to a non-lfs repo, if necessary. |
|
1133 | Unbundling adds a requirement to a non-lfs repo, if necessary. | |
1134 |
|
1134 | |||
1135 | $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg |
|
1135 | $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg | |
1136 | $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg |
|
1136 | $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg | |
1137 | $ hg init unbundle |
|
1137 | $ hg init unbundle | |
1138 | $ hg pull -R unbundle -q nolfs.hg |
|
1138 | $ hg pull -R unbundle -q nolfs.hg | |
1139 | $ grep lfs unbundle/.hg/requires |
|
1139 | $ grep lfs unbundle/.hg/requires | |
1140 | [1] |
|
1140 | [1] | |
1141 | $ hg pull -R unbundle -q lfs.hg |
|
1141 | $ hg pull -R unbundle -q lfs.hg | |
1142 | $ grep lfs unbundle/.hg/requires |
|
1142 | $ grep lfs unbundle/.hg/requires | |
1143 | lfs |
|
1143 | lfs | |
1144 |
|
1144 | |||
1145 | $ hg init no_lfs |
|
1145 | $ hg init no_lfs | |
1146 | $ cat >> no_lfs/.hg/hgrc <<EOF |
|
1146 | $ cat >> no_lfs/.hg/hgrc <<EOF | |
1147 | > [experimental] |
|
1147 | > [experimental] | |
1148 | > changegroup3 = True |
|
1148 | > changegroup3 = True | |
1149 | > [extensions] |
|
1149 | > [extensions] | |
1150 | > lfs=! |
|
1150 | > lfs=! | |
1151 | > EOF |
|
1151 | > EOF | |
1152 | $ cp -R no_lfs no_lfs2 |
|
1152 | $ cp -R no_lfs no_lfs2 | |
1153 |
|
1153 | |||
1154 | Pushing from a local lfs repo to a local repo without an lfs requirement and |
|
1154 | Pushing from a local lfs repo to a local repo without an lfs requirement and | |
1155 | with lfs disabled, fails. |
|
1155 | with lfs disabled, fails. | |
1156 |
|
1156 | |||
1157 | $ hg push -R convert_lfs2 no_lfs |
|
1157 | $ hg push -R convert_lfs2 no_lfs | |
1158 | pushing to no_lfs |
|
1158 | pushing to no_lfs | |
1159 | abort: required features are not supported in the destination: lfs |
|
1159 | abort: required features are not supported in the destination: lfs | |
1160 | [255] |
|
1160 | [255] | |
1161 | $ grep lfs no_lfs/.hg/requires |
|
1161 | $ grep lfs no_lfs/.hg/requires | |
1162 | [1] |
|
1162 | [1] | |
1163 |
|
1163 | |||
1164 | Pulling from a local lfs repo to a local repo without an lfs requirement and |
|
1164 | Pulling from a local lfs repo to a local repo without an lfs requirement and | |
1165 | with lfs disabled, fails. |
|
1165 | with lfs disabled, fails. | |
1166 |
|
1166 | |||
1167 | $ hg pull -R no_lfs2 convert_lfs2 |
|
1167 | $ hg pull -R no_lfs2 convert_lfs2 | |
1168 | pulling from convert_lfs2 |
|
1168 | pulling from convert_lfs2 | |
1169 | abort: required features are not supported in the destination: lfs |
|
1169 | abort: required features are not supported in the destination: lfs | |
1170 | [255] |
|
1170 | [255] | |
1171 | $ grep lfs no_lfs2/.hg/requires |
|
1171 | $ grep lfs no_lfs2/.hg/requires | |
1172 | [1] |
|
1172 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now