Show More
@@ -0,0 +1,60 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # Copyright 2010 Intevation GmbH | |
|
3 | # Author(s): | |
|
4 | # Thomas Arendsen Hein <thomas@intevation.de> | |
|
5 | # | |
|
6 | # This software may be used and distributed according to the terms of the | |
|
7 | # GNU General Public License version 2 or any later version. | |
|
8 | ||
|
9 | """Create a Mercurial repository in revlog format 0 | |
|
10 | ||
|
11 | changeset: 0:a1ef0b125355 | |
|
12 | tag: tip | |
|
13 | user: user | |
|
14 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
15 | files: empty | |
|
16 | description: | |
|
17 | empty file | |
|
18 | """ | |
|
19 | ||
|
20 | import os, sys | |
|
21 | ||
|
22 | files = [ | |
|
23 | ('formatv0/.hg/00changelog.i', | |
|
24 | '000000000000004400000000000000000000000000000000000000' | |
|
25 | '000000000000000000000000000000000000000000000000000000' | |
|
26 | '0000a1ef0b125355d27765928be600cfe85784284ab3'), | |
|
27 | ('formatv0/.hg/00changelog.d', | |
|
28 | '756163613935613961356635353036303562366138343738336237' | |
|
29 | '61623536363738616436356635380a757365720a3020300a656d70' | |
|
30 | '74790a0a656d7074792066696c65'), | |
|
31 | ('formatv0/.hg/00manifest.i', | |
|
32 | '000000000000003000000000000000000000000000000000000000' | |
|
33 | '000000000000000000000000000000000000000000000000000000' | |
|
34 | '0000aca95a9a5f550605b6a84783b7ab56678ad65f58'), | |
|
35 | ('formatv0/.hg/00manifest.d', | |
|
36 | '75656d707479006238306465356431333837353835343163356630' | |
|
37 | '35323635616431343461623966613836643164620a'), | |
|
38 | ('formatv0/.hg/data/empty.i', | |
|
39 | '000000000000000000000000000000000000000000000000000000' | |
|
40 | '000000000000000000000000000000000000000000000000000000' | |
|
41 | '0000b80de5d138758541c5f05265ad144ab9fa86d1db'), | |
|
42 | ('formatv0/.hg/data/empty.d', | |
|
43 | ''), | |
|
44 | ] | |
|
45 | ||
|
46 | def makedirs(name): | |
|
47 | """recursive directory creation""" | |
|
48 | parent = os.path.dirname(name) | |
|
49 | if parent: | |
|
50 | makedirs(parent) | |
|
51 | os.mkdir(name) | |
|
52 | ||
|
53 | makedirs(os.path.join(*'formatv0/.hg/data'.split('/'))) | |
|
54 | ||
|
55 | for name, data in files: | |
|
56 | f = open(name, 'wb') | |
|
57 | f.write(data.decode('hex')) | |
|
58 | f.close() | |
|
59 | ||
|
60 | sys.exit(0) |
@@ -199,7 +199,7 b' def _verify(repo):' | |||
|
199 | 199 | for f, f2, size in repo.store.datafiles(): |
|
200 | 200 | if not f: |
|
201 | 201 | err(None, _("cannot decode filename '%s'") % f2) |
|
202 | elif size > 0: | |
|
202 | elif size > 0 or not revlogv1: | |
|
203 | 203 | storefiles.add(f) |
|
204 | 204 | |
|
205 | 205 | files = sorted(set(filenodes) | set(filelinkrevs)) |
@@ -84,4 +84,18 b' test revlog corruption' | |||
|
84 | 84 | 1 integrity errors encountered! |
|
85 | 85 | (first damaged changeset appears to be 0) |
|
86 | 86 | |
|
87 | $ cd .. | |
|
88 | ||
|
89 | test revlog format 0 | |
|
90 | ||
|
91 | $ "$TESTDIR/revlog-formatv0.py" | |
|
92 | $ cd formatv0 | |
|
93 | $ hg verify | |
|
94 | repository uses revlog format 0 | |
|
95 | checking changesets | |
|
96 | checking manifests | |
|
97 | crosschecking files in changesets and manifests | |
|
98 | checking files | |
|
99 | 1 files, 1 changesets, 1 total revisions | |
|
100 | ||
|
87 | 101 |
$ |
General Comments 0
You need to be logged in to leave comments.
Login now