##// END OF EJS Templates
py3: byteify contrib/dumprevlog
Matt Harbison -
r39983:a063b84c default
parent child Browse files
Show More
@@ -1,37 +1,43
1 1 #!/usr/bin/env python
2 2 # Dump revlogs as raw data stream
3 3 # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump
4 4
5 5 from __future__ import absolute_import, print_function
6 6
7 7 import sys
8 8 from mercurial import (
9 encoding,
9 10 node,
11 pycompat,
10 12 revlog,
11 13 )
12 14 from mercurial.utils import (
13 15 procutil,
14 16 )
15 17
16 18 for fp in (sys.stdin, sys.stdout, sys.stderr):
17 19 procutil.setbinary(fp)
18 20
19 def binopen(path, mode='rb'):
20 if 'b' not in mode:
21 mode = mode + 'b'
22 return open(path, mode)
21 def binopen(path, mode=b'rb'):
22 if b'b' not in mode:
23 mode = mode + b'b'
24 return open(path, pycompat.sysstr(mode))
25
26 def printb(data, end=b'\n'):
27 sys.stdout.flush()
28 pycompat.stdout.write(data + end)
23 29
24 30 for f in sys.argv[1:]:
25 r = revlog.revlog(binopen, f)
31 r = revlog.revlog(binopen, encoding.strtolocal(f))
26 32 print("file:", f)
27 33 for i in r:
28 34 n = r.node(i)
29 35 p = r.parents(n)
30 36 d = r.revision(n)
31 print("node:", node.hex(n))
32 print("linkrev:", r.linkrev(i))
33 print("parents:", node.hex(p[0]), node.hex(p[1]))
34 print("length:", len(d))
35 print("-start-")
36 print(d)
37 print("-end-")
37 printb(b"node: %s" % node.hex(n))
38 printb(b"linkrev: %d" % r.linkrev(i))
39 printb(b"parents: %s %s" % (node.hex(p[0]), node.hex(p[1])))
40 printb(b"length: %d" % len(d))
41 printb(b"-start-")
42 printb(d)
43 printb(b"-end-")
@@ -1,578 +1,579
1 1 test-abort-checkin.t
2 2 test-absorb-filefixupstate.py
3 3 test-absorb-phase.t
4 4 test-absorb-rename.t
5 5 test-absorb-strip.t
6 6 test-absorb.t
7 7 test-add.t
8 8 test-addremove-similar.t
9 9 test-addremove.t
10 10 test-alias.t
11 11 test-amend-subrepo.t
12 12 test-amend.t
13 13 test-ancestor.py
14 14 test-annotate.py
15 15 test-annotate.t
16 16 test-archive-symlinks.t
17 17 test-atomictempfile.py
18 18 test-audit-path.t
19 19 test-audit-subrepo.t
20 20 test-automv.t
21 21 test-backout.t
22 22 test-backwards-remove.t
23 23 test-bad-pull.t
24 24 test-basic.t
25 25 test-bdiff.py
26 26 test-bheads.t
27 27 test-bisect.t
28 28 test-bisect2.t
29 29 test-bisect3.t
30 30 test-blackbox.t
31 31 test-bookmarks-current.t
32 32 test-bookmarks-merge.t
33 33 test-bookmarks-pushpull.t
34 34 test-bookmarks-rebase.t
35 35 test-bookmarks-strip.t
36 36 test-bookmarks.t
37 37 test-branch-change.t
38 38 test-branch-option.t
39 39 test-branch-tag-confict.t
40 40 test-branches.t
41 41 test-bundle-phases.t
42 42 test-bundle-r.t
43 43 test-bundle-type.t
44 44 test-bundle-vs-outgoing.t
45 45 test-bundle.t
46 46 test-bundle2-exchange.t
47 47 test-bundle2-format.t
48 48 test-bundle2-multiple-changegroups.t
49 49 test-bundle2-pushback.t
50 50 test-bundle2-remote-changegroup.t
51 51 test-cappedreader.py
52 52 test-casecollision.t
53 53 test-cat.t
54 54 test-cbor.py
55 55 test-censor.t
56 56 test-changelog-exec.t
57 57 test-check-code.t
58 58 test-check-commit.t
59 59 test-check-execute.t
60 60 test-check-interfaces.py
61 61 test-check-module-imports.t
62 62 test-check-py3-compat.t
63 63 test-check-pyflakes.t
64 64 test-check-pylint.t
65 65 test-check-shbang.t
66 66 test-children.t
67 67 test-clone-cgi.t
68 68 test-clone-pull-corruption.t
69 69 test-clone-r.t
70 70 test-clone-uncompressed.t
71 71 test-clone-update-order.t
72 72 test-clonebundles.t
73 73 test-commit-amend.t
74 74 test-commit-interactive.t
75 75 test-commit-multiple.t
76 76 test-commit-unresolved.t
77 77 test-commit.t
78 78 test-committer.t
79 79 test-completion.t
80 80 test-config-env.py
81 81 test-config.t
82 82 test-conflict.t
83 83 test-confused-revert.t
84 84 test-context.py
85 85 test-contrib-check-code.t
86 86 test-contrib-check-commit.t
87 87 test-convert-authormap.t
88 88 test-convert-clonebranches.t
89 89 test-convert-cvs-branch.t
90 90 test-convert-cvs-detectmerge.t
91 91 test-convert-cvs-synthetic.t
92 92 test-convert-cvs.t
93 93 test-convert-cvsnt-mergepoints.t
94 94 test-convert-datesort.t
95 test-contrib-dumprevlog.t
95 96 test-convert-filemap.t
96 97 test-convert-hg-sink.t
97 98 test-convert-hg-source.t
98 99 test-convert-hg-startrev.t
99 100 test-convert-splicemap.t
100 101 test-convert-tagsbranch-topology.t
101 102 test-copy-move-merge.t
102 103 test-copy.t
103 104 test-copytrace-heuristics.t
104 105 test-debugbuilddag.t
105 106 test-debugbundle.t
106 107 test-debugcommands.t
107 108 test-debugextensions.t
108 109 test-debugindexdot.t
109 110 test-debugrename.t
110 111 test-default-push.t
111 112 test-diff-antipatience.t
112 113 test-diff-binary-file.t
113 114 test-diff-change.t
114 115 test-diff-copy-depth.t
115 116 test-diff-hashes.t
116 117 test-diff-ignore-whitespace.t
117 118 test-diff-indent-heuristic.t
118 119 test-diff-issue2761.t
119 120 test-diff-newlines.t
120 121 test-diff-reverse.t
121 122 test-diff-subdir.t
122 123 test-diff-unified.t
123 124 test-diff-upgrade.t
124 125 test-diffdir.t
125 126 test-diffstat.t
126 127 test-directaccess.t
127 128 test-dirstate-backup.t
128 129 test-dirstate-nonnormalset.t
129 130 test-dirstate.t
130 131 test-dispatch.py
131 132 test-doctest.py
132 133 test-double-merge.t
133 134 test-drawdag.t
134 135 test-duplicateoptions.py
135 136 test-editor-filename.t
136 137 test-empty-dir.t
137 138 test-empty-file.t
138 139 test-empty-group.t
139 140 test-empty.t
140 141 test-encode.t
141 142 test-encoding-func.py
142 143 test-encoding.t
143 144 test-eol-add.t
144 145 test-eol-clone.t
145 146 test-eol-hook.t
146 147 test-eol-patch.t
147 148 test-eol-tag.t
148 149 test-eol-update.t
149 150 test-eol.t
150 151 test-eolfilename.t
151 152 test-excessive-merge.t
152 153 test-exchange-obsmarkers-case-A1.t
153 154 test-exchange-obsmarkers-case-A2.t
154 155 test-exchange-obsmarkers-case-A3.t
155 156 test-exchange-obsmarkers-case-A4.t
156 157 test-exchange-obsmarkers-case-A5.t
157 158 test-exchange-obsmarkers-case-A6.t
158 159 test-exchange-obsmarkers-case-A7.t
159 160 test-exchange-obsmarkers-case-B1.t
160 161 test-exchange-obsmarkers-case-B2.t
161 162 test-exchange-obsmarkers-case-B3.t
162 163 test-exchange-obsmarkers-case-B4.t
163 164 test-exchange-obsmarkers-case-B5.t
164 165 test-exchange-obsmarkers-case-B6.t
165 166 test-exchange-obsmarkers-case-B7.t
166 167 test-exchange-obsmarkers-case-C1.t
167 168 test-exchange-obsmarkers-case-C2.t
168 169 test-exchange-obsmarkers-case-C3.t
169 170 test-exchange-obsmarkers-case-C4.t
170 171 test-exchange-obsmarkers-case-D1.t
171 172 test-exchange-obsmarkers-case-D2.t
172 173 test-exchange-obsmarkers-case-D3.t
173 174 test-exchange-obsmarkers-case-D4.t
174 175 test-execute-bit.t
175 176 test-export.t
176 177 test-extdata.t
177 178 test-extdiff.t
178 179 test-extensions-afterloaded.t
179 180 test-extensions-wrapfunction.py
180 181 test-extra-filelog-entry.t
181 182 test-fetch.t
182 183 test-filebranch.t
183 184 test-filecache.py
184 185 test-filelog.py
185 186 test-fileset-generated.t
186 187 test-fileset.t
187 188 test-fix-topology.t
188 189 test-flags.t
189 190 test-generaldelta.t
190 191 test-getbundle.t
191 192 test-git-export.t
192 193 test-glog-beautifygraph.t
193 194 test-glog-topological.t
194 195 test-glog.t
195 196 test-gpg.t
196 197 test-graft.t
197 198 test-grep.t
198 199 test-hg-parseurl.py
199 200 test-hghave.t
200 201 test-hgignore.t
201 202 test-hgk.t
202 203 test-hgrc.t
203 204 test-hgweb-bundle.t
204 205 test-hgweb-descend-empties.t
205 206 test-hgweb-empty.t
206 207 test-hgweb-non-interactive.t
207 208 test-hgweb-removed.t
208 209 test-hgwebdir-paths.py
209 210 test-hgwebdirsym.t
210 211 test-histedit-arguments.t
211 212 test-histedit-base.t
212 213 test-histedit-bookmark-motion.t
213 214 test-histedit-commute.t
214 215 test-histedit-drop.t
215 216 test-histedit-edit.t
216 217 test-histedit-fold-non-commute.t
217 218 test-histedit-fold.t
218 219 test-histedit-no-backup.t
219 220 test-histedit-no-change.t
220 221 test-histedit-non-commute-abort.t
221 222 test-histedit-non-commute.t
222 223 test-histedit-obsolete.t
223 224 test-histedit-outgoing.t
224 225 test-histedit-templates.t
225 226 test-http-branchmap.t
226 227 test-http-bundle1.t
227 228 test-http-clone-r.t
228 229 test-http-permissions.t
229 230 test-http.t
230 231 test-hybridencode.py
231 232 test-identify.t
232 233 test-impexp-branch.t
233 234 test-import-bypass.t
234 235 test-import-eol.t
235 236 test-import-merge.t
236 237 test-import-unknown.t
237 238 test-import.t
238 239 test-imports-checker.t
239 240 test-incoming-outgoing.t
240 241 test-inherit-mode.t
241 242 test-init.t
242 243 test-issue1089.t
243 244 test-issue1102.t
244 245 test-issue1175.t
245 246 test-issue1306.t
246 247 test-issue1438.t
247 248 test-issue1502.t
248 249 test-issue1802.t
249 250 test-issue1877.t
250 251 test-issue1993.t
251 252 test-issue2137.t
252 253 test-issue3084.t
253 254 test-issue4074.t
254 255 test-issue522.t
255 256 test-issue586.t
256 257 test-issue5979.t
257 258 test-issue612.t
258 259 test-issue619.t
259 260 test-issue660.t
260 261 test-issue672.t
261 262 test-issue842.t
262 263 test-journal-exists.t
263 264 test-journal-share.t
264 265 test-journal.t
265 266 test-known.t
266 267 test-largefiles-cache.t
267 268 test-largefiles-misc.t
268 269 test-largefiles-small-disk.t
269 270 test-largefiles-update.t
270 271 test-largefiles.t
271 272 test-lfs-largefiles.t
272 273 test-lfs-pointer.py
273 274 test-linelog.py
274 275 test-linerange.py
275 276 test-locate.t
276 277 test-lock-badness.t
277 278 test-log-linerange.t
278 279 test-log.t
279 280 test-logexchange.t
280 281 test-lrucachedict.py
281 282 test-mactext.t
282 283 test-mailmap.t
283 284 test-manifest-merging.t
284 285 test-manifest.py
285 286 test-manifest.t
286 287 test-match.py
287 288 test-mdiff.py
288 289 test-merge-changedelete.t
289 290 test-merge-closedheads.t
290 291 test-merge-commit.t
291 292 test-merge-criss-cross.t
292 293 test-merge-default.t
293 294 test-merge-force.t
294 295 test-merge-halt.t
295 296 test-merge-internal-tools-pattern.t
296 297 test-merge-local.t
297 298 test-merge-no-file-change.t
298 299 test-merge-remove.t
299 300 test-merge-revert.t
300 301 test-merge-revert2.t
301 302 test-merge-subrepos.t
302 303 test-merge-symlinks.t
303 304 test-merge-tools.t
304 305 test-merge-types.t
305 306 test-merge1.t
306 307 test-merge10.t
307 308 test-merge2.t
308 309 test-merge4.t
309 310 test-merge5.t
310 311 test-merge6.t
311 312 test-merge7.t
312 313 test-merge8.t
313 314 test-merge9.t
314 315 test-minifileset.py
315 316 test-minirst.py
316 317 test-mq-git.t
317 318 test-mq-guards.t
318 319 test-mq-header-date.t
319 320 test-mq-header-from.t
320 321 test-mq-merge.t
321 322 test-mq-pull-from-bundle.t
322 323 test-mq-qclone-http.t
323 324 test-mq-qdelete.t
324 325 test-mq-qdiff.t
325 326 test-mq-qfold.t
326 327 test-mq-qgoto.t
327 328 test-mq-qimport-fail-cleanup.t
328 329 test-mq-qnew.t
329 330 test-mq-qpush-exact.t
330 331 test-mq-qpush-fail.t
331 332 test-mq-qqueue.t
332 333 test-mq-qrefresh-interactive.t
333 334 test-mq-qrefresh-replace-log-message.t
334 335 test-mq-qrefresh.t
335 336 test-mq-qrename.t
336 337 test-mq-qsave.t
337 338 test-mq-safety.t
338 339 test-mq-subrepo.t
339 340 test-mq-symlinks.t
340 341 test-mq.t
341 342 test-mv-cp-st-diff.t
342 343 test-narrow-acl.t
343 344 test-narrow-archive.t
344 345 test-narrow-clone-no-ellipsis.t
345 346 test-narrow-clone-non-narrow-server.t
346 347 test-narrow-clone-nonlinear.t
347 348 test-narrow-clone.t
348 349 test-narrow-commit.t
349 350 test-narrow-copies.t
350 351 test-narrow-debugcommands.t
351 352 test-narrow-debugrebuilddirstate.t
352 353 test-narrow-exchange-merges.t
353 354 test-narrow-exchange.t
354 355 test-narrow-expanddirstate.t
355 356 test-narrow-merge.t
356 357 test-narrow-patch.t
357 358 test-narrow-patterns.t
358 359 test-narrow-pull.t
359 360 test-narrow-rebase.t
360 361 test-narrow-shallow-merges.t
361 362 test-narrow-shallow.t
362 363 test-narrow-strip.t
363 364 test-narrow-trackedcmd.t
364 365 test-narrow-update.t
365 366 test-narrow-widen-no-ellipsis.t
366 367 test-narrow-widen.t
367 368 test-narrow.t
368 369 test-nested-repo.t
369 370 test-newbranch.t
370 371 test-newercgi.t
371 372 test-nointerrupt.t
372 373 test-obshistory.t
373 374 test-obsmarker-template.t
374 375 test-obsmarkers-effectflag.t
375 376 test-obsolete-bounds-checking.t
376 377 test-obsolete-bundle-strip.t
377 378 test-obsolete-changeset-exchange.t
378 379 test-obsolete-checkheads.t
379 380 test-obsolete-distributed.t
380 381 test-obsolete-divergent.t
381 382 test-obsolete-tag-cache.t
382 383 test-pager.t
383 384 test-parents.t
384 385 test-parseindex2.py
385 386 test-patch-offset.t
386 387 test-patch.t
387 388 test-patchbomb-bookmark.t
388 389 test-patchbomb-tls.t
389 390 test-patchbomb.t
390 391 test-pathconflicts-merge.t
391 392 test-pathconflicts-update.t
392 393 test-pathencode.py
393 394 test-pending.t
394 395 test-permissions.t
395 396 test-phases.t
396 397 test-pull-branch.t
397 398 test-pull-http.t
398 399 test-pull-permission.t
399 400 test-pull-pull-corruption.t
400 401 test-pull-r.t
401 402 test-pull-update.t
402 403 test-pull.t
403 404 test-purge.t
404 405 test-push-cgi.t
405 406 test-push-checkheads-partial-C1.t
406 407 test-push-checkheads-partial-C2.t
407 408 test-push-checkheads-partial-C3.t
408 409 test-push-checkheads-partial-C4.t
409 410 test-push-checkheads-pruned-B1.t
410 411 test-push-checkheads-pruned-B2.t
411 412 test-push-checkheads-pruned-B3.t
412 413 test-push-checkheads-pruned-B4.t
413 414 test-push-checkheads-pruned-B5.t
414 415 test-push-checkheads-pruned-B6.t
415 416 test-push-checkheads-pruned-B7.t
416 417 test-push-checkheads-pruned-B8.t
417 418 test-push-checkheads-superceed-A1.t
418 419 test-push-checkheads-superceed-A2.t
419 420 test-push-checkheads-superceed-A3.t
420 421 test-push-checkheads-superceed-A4.t
421 422 test-push-checkheads-superceed-A5.t
422 423 test-push-checkheads-superceed-A6.t
423 424 test-push-checkheads-superceed-A7.t
424 425 test-push-checkheads-superceed-A8.t
425 426 test-push-checkheads-unpushed-D1.t
426 427 test-push-checkheads-unpushed-D2.t
427 428 test-push-checkheads-unpushed-D3.t
428 429 test-push-checkheads-unpushed-D4.t
429 430 test-push-checkheads-unpushed-D5.t
430 431 test-push-checkheads-unpushed-D6.t
431 432 test-push-checkheads-unpushed-D7.t
432 433 test-push-http.t
433 434 test-push-warn.t
434 435 test-push.t
435 436 test-pushvars.t
436 437 test-qrecord.t
437 438 test-rebase-abort.t
438 439 test-rebase-backup.t
439 440 test-rebase-base-flag.t
440 441 test-rebase-bookmarks.t
441 442 test-rebase-brute-force.t
442 443 test-rebase-cache.t
443 444 test-rebase-check-restore.t
444 445 test-rebase-collapse.t
445 446 test-rebase-conflicts.t
446 447 test-rebase-dest.t
447 448 test-rebase-detach.t
448 449 test-rebase-emptycommit.t
449 450 test-rebase-inmemory.t
450 451 test-rebase-interruptions.t
451 452 test-rebase-issue-noparam-single-rev.t
452 453 test-rebase-legacy.t
453 454 test-rebase-mq-skip.t
454 455 test-rebase-mq.t
455 456 test-rebase-named-branches.t
456 457 test-rebase-newancestor.t
457 458 test-rebase-obsolete.t
458 459 test-rebase-parameters.t
459 460 test-rebase-partial.t
460 461 test-rebase-pull.t
461 462 test-rebase-rename.t
462 463 test-rebase-scenario-global.t
463 464 test-rebase-templates.t
464 465 test-rebase-transaction.t
465 466 test-rebuildstate.t
466 467 test-record.t
467 468 test-relink.t
468 469 test-remove.t
469 470 test-removeemptydirs.t
470 471 test-rename-after-merge.t
471 472 test-rename-dir-merge.t
472 473 test-rename-merge1.t
473 474 test-rename-merge2.t
474 475 test-rename.t
475 476 test-repair-strip.t
476 477 test-repo-compengines.t
477 478 test-resolve.t
478 479 test-revert-flags.t
479 480 test-revert-interactive.t
480 481 test-revert-unknown.t
481 482 test-revert.t
482 483 test-revisions.t
483 484 test-revlog-ancestry.py
484 485 test-revlog-group-emptyiter.t
485 486 test-revlog-mmapindex.t
486 487 test-revlog-packentry.t
487 488 test-revlog-raw.py
488 489 test-revlog-v2.t
489 490 test-revset-dirstate-parents.t
490 491 test-revset-legacy-lookup.t
491 492 test-revset-outgoing.t
492 493 test-rollback.t
493 494 test-run-tests.py
494 495 test-run-tests.t
495 496 test-schemes.t
496 497 test-serve.t
497 498 test-setdiscovery.t
498 499 test-share.t
499 500 test-shelve.t
500 501 test-show-stack.t
501 502 test-show-work.t
502 503 test-show.t
503 504 test-simple-update.t
504 505 test-simplekeyvaluefile.py
505 506 test-simplemerge.py
506 507 test-single-head.t
507 508 test-sparse-clear.t
508 509 test-sparse-clone.t
509 510 test-sparse-import.t
510 511 test-sparse-merges.t
511 512 test-sparse-profiles.t
512 513 test-sparse-requirement.t
513 514 test-sparse-verbose-json.t
514 515 test-sparse.t
515 516 test-split.t
516 517 test-ssh-bundle1.t
517 518 test-ssh-clone-r.t
518 519 test-ssh-proto-unbundle.t
519 520 test-ssh-proto.t
520 521 test-ssh.t
521 522 test-sshserver.py
522 523 test-stack.t
523 524 test-status-inprocess.py
524 525 test-status-rev.t
525 526 test-status-terse.t
526 527 test-stream-bundle-v2.t
527 528 test-strict.t
528 529 test-strip-cross.t
529 530 test-strip.t
530 531 test-subrepo-deep-nested-change.t
531 532 test-subrepo-missing.t
532 533 test-subrepo-paths.t
533 534 test-subrepo-recursion.t
534 535 test-subrepo-relative-path.t
535 536 test-subrepo.t
536 537 test-symlink-os-yes-fs-no.py
537 538 test-symlink-placeholder.t
538 539 test-symlinks.t
539 540 test-tag.t
540 541 test-tags.t
541 542 test-template-basic.t
542 543 test-template-functions.t
543 544 test-template-keywords.t
544 545 test-template-map.t
545 546 test-transplant.t
546 547 test-treemanifest.t
547 548 test-ui-color.py
548 549 test-ui-config.py
549 550 test-ui-verbosity.py
550 551 test-unamend.t
551 552 test-unbundlehash.t
552 553 test-uncommit.t
553 554 test-unified-test.t
554 555 test-unionrepo.t
555 556 test-unrelated-pull.t
556 557 test-up-local-change.t
557 558 test-update-branches.t
558 559 test-update-dest.t
559 560 test-update-issue1456.t
560 561 test-update-names.t
561 562 test-update-reverse.t
562 563 test-upgrade-repo.t
563 564 test-url-download.t
564 565 test-url-rev.t
565 566 test-url.py
566 567 test-username-newline.t
567 568 test-util.py
568 569 test-verify.t
569 570 test-walk.t
570 571 test-walkrepo.py
571 572 test-websub.t
572 573 test-win32text.t
573 574 test-wireproto-clientreactor.py
574 575 test-wireproto-framing.py
575 576 test-wireproto-serverreactor.py
576 577 test-wireproto.py
577 578 test-wsgirequest.py
578 579 test-xdg.t
@@ -1,48 +1,50
1 1 #!/usr/bin/env python
2 2 # Undump a dump from dumprevlog
3 3 # $ hg init
4 4 # $ undumprevlog < repo.dump
5 5
6 6 from __future__ import absolute_import, print_function
7 7
8 8 import sys
9 9 from mercurial import (
10 encoding,
10 11 node,
12 pycompat,
11 13 revlog,
12 14 transaction,
13 15 vfs as vfsmod,
14 16 )
15 17 from mercurial.utils import (
16 18 procutil,
17 19 )
18 20
19 21 for fp in (sys.stdin, sys.stdout, sys.stderr):
20 22 procutil.setbinary(fp)
21 23
22 opener = vfsmod.vfs('.', False)
23 tr = transaction.transaction(sys.stderr.write, opener, {'store': opener},
24 "undump.journal")
24 opener = vfsmod.vfs(b'.', False)
25 tr = transaction.transaction(sys.stderr.write, opener, {b'store': opener},
26 b"undump.journal")
25 27 while True:
26 28 l = sys.stdin.readline()
27 29 if not l:
28 30 break
29 31 if l.startswith("file:"):
30 f = l[6:-1]
32 f = encoding.strtolocal(l[6:-1])
31 33 r = revlog.revlog(opener, f)
32 print(f)
34 pycompat.stdout.write(b'%s\n' % f)
33 35 elif l.startswith("node:"):
34 36 n = node.bin(l[6:-1])
35 37 elif l.startswith("linkrev:"):
36 38 lr = int(l[9:-1])
37 39 elif l.startswith("parents:"):
38 40 p = l[9:-1].split()
39 41 p1 = node.bin(p[0])
40 42 p2 = node.bin(p[1])
41 43 elif l.startswith("length:"):
42 44 length = int(l[8:-1])
43 45 sys.stdin.readline() # start marker
44 d = sys.stdin.read(length)
46 d = encoding.strtolocal(sys.stdin.read(length))
45 47 sys.stdin.readline() # end marker
46 48 r.addrevision(d, tr, lr, p1, p2)
47 49
48 50 tr.close()
General Comments 0
You need to be logged in to leave comments. Login now