##// END OF EJS Templates
remotefilelog: cast division result to an int...
Gregory Szorc -
r41898:7f853549 default draft
parent child Browse files
Show More
@@ -1,745 +1,746 b''
1 test-abort-checkin.t
1 test-abort-checkin.t
2 test-absorb-edit-lines.t
2 test-absorb-edit-lines.t
3 test-absorb-filefixupstate.py
3 test-absorb-filefixupstate.py
4 test-absorb-phase.t
4 test-absorb-phase.t
5 test-absorb-rename.t
5 test-absorb-rename.t
6 test-absorb-strip.t
6 test-absorb-strip.t
7 test-absorb.t
7 test-absorb.t
8 test-add.t
8 test-add.t
9 test-addremove-similar.t
9 test-addremove-similar.t
10 test-addremove.t
10 test-addremove.t
11 test-alias.t
11 test-alias.t
12 test-amend-subrepo.t
12 test-amend-subrepo.t
13 test-amend.t
13 test-amend.t
14 test-ancestor.py
14 test-ancestor.py
15 test-annotate.py
15 test-annotate.py
16 test-annotate.t
16 test-annotate.t
17 test-arbitraryfilectx.t
17 test-arbitraryfilectx.t
18 test-archive-symlinks.t
18 test-archive-symlinks.t
19 test-archive.t
19 test-archive.t
20 test-atomictempfile.py
20 test-atomictempfile.py
21 test-audit-path.t
21 test-audit-path.t
22 test-audit-subrepo.t
22 test-audit-subrepo.t
23 test-automv.t
23 test-automv.t
24 test-backout.t
24 test-backout.t
25 test-backwards-remove.t
25 test-backwards-remove.t
26 test-bad-extension.t
26 test-bad-extension.t
27 test-bad-pull.t
27 test-bad-pull.t
28 test-basic.t
28 test-basic.t
29 test-batching.py
29 test-batching.py
30 test-bdiff.py
30 test-bdiff.py
31 test-bheads.t
31 test-bheads.t
32 test-bisect.t
32 test-bisect.t
33 test-bisect2.t
33 test-bisect2.t
34 test-bisect3.t
34 test-bisect3.t
35 test-blackbox.t
35 test-blackbox.t
36 test-bookflow.t
36 test-bookflow.t
37 test-bookmarks-current.t
37 test-bookmarks-current.t
38 test-bookmarks-merge.t
38 test-bookmarks-merge.t
39 test-bookmarks-pushpull.t
39 test-bookmarks-pushpull.t
40 test-bookmarks-rebase.t
40 test-bookmarks-rebase.t
41 test-bookmarks-strip.t
41 test-bookmarks-strip.t
42 test-bookmarks.t
42 test-bookmarks.t
43 test-branch-change.t
43 test-branch-change.t
44 test-branch-option.t
44 test-branch-option.t
45 test-branch-tag-confict.t
45 test-branch-tag-confict.t
46 test-branches.t
46 test-branches.t
47 test-bugzilla.t
47 test-bugzilla.t
48 test-bundle-phases.t
48 test-bundle-phases.t
49 test-bundle-r.t
49 test-bundle-r.t
50 test-bundle-type.t
50 test-bundle-type.t
51 test-bundle-vs-outgoing.t
51 test-bundle-vs-outgoing.t
52 test-bundle.t
52 test-bundle.t
53 test-bundle2-exchange.t
53 test-bundle2-exchange.t
54 test-bundle2-format.t
54 test-bundle2-format.t
55 test-bundle2-multiple-changegroups.t
55 test-bundle2-multiple-changegroups.t
56 test-bundle2-pushback.t
56 test-bundle2-pushback.t
57 test-bundle2-remote-changegroup.t
57 test-bundle2-remote-changegroup.t
58 test-cache-abuse.t
58 test-cache-abuse.t
59 test-cappedreader.py
59 test-cappedreader.py
60 test-casecollision-merge.t
60 test-casecollision-merge.t
61 test-casecollision.t
61 test-casecollision.t
62 test-casefolding.t
62 test-casefolding.t
63 test-cat.t
63 test-cat.t
64 test-cbor.py
64 test-cbor.py
65 test-censor.t
65 test-censor.t
66 test-changelog-exec.t
66 test-changelog-exec.t
67 test-check-code.t
67 test-check-code.t
68 test-check-commit.t
68 test-check-commit.t
69 test-check-config.py
69 test-check-config.py
70 test-check-config.t
70 test-check-config.t
71 test-check-execute.t
71 test-check-execute.t
72 test-check-help.t
72 test-check-help.t
73 test-check-interfaces.py
73 test-check-interfaces.py
74 test-check-module-imports.t
74 test-check-module-imports.t
75 test-check-py3-compat.t
75 test-check-py3-compat.t
76 test-check-pyflakes.t
76 test-check-pyflakes.t
77 test-check-pylint.t
77 test-check-pylint.t
78 test-check-shbang.t
78 test-check-shbang.t
79 test-children.t
79 test-children.t
80 test-churn.t
80 test-churn.t
81 test-clone-cgi.t
81 test-clone-cgi.t
82 test-clone-pull-corruption.t
82 test-clone-pull-corruption.t
83 test-clone-r.t
83 test-clone-r.t
84 test-clone-uncompressed.t
84 test-clone-uncompressed.t
85 test-clone-update-order.t
85 test-clone-update-order.t
86 test-clone.t
86 test-clone.t
87 test-clonebundles.t
87 test-clonebundles.t
88 test-close-head.t
88 test-close-head.t
89 test-commandserver.t
89 test-commandserver.t
90 test-commit-amend.t
90 test-commit-amend.t
91 test-commit-interactive.t
91 test-commit-interactive.t
92 test-commit-multiple.t
92 test-commit-multiple.t
93 test-commit-unresolved.t
93 test-commit-unresolved.t
94 test-commit.t
94 test-commit.t
95 test-committer.t
95 test-committer.t
96 test-completion.t
96 test-completion.t
97 test-config-env.py
97 test-config-env.py
98 test-config.t
98 test-config.t
99 test-conflict.t
99 test-conflict.t
100 test-confused-revert.t
100 test-confused-revert.t
101 test-context-metadata.t
101 test-context-metadata.t
102 test-context.py
102 test-context.py
103 test-contrib-check-code.t
103 test-contrib-check-code.t
104 test-contrib-check-commit.t
104 test-contrib-check-commit.t
105 test-contrib-dumprevlog.t
105 test-contrib-dumprevlog.t
106 test-contrib-perf.t
106 test-contrib-perf.t
107 test-contrib-relnotes.t
107 test-contrib-relnotes.t
108 test-contrib-testparseutil.t
108 test-contrib-testparseutil.t
109 test-contrib.t
109 test-contrib.t
110 test-convert-authormap.t
110 test-convert-authormap.t
111 test-convert-clonebranches.t
111 test-convert-clonebranches.t
112 test-convert-cvs-branch.t
112 test-convert-cvs-branch.t
113 test-convert-cvs-detectmerge.t
113 test-convert-cvs-detectmerge.t
114 test-convert-cvs-synthetic.t
114 test-convert-cvs-synthetic.t
115 test-convert-cvs.t
115 test-convert-cvs.t
116 test-convert-cvsnt-mergepoints.t
116 test-convert-cvsnt-mergepoints.t
117 test-convert-datesort.t
117 test-convert-datesort.t
118 test-convert-filemap.t
118 test-convert-filemap.t
119 test-convert-hg-sink.t
119 test-convert-hg-sink.t
120 test-convert-hg-source.t
120 test-convert-hg-source.t
121 test-convert-hg-startrev.t
121 test-convert-hg-startrev.t
122 test-convert-splicemap.t
122 test-convert-splicemap.t
123 test-convert-svn-sink.t
123 test-convert-svn-sink.t
124 test-convert-tagsbranch-topology.t
124 test-convert-tagsbranch-topology.t
125 test-convert.t
125 test-convert.t
126 test-copy-move-merge.t
126 test-copy-move-merge.t
127 test-copy.t
127 test-copy.t
128 test-copytrace-heuristics.t
128 test-copytrace-heuristics.t
129 test-custom-filters.t
129 test-custom-filters.t
130 test-debugbuilddag.t
130 test-debugbuilddag.t
131 test-debugbundle.t
131 test-debugbundle.t
132 test-debugcommands.t
132 test-debugcommands.t
133 test-debugextensions.t
133 test-debugextensions.t
134 test-debugindexdot.t
134 test-debugindexdot.t
135 test-debugrename.t
135 test-debugrename.t
136 test-default-push.t
136 test-default-push.t
137 test-diff-antipatience.t
137 test-diff-antipatience.t
138 test-diff-binary-file.t
138 test-diff-binary-file.t
139 test-diff-change.t
139 test-diff-change.t
140 test-diff-color.t
140 test-diff-color.t
141 test-diff-copy-depth.t
141 test-diff-copy-depth.t
142 test-diff-hashes.t
142 test-diff-hashes.t
143 test-diff-ignore-whitespace.t
143 test-diff-ignore-whitespace.t
144 test-diff-indent-heuristic.t
144 test-diff-indent-heuristic.t
145 test-diff-issue2761.t
145 test-diff-issue2761.t
146 test-diff-newlines.t
146 test-diff-newlines.t
147 test-diff-reverse.t
147 test-diff-reverse.t
148 test-diff-subdir.t
148 test-diff-subdir.t
149 test-diff-unified.t
149 test-diff-unified.t
150 test-diff-upgrade.t
150 test-diff-upgrade.t
151 test-diffdir.t
151 test-diffdir.t
152 test-diffstat.t
152 test-diffstat.t
153 test-directaccess.t
153 test-directaccess.t
154 test-dirstate-backup.t
154 test-dirstate-backup.t
155 test-dirstate-nonnormalset.t
155 test-dirstate-nonnormalset.t
156 test-dirstate-race.t
156 test-dirstate-race.t
157 test-dirstate.t
157 test-dirstate.t
158 test-dispatch.py
158 test-dispatch.py
159 test-dispatch.t
159 test-dispatch.t
160 test-doctest.py
160 test-doctest.py
161 test-double-merge.t
161 test-double-merge.t
162 test-drawdag.t
162 test-drawdag.t
163 test-duplicateoptions.py
163 test-duplicateoptions.py
164 test-editor-filename.t
164 test-editor-filename.t
165 test-empty-dir.t
165 test-empty-dir.t
166 test-empty-file.t
166 test-empty-file.t
167 test-empty-group.t
167 test-empty-group.t
168 test-empty.t
168 test-empty.t
169 test-encode.t
169 test-encode.t
170 test-encoding-align.t
170 test-encoding-align.t
171 test-encoding-func.py
171 test-encoding-func.py
172 test-encoding-textwrap.t
172 test-encoding-textwrap.t
173 test-encoding.t
173 test-encoding.t
174 test-eol-add.t
174 test-eol-add.t
175 test-eol-clone.t
175 test-eol-clone.t
176 test-eol-hook.t
176 test-eol-hook.t
177 test-eol-patch.t
177 test-eol-patch.t
178 test-eol-tag.t
178 test-eol-tag.t
179 test-eol-update.t
179 test-eol-update.t
180 test-eol.t
180 test-eol.t
181 test-eolfilename.t
181 test-eolfilename.t
182 test-excessive-merge.t
182 test-excessive-merge.t
183 test-exchange-obsmarkers-case-A1.t
183 test-exchange-obsmarkers-case-A1.t
184 test-exchange-obsmarkers-case-A2.t
184 test-exchange-obsmarkers-case-A2.t
185 test-exchange-obsmarkers-case-A3.t
185 test-exchange-obsmarkers-case-A3.t
186 test-exchange-obsmarkers-case-A4.t
186 test-exchange-obsmarkers-case-A4.t
187 test-exchange-obsmarkers-case-A5.t
187 test-exchange-obsmarkers-case-A5.t
188 test-exchange-obsmarkers-case-A6.t
188 test-exchange-obsmarkers-case-A6.t
189 test-exchange-obsmarkers-case-A7.t
189 test-exchange-obsmarkers-case-A7.t
190 test-exchange-obsmarkers-case-B1.t
190 test-exchange-obsmarkers-case-B1.t
191 test-exchange-obsmarkers-case-B2.t
191 test-exchange-obsmarkers-case-B2.t
192 test-exchange-obsmarkers-case-B3.t
192 test-exchange-obsmarkers-case-B3.t
193 test-exchange-obsmarkers-case-B4.t
193 test-exchange-obsmarkers-case-B4.t
194 test-exchange-obsmarkers-case-B5.t
194 test-exchange-obsmarkers-case-B5.t
195 test-exchange-obsmarkers-case-B6.t
195 test-exchange-obsmarkers-case-B6.t
196 test-exchange-obsmarkers-case-B7.t
196 test-exchange-obsmarkers-case-B7.t
197 test-exchange-obsmarkers-case-C1.t
197 test-exchange-obsmarkers-case-C1.t
198 test-exchange-obsmarkers-case-C2.t
198 test-exchange-obsmarkers-case-C2.t
199 test-exchange-obsmarkers-case-C3.t
199 test-exchange-obsmarkers-case-C3.t
200 test-exchange-obsmarkers-case-C4.t
200 test-exchange-obsmarkers-case-C4.t
201 test-exchange-obsmarkers-case-D1.t
201 test-exchange-obsmarkers-case-D1.t
202 test-exchange-obsmarkers-case-D2.t
202 test-exchange-obsmarkers-case-D2.t
203 test-exchange-obsmarkers-case-D3.t
203 test-exchange-obsmarkers-case-D3.t
204 test-exchange-obsmarkers-case-D4.t
204 test-exchange-obsmarkers-case-D4.t
205 test-execute-bit.t
205 test-execute-bit.t
206 test-export.t
206 test-export.t
207 test-extdata.t
207 test-extdata.t
208 test-extdiff.t
208 test-extdiff.t
209 test-extension-timing.t
209 test-extension-timing.t
210 test-extensions-afterloaded.t
210 test-extensions-afterloaded.t
211 test-extensions-wrapfunction.py
211 test-extensions-wrapfunction.py
212 test-extra-filelog-entry.t
212 test-extra-filelog-entry.t
213 test-fastannotate-corrupt.t
213 test-fastannotate-corrupt.t
214 test-fastannotate-diffopts.t
214 test-fastannotate-diffopts.t
215 test-fastannotate-hg.t
215 test-fastannotate-hg.t
216 test-fastannotate-perfhack.t
216 test-fastannotate-perfhack.t
217 test-fastannotate-protocol.t
217 test-fastannotate-protocol.t
218 test-fastannotate-renames.t
218 test-fastannotate-renames.t
219 test-fastannotate-revmap.py
219 test-fastannotate-revmap.py
220 test-fastannotate.t
220 test-fastannotate.t
221 test-fetch.t
221 test-fetch.t
222 test-filebranch.t
222 test-filebranch.t
223 test-filecache.py
223 test-filecache.py
224 test-filelog.py
224 test-filelog.py
225 test-fileset-generated.t
225 test-fileset-generated.t
226 test-fileset.t
226 test-fileset.t
227 test-fix-topology.t
227 test-fix-topology.t
228 test-fix.t
228 test-fix.t
229 test-flags.t
229 test-flags.t
230 test-fncache.t
230 test-fncache.t
231 test-gendoc-da.t
231 test-gendoc-da.t
232 test-gendoc-de.t
232 test-gendoc-de.t
233 test-gendoc-el.t
233 test-gendoc-el.t
234 test-gendoc-fr.t
234 test-gendoc-fr.t
235 test-gendoc-it.t
235 test-gendoc-it.t
236 test-gendoc-ja.t
236 test-gendoc-ja.t
237 test-gendoc-pt_BR.t
237 test-gendoc-pt_BR.t
238 test-gendoc-ro.t
238 test-gendoc-ro.t
239 test-gendoc-ru.t
239 test-gendoc-ru.t
240 test-gendoc-sv.t
240 test-gendoc-sv.t
241 test-gendoc-zh_CN.t
241 test-gendoc-zh_CN.t
242 test-gendoc-zh_TW.t
242 test-gendoc-zh_TW.t
243 test-gendoc.t
243 test-gendoc.t
244 test-generaldelta.t
244 test-generaldelta.t
245 test-getbundle.t
245 test-getbundle.t
246 test-git-export.t
246 test-git-export.t
247 test-githelp.t
247 test-githelp.t
248 test-globalopts.t
248 test-globalopts.t
249 test-glog-beautifygraph.t
249 test-glog-beautifygraph.t
250 test-glog-topological.t
250 test-glog-topological.t
251 test-glog.t
251 test-glog.t
252 test-gpg.t
252 test-gpg.t
253 test-graft.t
253 test-graft.t
254 test-grep.t
254 test-grep.t
255 test-hardlinks.t
255 test-hardlinks.t
256 test-help-hide.t
256 test-help-hide.t
257 test-help.t
257 test-help.t
258 test-hg-parseurl.py
258 test-hg-parseurl.py
259 test-hghave.t
259 test-hghave.t
260 test-hgignore.t
260 test-hgignore.t
261 test-hgk.t
261 test-hgk.t
262 test-hgrc.t
262 test-hgrc.t
263 test-hgweb-annotate-whitespace.t
263 test-hgweb-annotate-whitespace.t
264 test-hgweb-auth.py
264 test-hgweb-auth.py
265 test-hgweb-bundle.t
265 test-hgweb-bundle.t
266 test-hgweb-commands.t
266 test-hgweb-commands.t
267 test-hgweb-csp.t
267 test-hgweb-csp.t
268 test-hgweb-descend-empties.t
268 test-hgweb-descend-empties.t
269 test-hgweb-diffs.t
269 test-hgweb-diffs.t
270 test-hgweb-empty.t
270 test-hgweb-empty.t
271 test-hgweb-filelog.t
271 test-hgweb-filelog.t
272 test-hgweb-no-path-info.t
272 test-hgweb-no-path-info.t
273 test-hgweb-no-request-uri.t
273 test-hgweb-no-request-uri.t
274 test-hgweb-non-interactive.t
274 test-hgweb-non-interactive.t
275 test-hgweb-raw.t
275 test-hgweb-raw.t
276 test-hgweb-removed.t
276 test-hgweb-removed.t
277 test-hgweb-symrev.t
277 test-hgweb-symrev.t
278 test-hgweb.t
278 test-hgweb.t
279 test-hgwebdir-paths.py
279 test-hgwebdir-paths.py
280 test-hgwebdir.t
280 test-hgwebdir.t
281 test-hgwebdirsym.t
281 test-hgwebdirsym.t
282 test-histedit-arguments.t
282 test-histedit-arguments.t
283 test-histedit-base.t
283 test-histedit-base.t
284 test-histedit-bookmark-motion.t
284 test-histedit-bookmark-motion.t
285 test-histedit-commute.t
285 test-histedit-commute.t
286 test-histedit-drop.t
286 test-histedit-drop.t
287 test-histedit-edit.t
287 test-histedit-edit.t
288 test-histedit-fold-non-commute.t
288 test-histedit-fold-non-commute.t
289 test-histedit-fold.t
289 test-histedit-fold.t
290 test-histedit-no-backup.t
290 test-histedit-no-backup.t
291 test-histedit-no-change.t
291 test-histedit-no-change.t
292 test-histedit-non-commute-abort.t
292 test-histedit-non-commute-abort.t
293 test-histedit-non-commute.t
293 test-histedit-non-commute.t
294 test-histedit-obsolete.t
294 test-histedit-obsolete.t
295 test-histedit-outgoing.t
295 test-histedit-outgoing.t
296 test-histedit-templates.t
296 test-histedit-templates.t
297 test-http-api-httpv2.t
297 test-http-api-httpv2.t
298 test-http-api.t
298 test-http-api.t
299 test-http-bad-server.t
299 test-http-bad-server.t
300 test-http-branchmap.t
300 test-http-branchmap.t
301 test-http-bundle1.t
301 test-http-bundle1.t
302 test-http-clone-r.t
302 test-http-clone-r.t
303 test-http-permissions.t
303 test-http-permissions.t
304 test-http-protocol.t
304 test-http-protocol.t
305 test-http.t
305 test-http.t
306 test-hybridencode.py
306 test-hybridencode.py
307 test-i18n.t
307 test-i18n.t
308 test-identify.t
308 test-identify.t
309 test-impexp-branch.t
309 test-impexp-branch.t
310 test-import-bypass.t
310 test-import-bypass.t
311 test-import-context.t
311 test-import-context.t
312 test-import-eol.t
312 test-import-eol.t
313 test-import-merge.t
313 test-import-merge.t
314 test-import-unknown.t
314 test-import-unknown.t
315 test-import.t
315 test-import.t
316 test-imports-checker.t
316 test-imports-checker.t
317 test-incoming-outgoing.t
317 test-incoming-outgoing.t
318 test-infinitepush-bundlestore.t
318 test-infinitepush-bundlestore.t
319 test-infinitepush-ci.t
319 test-infinitepush-ci.t
320 test-infinitepush.t
320 test-infinitepush.t
321 test-inherit-mode.t
321 test-inherit-mode.t
322 test-init.t
322 test-init.t
323 test-install.t
323 test-install.t
324 test-issue1089.t
324 test-issue1089.t
325 test-issue1102.t
325 test-issue1102.t
326 test-issue1175.t
326 test-issue1175.t
327 test-issue1306.t
327 test-issue1306.t
328 test-issue1438.t
328 test-issue1438.t
329 test-issue1502.t
329 test-issue1502.t
330 test-issue1802.t
330 test-issue1802.t
331 test-issue1877.t
331 test-issue1877.t
332 test-issue1993.t
332 test-issue1993.t
333 test-issue2137.t
333 test-issue2137.t
334 test-issue3084.t
334 test-issue3084.t
335 test-issue4074.t
335 test-issue4074.t
336 test-issue522.t
336 test-issue522.t
337 test-issue586.t
337 test-issue586.t
338 test-issue5979.t
338 test-issue5979.t
339 test-issue612.t
339 test-issue612.t
340 test-issue619.t
340 test-issue619.t
341 test-issue660.t
341 test-issue660.t
342 test-issue672.t
342 test-issue672.t
343 test-issue842.t
343 test-issue842.t
344 test-journal-exists.t
344 test-journal-exists.t
345 test-journal-share.t
345 test-journal-share.t
346 test-journal.t
346 test-journal.t
347 test-keyword.t
347 test-keyword.t
348 test-known.t
348 test-known.t
349 test-largefiles-cache.t
349 test-largefiles-cache.t
350 test-largefiles-misc.t
350 test-largefiles-misc.t
351 test-largefiles-small-disk.t
351 test-largefiles-small-disk.t
352 test-largefiles-update.t
352 test-largefiles-update.t
353 test-largefiles-wireproto.t
353 test-largefiles-wireproto.t
354 test-largefiles.t
354 test-largefiles.t
355 test-lfconvert.t
355 test-lfconvert.t
356 test-lfs-bundle.t
356 test-lfs-bundle.t
357 test-lfs-largefiles.t
357 test-lfs-largefiles.t
358 test-lfs-pointer.py
358 test-lfs-pointer.py
359 test-lfs-test-server.t
359 test-lfs-test-server.t
360 test-lfs.t
360 test-lfs.t
361 test-linelog.py
361 test-linelog.py
362 test-linerange.py
362 test-linerange.py
363 test-locate.t
363 test-locate.t
364 test-lock-badness.t
364 test-lock-badness.t
365 test-log-exthook.t
365 test-log-exthook.t
366 test-log-linerange.t
366 test-log-linerange.t
367 test-log.t
367 test-log.t
368 test-logexchange.t
368 test-logexchange.t
369 test-logtoprocess.t
369 test-logtoprocess.t
370 test-lrucachedict.py
370 test-lrucachedict.py
371 test-mactext.t
371 test-mactext.t
372 test-mailmap.t
372 test-mailmap.t
373 test-manifest-merging.t
373 test-manifest-merging.t
374 test-manifest.py
374 test-manifest.py
375 test-manifest.t
375 test-manifest.t
376 test-match.py
376 test-match.py
377 test-mdiff.py
377 test-mdiff.py
378 test-merge-changedelete.t
378 test-merge-changedelete.t
379 test-merge-closedheads.t
379 test-merge-closedheads.t
380 test-merge-commit.t
380 test-merge-commit.t
381 test-merge-criss-cross.t
381 test-merge-criss-cross.t
382 test-merge-default.t
382 test-merge-default.t
383 test-merge-force.t
383 test-merge-force.t
384 test-merge-halt.t
384 test-merge-halt.t
385 test-merge-internal-tools-pattern.t
385 test-merge-internal-tools-pattern.t
386 test-merge-local.t
386 test-merge-local.t
387 test-merge-no-file-change.t
387 test-merge-no-file-change.t
388 test-merge-remove.t
388 test-merge-remove.t
389 test-merge-revert.t
389 test-merge-revert.t
390 test-merge-revert2.t
390 test-merge-revert2.t
391 test-merge-subrepos.t
391 test-merge-subrepos.t
392 test-merge-symlinks.t
392 test-merge-symlinks.t
393 test-merge-tools.t
393 test-merge-tools.t
394 test-merge-types.t
394 test-merge-types.t
395 test-merge1.t
395 test-merge1.t
396 test-merge10.t
396 test-merge10.t
397 test-merge2.t
397 test-merge2.t
398 test-merge4.t
398 test-merge4.t
399 test-merge5.t
399 test-merge5.t
400 test-merge6.t
400 test-merge6.t
401 test-merge7.t
401 test-merge7.t
402 test-merge8.t
402 test-merge8.t
403 test-merge9.t
403 test-merge9.t
404 test-minifileset.py
404 test-minifileset.py
405 test-minirst.py
405 test-minirst.py
406 test-missing-capability.t
406 test-missing-capability.t
407 test-mq-eol.t
407 test-mq-eol.t
408 test-mq-git.t
408 test-mq-git.t
409 test-mq-guards.t
409 test-mq-guards.t
410 test-mq-header-date.t
410 test-mq-header-date.t
411 test-mq-header-from.t
411 test-mq-header-from.t
412 test-mq-merge.t
412 test-mq-merge.t
413 test-mq-missingfiles.t
413 test-mq-missingfiles.t
414 test-mq-pull-from-bundle.t
414 test-mq-pull-from-bundle.t
415 test-mq-qclone-http.t
415 test-mq-qclone-http.t
416 test-mq-qdelete.t
416 test-mq-qdelete.t
417 test-mq-qdiff.t
417 test-mq-qdiff.t
418 test-mq-qfold.t
418 test-mq-qfold.t
419 test-mq-qgoto.t
419 test-mq-qgoto.t
420 test-mq-qimport-fail-cleanup.t
420 test-mq-qimport-fail-cleanup.t
421 test-mq-qimport.t
421 test-mq-qimport.t
422 test-mq-qnew.t
422 test-mq-qnew.t
423 test-mq-qpush-exact.t
423 test-mq-qpush-exact.t
424 test-mq-qpush-fail.t
424 test-mq-qpush-fail.t
425 test-mq-qqueue.t
425 test-mq-qqueue.t
426 test-mq-qrefresh-interactive.t
426 test-mq-qrefresh-interactive.t
427 test-mq-qrefresh-replace-log-message.t
427 test-mq-qrefresh-replace-log-message.t
428 test-mq-qrefresh.t
428 test-mq-qrefresh.t
429 test-mq-qrename.t
429 test-mq-qrename.t
430 test-mq-qsave.t
430 test-mq-qsave.t
431 test-mq-safety.t
431 test-mq-safety.t
432 test-mq-subrepo.t
432 test-mq-subrepo.t
433 test-mq-symlinks.t
433 test-mq-symlinks.t
434 test-mq.t
434 test-mq.t
435 test-mv-cp-st-diff.t
435 test-mv-cp-st-diff.t
436 test-narrow-acl.t
436 test-narrow-acl.t
437 test-narrow-archive.t
437 test-narrow-archive.t
438 test-narrow-clone-no-ellipsis.t
438 test-narrow-clone-no-ellipsis.t
439 test-narrow-clone-non-narrow-server.t
439 test-narrow-clone-non-narrow-server.t
440 test-narrow-clone-nonlinear.t
440 test-narrow-clone-nonlinear.t
441 test-narrow-clone-stream.t
441 test-narrow-clone-stream.t
442 test-narrow-clone.t
442 test-narrow-clone.t
443 test-narrow-commit.t
443 test-narrow-commit.t
444 test-narrow-copies.t
444 test-narrow-copies.t
445 test-narrow-debugcommands.t
445 test-narrow-debugcommands.t
446 test-narrow-debugrebuilddirstate.t
446 test-narrow-debugrebuilddirstate.t
447 test-narrow-exchange-merges.t
447 test-narrow-exchange-merges.t
448 test-narrow-exchange.t
448 test-narrow-exchange.t
449 test-narrow-expanddirstate.t
449 test-narrow-expanddirstate.t
450 test-narrow-merge.t
450 test-narrow-merge.t
451 test-narrow-patch.t
451 test-narrow-patch.t
452 test-narrow-patterns.t
452 test-narrow-patterns.t
453 test-narrow-pull.t
453 test-narrow-pull.t
454 test-narrow-rebase.t
454 test-narrow-rebase.t
455 test-narrow-shallow-merges.t
455 test-narrow-shallow-merges.t
456 test-narrow-shallow.t
456 test-narrow-shallow.t
457 test-narrow-share.t
457 test-narrow-share.t
458 test-narrow-sparse.t
458 test-narrow-sparse.t
459 test-narrow-strip.t
459 test-narrow-strip.t
460 test-narrow-trackedcmd.t
460 test-narrow-trackedcmd.t
461 test-narrow-update.t
461 test-narrow-update.t
462 test-narrow-widen-no-ellipsis.t
462 test-narrow-widen-no-ellipsis.t
463 test-narrow-widen.t
463 test-narrow-widen.t
464 test-narrow.t
464 test-narrow.t
465 test-nested-repo.t
465 test-nested-repo.t
466 test-newbranch.t
466 test-newbranch.t
467 test-newcgi.t
467 test-newcgi.t
468 test-newercgi.t
468 test-newercgi.t
469 test-nointerrupt.t
469 test-nointerrupt.t
470 test-notify-changegroup.t
470 test-notify-changegroup.t
471 test-obshistory.t
471 test-obshistory.t
472 test-obsmarker-template.t
472 test-obsmarker-template.t
473 test-obsmarkers-effectflag.t
473 test-obsmarkers-effectflag.t
474 test-obsolete-bounds-checking.t
474 test-obsolete-bounds-checking.t
475 test-obsolete-bundle-strip.t
475 test-obsolete-bundle-strip.t
476 test-obsolete-changeset-exchange.t
476 test-obsolete-changeset-exchange.t
477 test-obsolete-checkheads.t
477 test-obsolete-checkheads.t
478 test-obsolete-distributed.t
478 test-obsolete-distributed.t
479 test-obsolete-divergent.t
479 test-obsolete-divergent.t
480 test-obsolete-tag-cache.t
480 test-obsolete-tag-cache.t
481 test-obsolete.t
481 test-obsolete.t
482 test-oldcgi.t
482 test-oldcgi.t
483 test-origbackup-conflict.t
483 test-origbackup-conflict.t
484 test-pager-legacy.t
484 test-pager-legacy.t
485 test-pager.t
485 test-pager.t
486 test-parents.t
486 test-parents.t
487 test-parse-date.t
487 test-parse-date.t
488 test-parseindex.t
488 test-parseindex.t
489 test-parseindex2.py
489 test-parseindex2.py
490 test-patch-offset.t
490 test-patch-offset.t
491 test-patch.t
491 test-patch.t
492 test-patchbomb-bookmark.t
492 test-patchbomb-bookmark.t
493 test-patchbomb-tls.t
493 test-patchbomb-tls.t
494 test-patchbomb.t
494 test-patchbomb.t
495 test-pathconflicts-basic.t
495 test-pathconflicts-basic.t
496 test-pathconflicts-merge.t
496 test-pathconflicts-merge.t
497 test-pathconflicts-update.t
497 test-pathconflicts-update.t
498 test-pathencode.py
498 test-pathencode.py
499 test-pending.t
499 test-pending.t
500 test-permissions.t
500 test-permissions.t
501 test-phases-exchange.t
501 test-phases-exchange.t
502 test-phases.t
502 test-phases.t
503 test-profile.t
503 test-profile.t
504 test-progress.t
504 test-progress.t
505 test-propertycache.py
505 test-propertycache.py
506 test-pull-branch.t
506 test-pull-branch.t
507 test-pull-bundle.t
507 test-pull-bundle.t
508 test-pull-http.t
508 test-pull-http.t
509 test-pull-permission.t
509 test-pull-permission.t
510 test-pull-pull-corruption.t
510 test-pull-pull-corruption.t
511 test-pull-r.t
511 test-pull-r.t
512 test-pull-update.t
512 test-pull-update.t
513 test-pull.t
513 test-pull.t
514 test-purge.t
514 test-purge.t
515 test-push-cgi.t
515 test-push-cgi.t
516 test-push-checkheads-partial-C1.t
516 test-push-checkheads-partial-C1.t
517 test-push-checkheads-partial-C2.t
517 test-push-checkheads-partial-C2.t
518 test-push-checkheads-partial-C3.t
518 test-push-checkheads-partial-C3.t
519 test-push-checkheads-partial-C4.t
519 test-push-checkheads-partial-C4.t
520 test-push-checkheads-pruned-B1.t
520 test-push-checkheads-pruned-B1.t
521 test-push-checkheads-pruned-B2.t
521 test-push-checkheads-pruned-B2.t
522 test-push-checkheads-pruned-B3.t
522 test-push-checkheads-pruned-B3.t
523 test-push-checkheads-pruned-B4.t
523 test-push-checkheads-pruned-B4.t
524 test-push-checkheads-pruned-B5.t
524 test-push-checkheads-pruned-B5.t
525 test-push-checkheads-pruned-B6.t
525 test-push-checkheads-pruned-B6.t
526 test-push-checkheads-pruned-B7.t
526 test-push-checkheads-pruned-B7.t
527 test-push-checkheads-pruned-B8.t
527 test-push-checkheads-pruned-B8.t
528 test-push-checkheads-superceed-A1.t
528 test-push-checkheads-superceed-A1.t
529 test-push-checkheads-superceed-A2.t
529 test-push-checkheads-superceed-A2.t
530 test-push-checkheads-superceed-A3.t
530 test-push-checkheads-superceed-A3.t
531 test-push-checkheads-superceed-A4.t
531 test-push-checkheads-superceed-A4.t
532 test-push-checkheads-superceed-A5.t
532 test-push-checkheads-superceed-A5.t
533 test-push-checkheads-superceed-A6.t
533 test-push-checkheads-superceed-A6.t
534 test-push-checkheads-superceed-A7.t
534 test-push-checkheads-superceed-A7.t
535 test-push-checkheads-superceed-A8.t
535 test-push-checkheads-superceed-A8.t
536 test-push-checkheads-unpushed-D1.t
536 test-push-checkheads-unpushed-D1.t
537 test-push-checkheads-unpushed-D2.t
537 test-push-checkheads-unpushed-D2.t
538 test-push-checkheads-unpushed-D3.t
538 test-push-checkheads-unpushed-D3.t
539 test-push-checkheads-unpushed-D4.t
539 test-push-checkheads-unpushed-D4.t
540 test-push-checkheads-unpushed-D5.t
540 test-push-checkheads-unpushed-D5.t
541 test-push-checkheads-unpushed-D6.t
541 test-push-checkheads-unpushed-D6.t
542 test-push-checkheads-unpushed-D7.t
542 test-push-checkheads-unpushed-D7.t
543 test-push-http.t
543 test-push-http.t
544 test-push-race.t
544 test-push-race.t
545 test-push-warn.t
545 test-push-warn.t
546 test-push.t
546 test-push.t
547 test-pushvars.t
547 test-pushvars.t
548 test-qrecord.t
548 test-qrecord.t
549 test-rebase-abort.t
549 test-rebase-abort.t
550 test-rebase-backup.t
550 test-rebase-backup.t
551 test-rebase-base-flag.t
551 test-rebase-base-flag.t
552 test-rebase-bookmarks.t
552 test-rebase-bookmarks.t
553 test-rebase-brute-force.t
553 test-rebase-brute-force.t
554 test-rebase-cache.t
554 test-rebase-cache.t
555 test-rebase-check-restore.t
555 test-rebase-check-restore.t
556 test-rebase-collapse.t
556 test-rebase-collapse.t
557 test-rebase-conflicts.t
557 test-rebase-conflicts.t
558 test-rebase-dest.t
558 test-rebase-dest.t
559 test-rebase-detach.t
559 test-rebase-detach.t
560 test-rebase-emptycommit.t
560 test-rebase-emptycommit.t
561 test-rebase-inmemory.t
561 test-rebase-inmemory.t
562 test-rebase-interruptions.t
562 test-rebase-interruptions.t
563 test-rebase-issue-noparam-single-rev.t
563 test-rebase-issue-noparam-single-rev.t
564 test-rebase-legacy.t
564 test-rebase-legacy.t
565 test-rebase-mq-skip.t
565 test-rebase-mq-skip.t
566 test-rebase-mq.t
566 test-rebase-mq.t
567 test-rebase-named-branches.t
567 test-rebase-named-branches.t
568 test-rebase-newancestor.t
568 test-rebase-newancestor.t
569 test-rebase-obsolete.t
569 test-rebase-obsolete.t
570 test-rebase-parameters.t
570 test-rebase-parameters.t
571 test-rebase-partial.t
571 test-rebase-partial.t
572 test-rebase-pull.t
572 test-rebase-pull.t
573 test-rebase-rename.t
573 test-rebase-rename.t
574 test-rebase-scenario-global.t
574 test-rebase-scenario-global.t
575 test-rebase-templates.t
575 test-rebase-templates.t
576 test-rebase-transaction.t
576 test-rebase-transaction.t
577 test-rebuildstate.t
577 test-rebuildstate.t
578 test-record.t
578 test-record.t
579 test-releasenotes-formatting.t
579 test-releasenotes-formatting.t
580 test-releasenotes-merging.t
580 test-releasenotes-merging.t
581 test-releasenotes-parsing.t
581 test-releasenotes-parsing.t
582 test-relink.t
582 test-relink.t
583 test-remotefilelog-bad-configs.t
583 test-remotefilelog-bad-configs.t
584 test-remotefilelog-bgprefetch.t
584 test-remotefilelog-bgprefetch.t
585 test-remotefilelog-blame.t
585 test-remotefilelog-blame.t
586 test-remotefilelog-bundle2.t
586 test-remotefilelog-bundle2.t
587 test-remotefilelog-bundles.t
587 test-remotefilelog-bundles.t
588 test-remotefilelog-cacheprocess.t
588 test-remotefilelog-cacheprocess.t
589 test-remotefilelog-clone-tree.t
589 test-remotefilelog-clone-tree.t
590 test-remotefilelog-clone.t
590 test-remotefilelog-clone.t
591 test-remotefilelog-datapack.py
591 test-remotefilelog-gcrepack.t
592 test-remotefilelog-gcrepack.t
592 test-remotefilelog-histpack.py
593 test-remotefilelog-histpack.py
593 test-remotefilelog-http.t
594 test-remotefilelog-http.t
594 test-remotefilelog-keepset.t
595 test-remotefilelog-keepset.t
595 test-remotefilelog-local.t
596 test-remotefilelog-local.t
596 test-remotefilelog-log.t
597 test-remotefilelog-log.t
597 test-remotefilelog-partial-shallow.t
598 test-remotefilelog-partial-shallow.t
598 test-remotefilelog-permissions.t
599 test-remotefilelog-permissions.t
599 test-remotefilelog-permisssions.t
600 test-remotefilelog-permisssions.t
600 test-remotefilelog-prefetch.t
601 test-remotefilelog-prefetch.t
601 test-remotefilelog-pull-noshallow.t
602 test-remotefilelog-pull-noshallow.t
602 test-remotefilelog-share.t
603 test-remotefilelog-share.t
603 test-remotefilelog-sparse.t
604 test-remotefilelog-sparse.t
604 test-remotefilelog-tags.t
605 test-remotefilelog-tags.t
605 test-remotefilelog-wireproto.t
606 test-remotefilelog-wireproto.t
606 test-remove.t
607 test-remove.t
607 test-removeemptydirs.t
608 test-removeemptydirs.t
608 test-rename-after-merge.t
609 test-rename-after-merge.t
609 test-rename-dir-merge.t
610 test-rename-dir-merge.t
610 test-rename-merge1.t
611 test-rename-merge1.t
611 test-rename-merge2.t
612 test-rename-merge2.t
612 test-rename.t
613 test-rename.t
613 test-repair-strip.t
614 test-repair-strip.t
614 test-repo-compengines.t
615 test-repo-compengines.t
615 test-requires.t
616 test-requires.t
616 test-resolve.t
617 test-resolve.t
617 test-revert-flags.t
618 test-revert-flags.t
618 test-revert-interactive.t
619 test-revert-interactive.t
619 test-revert-unknown.t
620 test-revert-unknown.t
620 test-revert.t
621 test-revert.t
621 test-revisions.t
622 test-revisions.t
622 test-revlog-ancestry.py
623 test-revlog-ancestry.py
623 test-revlog-group-emptyiter.t
624 test-revlog-group-emptyiter.t
624 test-revlog-mmapindex.t
625 test-revlog-mmapindex.t
625 test-revlog-packentry.t
626 test-revlog-packentry.t
626 test-revlog-raw.py
627 test-revlog-raw.py
627 test-revlog-v2.t
628 test-revlog-v2.t
628 test-revlog.t
629 test-revlog.t
629 test-revset-dirstate-parents.t
630 test-revset-dirstate-parents.t
630 test-revset-legacy-lookup.t
631 test-revset-legacy-lookup.t
631 test-revset-outgoing.t
632 test-revset-outgoing.t
632 test-rollback.t
633 test-rollback.t
633 test-run-tests.py
634 test-run-tests.py
634 test-run-tests.t
635 test-run-tests.t
635 test-rust-ancestor.py
636 test-rust-ancestor.py
636 test-schemes.t
637 test-schemes.t
637 test-serve.t
638 test-serve.t
638 test-setdiscovery.t
639 test-setdiscovery.t
639 test-share.t
640 test-share.t
640 test-shelve.t
641 test-shelve.t
641 test-shelve2.t
642 test-shelve2.t
642 test-show-stack.t
643 test-show-stack.t
643 test-show-work.t
644 test-show-work.t
644 test-show.t
645 test-show.t
645 test-simple-update.t
646 test-simple-update.t
646 test-simplekeyvaluefile.py
647 test-simplekeyvaluefile.py
647 test-simplemerge.py
648 test-simplemerge.py
648 test-single-head.t
649 test-single-head.t
649 test-sparse-clear.t
650 test-sparse-clear.t
650 test-sparse-clone.t
651 test-sparse-clone.t
651 test-sparse-import.t
652 test-sparse-import.t
652 test-sparse-merges.t
653 test-sparse-merges.t
653 test-sparse-profiles.t
654 test-sparse-profiles.t
654 test-sparse-requirement.t
655 test-sparse-requirement.t
655 test-sparse-verbose-json.t
656 test-sparse-verbose-json.t
656 test-sparse.t
657 test-sparse.t
657 test-split.t
658 test-split.t
658 test-ssh-bundle1.t
659 test-ssh-bundle1.t
659 test-ssh-clone-r.t
660 test-ssh-clone-r.t
660 test-ssh-proto-unbundle.t
661 test-ssh-proto-unbundle.t
661 test-ssh-proto.t
662 test-ssh-proto.t
662 test-ssh-repoerror.t
663 test-ssh-repoerror.t
663 test-ssh.t
664 test-ssh.t
664 test-sshserver.py
665 test-sshserver.py
665 test-stack.t
666 test-stack.t
666 test-static-http.t
667 test-static-http.t
667 test-status-color.t
668 test-status-color.t
668 test-status-inprocess.py
669 test-status-inprocess.py
669 test-status-rev.t
670 test-status-rev.t
670 test-status-terse.t
671 test-status-terse.t
671 test-status.t
672 test-status.t
672 test-storage.py
673 test-storage.py
673 test-stream-bundle-v2.t
674 test-stream-bundle-v2.t
674 test-strict.t
675 test-strict.t
675 test-strip-cross.t
676 test-strip-cross.t
676 test-strip.t
677 test-strip.t
677 test-subrepo-deep-nested-change.t
678 test-subrepo-deep-nested-change.t
678 test-subrepo-missing.t
679 test-subrepo-missing.t
679 test-subrepo-paths.t
680 test-subrepo-paths.t
680 test-subrepo-recursion.t
681 test-subrepo-recursion.t
681 test-subrepo-relative-path.t
682 test-subrepo-relative-path.t
682 test-subrepo.t
683 test-subrepo.t
683 test-symlink-os-yes-fs-no.py
684 test-symlink-os-yes-fs-no.py
684 test-symlink-placeholder.t
685 test-symlink-placeholder.t
685 test-symlinks.t
686 test-symlinks.t
686 test-tag.t
687 test-tag.t
687 test-tags.t
688 test-tags.t
688 test-template-basic.t
689 test-template-basic.t
689 test-template-functions.t
690 test-template-functions.t
690 test-template-keywords.t
691 test-template-keywords.t
691 test-template-map.t
692 test-template-map.t
692 test-tools.t
693 test-tools.t
693 test-transplant.t
694 test-transplant.t
694 test-treediscovery-legacy.t
695 test-treediscovery-legacy.t
695 test-treediscovery.t
696 test-treediscovery.t
696 test-treemanifest.t
697 test-treemanifest.t
697 test-ui-color.py
698 test-ui-color.py
698 test-ui-config.py
699 test-ui-config.py
699 test-ui-verbosity.py
700 test-ui-verbosity.py
700 test-unamend.t
701 test-unamend.t
701 test-unbundlehash.t
702 test-unbundlehash.t
702 test-uncommit.t
703 test-uncommit.t
703 test-unified-test.t
704 test-unified-test.t
704 test-unionrepo.t
705 test-unionrepo.t
705 test-unrelated-pull.t
706 test-unrelated-pull.t
706 test-up-local-change.t
707 test-up-local-change.t
707 test-update-atomic.t
708 test-update-atomic.t
708 test-update-branches.t
709 test-update-branches.t
709 test-update-dest.t
710 test-update-dest.t
710 test-update-issue1456.t
711 test-update-issue1456.t
711 test-update-names.t
712 test-update-names.t
712 test-update-reverse.t
713 test-update-reverse.t
713 test-upgrade-repo.t
714 test-upgrade-repo.t
714 test-url-download.t
715 test-url-download.t
715 test-url-rev.t
716 test-url-rev.t
716 test-url.py
717 test-url.py
717 test-username-newline.t
718 test-username-newline.t
718 test-util.py
719 test-util.py
719 test-verify.t
720 test-verify.t
720 test-walk.t
721 test-walk.t
721 test-walkrepo.py
722 test-walkrepo.py
722 test-websub.t
723 test-websub.t
723 test-win32text.t
724 test-win32text.t
724 test-wireproto-caching.t
725 test-wireproto-caching.t
725 test-wireproto-clientreactor.py
726 test-wireproto-clientreactor.py
726 test-wireproto-command-branchmap.t
727 test-wireproto-command-branchmap.t
727 test-wireproto-command-capabilities.t
728 test-wireproto-command-capabilities.t
728 test-wireproto-command-changesetdata.t
729 test-wireproto-command-changesetdata.t
729 test-wireproto-command-filedata.t
730 test-wireproto-command-filedata.t
730 test-wireproto-command-filesdata.t
731 test-wireproto-command-filesdata.t
731 test-wireproto-command-heads.t
732 test-wireproto-command-heads.t
732 test-wireproto-command-known.t
733 test-wireproto-command-known.t
733 test-wireproto-command-listkeys.t
734 test-wireproto-command-listkeys.t
734 test-wireproto-command-lookup.t
735 test-wireproto-command-lookup.t
735 test-wireproto-command-manifestdata.t
736 test-wireproto-command-manifestdata.t
736 test-wireproto-command-pushkey.t
737 test-wireproto-command-pushkey.t
737 test-wireproto-command-rawstorefiledata.t
738 test-wireproto-command-rawstorefiledata.t
738 test-wireproto-content-redirects.t
739 test-wireproto-content-redirects.t
739 test-wireproto-exchangev2.t
740 test-wireproto-exchangev2.t
740 test-wireproto-framing.py
741 test-wireproto-framing.py
741 test-wireproto-serverreactor.py
742 test-wireproto-serverreactor.py
742 test-wireproto.py
743 test-wireproto.py
743 test-wireproto.t
744 test-wireproto.t
744 test-wsgirequest.py
745 test-wsgirequest.py
745 test-xdg.t
746 test-xdg.t
@@ -1,458 +1,458 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import
2
2
3 import struct
3 import struct
4 import zlib
4 import zlib
5
5
6 from mercurial.node import hex, nullid
6 from mercurial.node import hex, nullid
7 from mercurial.i18n import _
7 from mercurial.i18n import _
8 from mercurial import (
8 from mercurial import (
9 pycompat,
9 pycompat,
10 util,
10 util,
11 )
11 )
12 from . import (
12 from . import (
13 basepack,
13 basepack,
14 constants,
14 constants,
15 shallowutil,
15 shallowutil,
16 )
16 )
17
17
18 NODELENGTH = 20
18 NODELENGTH = 20
19
19
20 # The indicator value in the index for a fulltext entry.
20 # The indicator value in the index for a fulltext entry.
21 FULLTEXTINDEXMARK = -1
21 FULLTEXTINDEXMARK = -1
22 NOBASEINDEXMARK = -2
22 NOBASEINDEXMARK = -2
23
23
24 INDEXSUFFIX = '.dataidx'
24 INDEXSUFFIX = '.dataidx'
25 PACKSUFFIX = '.datapack'
25 PACKSUFFIX = '.datapack'
26
26
27 class datapackstore(basepack.basepackstore):
27 class datapackstore(basepack.basepackstore):
28 INDEXSUFFIX = INDEXSUFFIX
28 INDEXSUFFIX = INDEXSUFFIX
29 PACKSUFFIX = PACKSUFFIX
29 PACKSUFFIX = PACKSUFFIX
30
30
31 def __init__(self, ui, path):
31 def __init__(self, ui, path):
32 super(datapackstore, self).__init__(ui, path)
32 super(datapackstore, self).__init__(ui, path)
33
33
34 def getpack(self, path):
34 def getpack(self, path):
35 return datapack(path)
35 return datapack(path)
36
36
37 def get(self, name, node):
37 def get(self, name, node):
38 raise RuntimeError("must use getdeltachain with datapackstore")
38 raise RuntimeError("must use getdeltachain with datapackstore")
39
39
40 def getmeta(self, name, node):
40 def getmeta(self, name, node):
41 for pack in self.packs:
41 for pack in self.packs:
42 try:
42 try:
43 return pack.getmeta(name, node)
43 return pack.getmeta(name, node)
44 except KeyError:
44 except KeyError:
45 pass
45 pass
46
46
47 for pack in self.refresh():
47 for pack in self.refresh():
48 try:
48 try:
49 return pack.getmeta(name, node)
49 return pack.getmeta(name, node)
50 except KeyError:
50 except KeyError:
51 pass
51 pass
52
52
53 raise KeyError((name, hex(node)))
53 raise KeyError((name, hex(node)))
54
54
55 def getdelta(self, name, node):
55 def getdelta(self, name, node):
56 for pack in self.packs:
56 for pack in self.packs:
57 try:
57 try:
58 return pack.getdelta(name, node)
58 return pack.getdelta(name, node)
59 except KeyError:
59 except KeyError:
60 pass
60 pass
61
61
62 for pack in self.refresh():
62 for pack in self.refresh():
63 try:
63 try:
64 return pack.getdelta(name, node)
64 return pack.getdelta(name, node)
65 except KeyError:
65 except KeyError:
66 pass
66 pass
67
67
68 raise KeyError((name, hex(node)))
68 raise KeyError((name, hex(node)))
69
69
70 def getdeltachain(self, name, node):
70 def getdeltachain(self, name, node):
71 for pack in self.packs:
71 for pack in self.packs:
72 try:
72 try:
73 return pack.getdeltachain(name, node)
73 return pack.getdeltachain(name, node)
74 except KeyError:
74 except KeyError:
75 pass
75 pass
76
76
77 for pack in self.refresh():
77 for pack in self.refresh():
78 try:
78 try:
79 return pack.getdeltachain(name, node)
79 return pack.getdeltachain(name, node)
80 except KeyError:
80 except KeyError:
81 pass
81 pass
82
82
83 raise KeyError((name, hex(node)))
83 raise KeyError((name, hex(node)))
84
84
85 def add(self, name, node, data):
85 def add(self, name, node, data):
86 raise RuntimeError("cannot add to datapackstore")
86 raise RuntimeError("cannot add to datapackstore")
87
87
88 class datapack(basepack.basepack):
88 class datapack(basepack.basepack):
89 INDEXSUFFIX = INDEXSUFFIX
89 INDEXSUFFIX = INDEXSUFFIX
90 PACKSUFFIX = PACKSUFFIX
90 PACKSUFFIX = PACKSUFFIX
91
91
92 # Format is <node><delta offset><pack data offset><pack data size>
92 # Format is <node><delta offset><pack data offset><pack data size>
93 # See the mutabledatapack doccomment for more details.
93 # See the mutabledatapack doccomment for more details.
94 INDEXFORMAT = '!20siQQ'
94 INDEXFORMAT = '!20siQQ'
95 INDEXENTRYLENGTH = 40
95 INDEXENTRYLENGTH = 40
96
96
97 SUPPORTED_VERSIONS = [2]
97 SUPPORTED_VERSIONS = [2]
98
98
99 def getmissing(self, keys):
99 def getmissing(self, keys):
100 missing = []
100 missing = []
101 for name, node in keys:
101 for name, node in keys:
102 value = self._find(node)
102 value = self._find(node)
103 if not value:
103 if not value:
104 missing.append((name, node))
104 missing.append((name, node))
105
105
106 return missing
106 return missing
107
107
108 def get(self, name, node):
108 def get(self, name, node):
109 raise RuntimeError("must use getdeltachain with datapack (%s:%s)"
109 raise RuntimeError("must use getdeltachain with datapack (%s:%s)"
110 % (name, hex(node)))
110 % (name, hex(node)))
111
111
112 def getmeta(self, name, node):
112 def getmeta(self, name, node):
113 value = self._find(node)
113 value = self._find(node)
114 if value is None:
114 if value is None:
115 raise KeyError((name, hex(node)))
115 raise KeyError((name, hex(node)))
116
116
117 node, deltabaseoffset, offset, size = value
117 node, deltabaseoffset, offset, size = value
118 rawentry = self._data[offset:offset + size]
118 rawentry = self._data[offset:offset + size]
119
119
120 # see docstring of mutabledatapack for the format
120 # see docstring of mutabledatapack for the format
121 offset = 0
121 offset = 0
122 offset += struct.unpack_from('!H', rawentry, offset)[0] + 2 # filename
122 offset += struct.unpack_from('!H', rawentry, offset)[0] + 2 # filename
123 offset += 40 # node, deltabase node
123 offset += 40 # node, deltabase node
124 offset += struct.unpack_from('!Q', rawentry, offset)[0] + 8 # delta
124 offset += struct.unpack_from('!Q', rawentry, offset)[0] + 8 # delta
125
125
126 metalen = struct.unpack_from('!I', rawentry, offset)[0]
126 metalen = struct.unpack_from('!I', rawentry, offset)[0]
127 offset += 4
127 offset += 4
128
128
129 meta = shallowutil.parsepackmeta(rawentry[offset:offset + metalen])
129 meta = shallowutil.parsepackmeta(rawentry[offset:offset + metalen])
130
130
131 return meta
131 return meta
132
132
133 def getdelta(self, name, node):
133 def getdelta(self, name, node):
134 value = self._find(node)
134 value = self._find(node)
135 if value is None:
135 if value is None:
136 raise KeyError((name, hex(node)))
136 raise KeyError((name, hex(node)))
137
137
138 node, deltabaseoffset, offset, size = value
138 node, deltabaseoffset, offset, size = value
139 entry = self._readentry(offset, size, getmeta=True)
139 entry = self._readentry(offset, size, getmeta=True)
140 filename, node, deltabasenode, delta, meta = entry
140 filename, node, deltabasenode, delta, meta = entry
141
141
142 # If we've read a lot of data from the mmap, free some memory.
142 # If we've read a lot of data from the mmap, free some memory.
143 self.freememory()
143 self.freememory()
144
144
145 return delta, filename, deltabasenode, meta
145 return delta, filename, deltabasenode, meta
146
146
147 def getdeltachain(self, name, node):
147 def getdeltachain(self, name, node):
148 value = self._find(node)
148 value = self._find(node)
149 if value is None:
149 if value is None:
150 raise KeyError((name, hex(node)))
150 raise KeyError((name, hex(node)))
151
151
152 params = self.params
152 params = self.params
153
153
154 # Precompute chains
154 # Precompute chains
155 chain = [value]
155 chain = [value]
156 deltabaseoffset = value[1]
156 deltabaseoffset = value[1]
157 entrylen = self.INDEXENTRYLENGTH
157 entrylen = self.INDEXENTRYLENGTH
158 while (deltabaseoffset != FULLTEXTINDEXMARK
158 while (deltabaseoffset != FULLTEXTINDEXMARK
159 and deltabaseoffset != NOBASEINDEXMARK):
159 and deltabaseoffset != NOBASEINDEXMARK):
160 loc = params.indexstart + deltabaseoffset
160 loc = params.indexstart + deltabaseoffset
161 value = struct.unpack(self.INDEXFORMAT,
161 value = struct.unpack(self.INDEXFORMAT,
162 self._index[loc:loc + entrylen])
162 self._index[loc:loc + entrylen])
163 deltabaseoffset = value[1]
163 deltabaseoffset = value[1]
164 chain.append(value)
164 chain.append(value)
165
165
166 # Read chain data
166 # Read chain data
167 deltachain = []
167 deltachain = []
168 for node, deltabaseoffset, offset, size in chain:
168 for node, deltabaseoffset, offset, size in chain:
169 filename, node, deltabasenode, delta = self._readentry(offset, size)
169 filename, node, deltabasenode, delta = self._readentry(offset, size)
170 deltachain.append((filename, node, filename, deltabasenode, delta))
170 deltachain.append((filename, node, filename, deltabasenode, delta))
171
171
172 # If we've read a lot of data from the mmap, free some memory.
172 # If we've read a lot of data from the mmap, free some memory.
173 self.freememory()
173 self.freememory()
174
174
175 return deltachain
175 return deltachain
176
176
177 def _readentry(self, offset, size, getmeta=False):
177 def _readentry(self, offset, size, getmeta=False):
178 rawentry = self._data[offset:offset + size]
178 rawentry = self._data[offset:offset + size]
179 self._pagedin += len(rawentry)
179 self._pagedin += len(rawentry)
180
180
181 # <2 byte len> + <filename>
181 # <2 byte len> + <filename>
182 lengthsize = 2
182 lengthsize = 2
183 filenamelen = struct.unpack('!H', rawentry[:2])[0]
183 filenamelen = struct.unpack('!H', rawentry[:2])[0]
184 filename = rawentry[lengthsize:lengthsize + filenamelen]
184 filename = rawentry[lengthsize:lengthsize + filenamelen]
185
185
186 # <20 byte node> + <20 byte deltabase>
186 # <20 byte node> + <20 byte deltabase>
187 nodestart = lengthsize + filenamelen
187 nodestart = lengthsize + filenamelen
188 deltabasestart = nodestart + NODELENGTH
188 deltabasestart = nodestart + NODELENGTH
189 node = rawentry[nodestart:deltabasestart]
189 node = rawentry[nodestart:deltabasestart]
190 deltabasenode = rawentry[deltabasestart:deltabasestart + NODELENGTH]
190 deltabasenode = rawentry[deltabasestart:deltabasestart + NODELENGTH]
191
191
192 # <8 byte len> + <delta>
192 # <8 byte len> + <delta>
193 deltastart = deltabasestart + NODELENGTH
193 deltastart = deltabasestart + NODELENGTH
194 rawdeltalen = rawentry[deltastart:deltastart + 8]
194 rawdeltalen = rawentry[deltastart:deltastart + 8]
195 deltalen = struct.unpack('!Q', rawdeltalen)[0]
195 deltalen = struct.unpack('!Q', rawdeltalen)[0]
196
196
197 delta = rawentry[deltastart + 8:deltastart + 8 + deltalen]
197 delta = rawentry[deltastart + 8:deltastart + 8 + deltalen]
198 delta = self._decompress(delta)
198 delta = self._decompress(delta)
199
199
200 if getmeta:
200 if getmeta:
201 metastart = deltastart + 8 + deltalen
201 metastart = deltastart + 8 + deltalen
202 metalen = struct.unpack_from('!I', rawentry, metastart)[0]
202 metalen = struct.unpack_from('!I', rawentry, metastart)[0]
203
203
204 rawmeta = rawentry[metastart + 4:metastart + 4 + metalen]
204 rawmeta = rawentry[metastart + 4:metastart + 4 + metalen]
205 meta = shallowutil.parsepackmeta(rawmeta)
205 meta = shallowutil.parsepackmeta(rawmeta)
206 return filename, node, deltabasenode, delta, meta
206 return filename, node, deltabasenode, delta, meta
207 else:
207 else:
208 return filename, node, deltabasenode, delta
208 return filename, node, deltabasenode, delta
209
209
210 def _decompress(self, data):
210 def _decompress(self, data):
211 return zlib.decompress(data)
211 return zlib.decompress(data)
212
212
213 def add(self, name, node, data):
213 def add(self, name, node, data):
214 raise RuntimeError("cannot add to datapack (%s:%s)" % (name, node))
214 raise RuntimeError("cannot add to datapack (%s:%s)" % (name, node))
215
215
216 def _find(self, node):
216 def _find(self, node):
217 params = self.params
217 params = self.params
218 fanoutkey = struct.unpack(params.fanoutstruct,
218 fanoutkey = struct.unpack(params.fanoutstruct,
219 node[:params.fanoutprefix])[0]
219 node[:params.fanoutprefix])[0]
220 fanout = self._fanouttable
220 fanout = self._fanouttable
221
221
222 start = fanout[fanoutkey] + params.indexstart
222 start = fanout[fanoutkey] + params.indexstart
223 indexend = self._indexend
223 indexend = self._indexend
224
224
225 # Scan forward to find the first non-same entry, which is the upper
225 # Scan forward to find the first non-same entry, which is the upper
226 # bound.
226 # bound.
227 for i in pycompat.xrange(fanoutkey + 1, params.fanoutcount):
227 for i in pycompat.xrange(fanoutkey + 1, params.fanoutcount):
228 end = fanout[i] + params.indexstart
228 end = fanout[i] + params.indexstart
229 if end != start:
229 if end != start:
230 break
230 break
231 else:
231 else:
232 end = indexend
232 end = indexend
233
233
234 # Bisect between start and end to find node
234 # Bisect between start and end to find node
235 index = self._index
235 index = self._index
236 startnode = index[start:start + NODELENGTH]
236 startnode = index[start:start + NODELENGTH]
237 endnode = index[end:end + NODELENGTH]
237 endnode = index[end:end + NODELENGTH]
238 entrylen = self.INDEXENTRYLENGTH
238 entrylen = self.INDEXENTRYLENGTH
239 if startnode == node:
239 if startnode == node:
240 entry = index[start:start + entrylen]
240 entry = index[start:start + entrylen]
241 elif endnode == node:
241 elif endnode == node:
242 entry = index[end:end + entrylen]
242 entry = index[end:end + entrylen]
243 else:
243 else:
244 while start < end - entrylen:
244 while start < end - entrylen:
245 mid = start + (end - start) / 2
245 mid = start + (end - start) / 2
246 mid = mid - ((mid - params.indexstart) % entrylen)
246 mid = int(mid - ((mid - params.indexstart) % entrylen))
247 midnode = index[mid:mid + NODELENGTH]
247 midnode = index[mid:mid + NODELENGTH]
248 if midnode == node:
248 if midnode == node:
249 entry = index[mid:mid + entrylen]
249 entry = index[mid:mid + entrylen]
250 break
250 break
251 if node > midnode:
251 if node > midnode:
252 start = mid
252 start = mid
253 elif node < midnode:
253 elif node < midnode:
254 end = mid
254 end = mid
255 else:
255 else:
256 return None
256 return None
257
257
258 return struct.unpack(self.INDEXFORMAT, entry)
258 return struct.unpack(self.INDEXFORMAT, entry)
259
259
260 def markledger(self, ledger, options=None):
260 def markledger(self, ledger, options=None):
261 for filename, node in self:
261 for filename, node in self:
262 ledger.markdataentry(self, filename, node)
262 ledger.markdataentry(self, filename, node)
263
263
264 def cleanup(self, ledger):
264 def cleanup(self, ledger):
265 entries = ledger.sources.get(self, [])
265 entries = ledger.sources.get(self, [])
266 allkeys = set(self)
266 allkeys = set(self)
267 repackedkeys = set((e.filename, e.node) for e in entries if
267 repackedkeys = set((e.filename, e.node) for e in entries if
268 e.datarepacked or e.gced)
268 e.datarepacked or e.gced)
269
269
270 if len(allkeys - repackedkeys) == 0:
270 if len(allkeys - repackedkeys) == 0:
271 if self.path not in ledger.created:
271 if self.path not in ledger.created:
272 util.unlinkpath(self.indexpath, ignoremissing=True)
272 util.unlinkpath(self.indexpath, ignoremissing=True)
273 util.unlinkpath(self.packpath, ignoremissing=True)
273 util.unlinkpath(self.packpath, ignoremissing=True)
274
274
275 def __iter__(self):
275 def __iter__(self):
276 for f, n, deltabase, deltalen in self.iterentries():
276 for f, n, deltabase, deltalen in self.iterentries():
277 yield f, n
277 yield f, n
278
278
279 def iterentries(self):
279 def iterentries(self):
280 # Start at 1 to skip the header
280 # Start at 1 to skip the header
281 offset = 1
281 offset = 1
282 data = self._data
282 data = self._data
283 while offset < self.datasize:
283 while offset < self.datasize:
284 oldoffset = offset
284 oldoffset = offset
285
285
286 # <2 byte len> + <filename>
286 # <2 byte len> + <filename>
287 filenamelen = struct.unpack('!H', data[offset:offset + 2])[0]
287 filenamelen = struct.unpack('!H', data[offset:offset + 2])[0]
288 offset += 2
288 offset += 2
289 filename = data[offset:offset + filenamelen]
289 filename = data[offset:offset + filenamelen]
290 offset += filenamelen
290 offset += filenamelen
291
291
292 # <20 byte node>
292 # <20 byte node>
293 node = data[offset:offset + constants.NODESIZE]
293 node = data[offset:offset + constants.NODESIZE]
294 offset += constants.NODESIZE
294 offset += constants.NODESIZE
295 # <20 byte deltabase>
295 # <20 byte deltabase>
296 deltabase = data[offset:offset + constants.NODESIZE]
296 deltabase = data[offset:offset + constants.NODESIZE]
297 offset += constants.NODESIZE
297 offset += constants.NODESIZE
298
298
299 # <8 byte len> + <delta>
299 # <8 byte len> + <delta>
300 rawdeltalen = data[offset:offset + 8]
300 rawdeltalen = data[offset:offset + 8]
301 deltalen = struct.unpack('!Q', rawdeltalen)[0]
301 deltalen = struct.unpack('!Q', rawdeltalen)[0]
302 offset += 8
302 offset += 8
303
303
304 # TODO(augie): we should store a header that is the
304 # TODO(augie): we should store a header that is the
305 # uncompressed size.
305 # uncompressed size.
306 uncompressedlen = len(self._decompress(
306 uncompressedlen = len(self._decompress(
307 data[offset:offset + deltalen]))
307 data[offset:offset + deltalen]))
308 offset += deltalen
308 offset += deltalen
309
309
310 # <4 byte len> + <metadata-list>
310 # <4 byte len> + <metadata-list>
311 metalen = struct.unpack_from('!I', data, offset)[0]
311 metalen = struct.unpack_from('!I', data, offset)[0]
312 offset += 4 + metalen
312 offset += 4 + metalen
313
313
314 yield (filename, node, deltabase, uncompressedlen)
314 yield (filename, node, deltabase, uncompressedlen)
315
315
316 # If we've read a lot of data from the mmap, free some memory.
316 # If we've read a lot of data from the mmap, free some memory.
317 self._pagedin += offset - oldoffset
317 self._pagedin += offset - oldoffset
318 if self.freememory():
318 if self.freememory():
319 data = self._data
319 data = self._data
320
320
321 class mutabledatapack(basepack.mutablebasepack):
321 class mutabledatapack(basepack.mutablebasepack):
322 """A class for constructing and serializing a datapack file and index.
322 """A class for constructing and serializing a datapack file and index.
323
323
324 A datapack is a pair of files that contain the revision contents for various
324 A datapack is a pair of files that contain the revision contents for various
325 file revisions in Mercurial. It contains only revision contents (like file
325 file revisions in Mercurial. It contains only revision contents (like file
326 contents), not any history information.
326 contents), not any history information.
327
327
328 It consists of two files, with the following format. All bytes are in
328 It consists of two files, with the following format. All bytes are in
329 network byte order (big endian).
329 network byte order (big endian).
330
330
331 .datapack
331 .datapack
332 The pack itself is a series of revision deltas with some basic header
332 The pack itself is a series of revision deltas with some basic header
333 information on each. A revision delta may be a fulltext, represented by
333 information on each. A revision delta may be a fulltext, represented by
334 a deltabasenode equal to the nullid.
334 a deltabasenode equal to the nullid.
335
335
336 datapack = <version: 1 byte>
336 datapack = <version: 1 byte>
337 [<revision>,...]
337 [<revision>,...]
338 revision = <filename len: 2 byte unsigned int>
338 revision = <filename len: 2 byte unsigned int>
339 <filename>
339 <filename>
340 <node: 20 byte>
340 <node: 20 byte>
341 <deltabasenode: 20 byte>
341 <deltabasenode: 20 byte>
342 <delta len: 8 byte unsigned int>
342 <delta len: 8 byte unsigned int>
343 <delta>
343 <delta>
344 <metadata-list len: 4 byte unsigned int> [1]
344 <metadata-list len: 4 byte unsigned int> [1]
345 <metadata-list> [1]
345 <metadata-list> [1]
346 metadata-list = [<metadata-item>, ...]
346 metadata-list = [<metadata-item>, ...]
347 metadata-item = <metadata-key: 1 byte>
347 metadata-item = <metadata-key: 1 byte>
348 <metadata-value len: 2 byte unsigned>
348 <metadata-value len: 2 byte unsigned>
349 <metadata-value>
349 <metadata-value>
350
350
351 metadata-key could be METAKEYFLAG or METAKEYSIZE or other single byte
351 metadata-key could be METAKEYFLAG or METAKEYSIZE or other single byte
352 value in the future.
352 value in the future.
353
353
354 .dataidx
354 .dataidx
355 The index file consists of two parts, the fanout and the index.
355 The index file consists of two parts, the fanout and the index.
356
356
357 The index is a list of index entries, sorted by node (one per revision
357 The index is a list of index entries, sorted by node (one per revision
358 in the pack). Each entry has:
358 in the pack). Each entry has:
359
359
360 - node (The 20 byte node of the entry; i.e. the commit hash, file node
360 - node (The 20 byte node of the entry; i.e. the commit hash, file node
361 hash, etc)
361 hash, etc)
362 - deltabase index offset (The location in the index of the deltabase for
362 - deltabase index offset (The location in the index of the deltabase for
363 this entry. The deltabase is the next delta in
363 this entry. The deltabase is the next delta in
364 the chain, with the chain eventually
364 the chain, with the chain eventually
365 terminating in a full-text, represented by a
365 terminating in a full-text, represented by a
366 deltabase offset of -1. This lets us compute
366 deltabase offset of -1. This lets us compute
367 delta chains from the index, then do
367 delta chains from the index, then do
368 sequential reads from the pack if the revision
368 sequential reads from the pack if the revision
369 are nearby on disk.)
369 are nearby on disk.)
370 - pack entry offset (The location of this entry in the datapack)
370 - pack entry offset (The location of this entry in the datapack)
371 - pack content size (The on-disk length of this entry's pack data)
371 - pack content size (The on-disk length of this entry's pack data)
372
372
373 The fanout is a quick lookup table to reduce the number of steps for
373 The fanout is a quick lookup table to reduce the number of steps for
374 bisecting the index. It is a series of 4 byte pointers to positions
374 bisecting the index. It is a series of 4 byte pointers to positions
375 within the index. It has 2^16 entries, which corresponds to hash
375 within the index. It has 2^16 entries, which corresponds to hash
376 prefixes [0000, 0001,..., FFFE, FFFF]. Example: the pointer in slot
376 prefixes [0000, 0001,..., FFFE, FFFF]. Example: the pointer in slot
377 4F0A points to the index position of the first revision whose node
377 4F0A points to the index position of the first revision whose node
378 starts with 4F0A. This saves log(2^16)=16 bisect steps.
378 starts with 4F0A. This saves log(2^16)=16 bisect steps.
379
379
380 dataidx = <fanouttable>
380 dataidx = <fanouttable>
381 <index>
381 <index>
382 fanouttable = [<index offset: 4 byte unsigned int>,...] (2^16 entries)
382 fanouttable = [<index offset: 4 byte unsigned int>,...] (2^16 entries)
383 index = [<index entry>,...]
383 index = [<index entry>,...]
384 indexentry = <node: 20 byte>
384 indexentry = <node: 20 byte>
385 <deltabase location: 4 byte signed int>
385 <deltabase location: 4 byte signed int>
386 <pack entry offset: 8 byte unsigned int>
386 <pack entry offset: 8 byte unsigned int>
387 <pack entry size: 8 byte unsigned int>
387 <pack entry size: 8 byte unsigned int>
388
388
389 [1]: new in version 1.
389 [1]: new in version 1.
390 """
390 """
391 INDEXSUFFIX = INDEXSUFFIX
391 INDEXSUFFIX = INDEXSUFFIX
392 PACKSUFFIX = PACKSUFFIX
392 PACKSUFFIX = PACKSUFFIX
393
393
394 # v[01] index format: <node><delta offset><pack data offset><pack data size>
394 # v[01] index format: <node><delta offset><pack data offset><pack data size>
395 INDEXFORMAT = datapack.INDEXFORMAT
395 INDEXFORMAT = datapack.INDEXFORMAT
396 INDEXENTRYLENGTH = datapack.INDEXENTRYLENGTH
396 INDEXENTRYLENGTH = datapack.INDEXENTRYLENGTH
397
397
398 # v1 has metadata support
398 # v1 has metadata support
399 SUPPORTED_VERSIONS = [2]
399 SUPPORTED_VERSIONS = [2]
400
400
401 def _compress(self, data):
401 def _compress(self, data):
402 return zlib.compress(data)
402 return zlib.compress(data)
403
403
404 def add(self, name, node, deltabasenode, delta, metadata=None):
404 def add(self, name, node, deltabasenode, delta, metadata=None):
405 # metadata is a dict, ex. {METAKEYFLAG: flag}
405 # metadata is a dict, ex. {METAKEYFLAG: flag}
406 if len(name) > 2**16:
406 if len(name) > 2**16:
407 raise RuntimeError(_("name too long %s") % name)
407 raise RuntimeError(_("name too long %s") % name)
408 if len(node) != 20:
408 if len(node) != 20:
409 raise RuntimeError(_("node should be 20 bytes %s") % node)
409 raise RuntimeError(_("node should be 20 bytes %s") % node)
410
410
411 if node in self.entries:
411 if node in self.entries:
412 # The revision has already been added
412 # The revision has already been added
413 return
413 return
414
414
415 # TODO: allow configurable compression
415 # TODO: allow configurable compression
416 delta = self._compress(delta)
416 delta = self._compress(delta)
417
417
418 rawdata = ''.join((
418 rawdata = ''.join((
419 struct.pack('!H', len(name)), # unsigned 2 byte int
419 struct.pack('!H', len(name)), # unsigned 2 byte int
420 name,
420 name,
421 node,
421 node,
422 deltabasenode,
422 deltabasenode,
423 struct.pack('!Q', len(delta)), # unsigned 8 byte int
423 struct.pack('!Q', len(delta)), # unsigned 8 byte int
424 delta,
424 delta,
425 ))
425 ))
426
426
427 # v1 support metadata
427 # v1 support metadata
428 rawmeta = shallowutil.buildpackmeta(metadata)
428 rawmeta = shallowutil.buildpackmeta(metadata)
429 rawdata += struct.pack('!I', len(rawmeta)) # unsigned 4 byte
429 rawdata += struct.pack('!I', len(rawmeta)) # unsigned 4 byte
430 rawdata += rawmeta
430 rawdata += rawmeta
431
431
432 offset = self.packfp.tell()
432 offset = self.packfp.tell()
433
433
434 size = len(rawdata)
434 size = len(rawdata)
435
435
436 self.entries[node] = (deltabasenode, offset, size)
436 self.entries[node] = (deltabasenode, offset, size)
437
437
438 self.writeraw(rawdata)
438 self.writeraw(rawdata)
439
439
440 def createindex(self, nodelocations, indexoffset):
440 def createindex(self, nodelocations, indexoffset):
441 entries = sorted((n, db, o, s) for n, (db, o, s)
441 entries = sorted((n, db, o, s) for n, (db, o, s)
442 in self.entries.iteritems())
442 in self.entries.iteritems())
443
443
444 rawindex = ''
444 rawindex = ''
445 fmt = self.INDEXFORMAT
445 fmt = self.INDEXFORMAT
446 for node, deltabase, offset, size in entries:
446 for node, deltabase, offset, size in entries:
447 if deltabase == nullid:
447 if deltabase == nullid:
448 deltabaselocation = FULLTEXTINDEXMARK
448 deltabaselocation = FULLTEXTINDEXMARK
449 else:
449 else:
450 # Instead of storing the deltabase node in the index, let's
450 # Instead of storing the deltabase node in the index, let's
451 # store a pointer directly to the index entry for the deltabase.
451 # store a pointer directly to the index entry for the deltabase.
452 deltabaselocation = nodelocations.get(deltabase,
452 deltabaselocation = nodelocations.get(deltabase,
453 NOBASEINDEXMARK)
453 NOBASEINDEXMARK)
454
454
455 entry = struct.pack(fmt, node, deltabaselocation, offset, size)
455 entry = struct.pack(fmt, node, deltabaselocation, offset, size)
456 rawindex += entry
456 rawindex += entry
457
457
458 return rawindex
458 return rawindex
General Comments 0
You need to be logged in to leave comments. Login now