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 | for f, f2, size in repo.store.datafiles(): |
|
199 | for f, f2, size in repo.store.datafiles(): | |
200 | if not f: |
|
200 | if not f: | |
201 | err(None, _("cannot decode filename '%s'") % f2) |
|
201 | err(None, _("cannot decode filename '%s'") % f2) | |
202 | elif size > 0: |
|
202 | elif size > 0 or not revlogv1: | |
203 | storefiles.add(f) |
|
203 | storefiles.add(f) | |
204 |
|
204 | |||
205 | files = sorted(set(filenodes) | set(filelinkrevs)) |
|
205 | files = sorted(set(filenodes) | set(filelinkrevs)) |
@@ -48,4 +48,12 b' echo' | |||||
48 | echo % verify |
|
48 | echo % verify | |
49 | hg verify |
|
49 | hg verify | |
50 |
|
50 | |||
|
51 | cd .. | |||
|
52 | ||||
|
53 | echo % test revlog format 0 | |||
|
54 | ||||
|
55 | "$TESTDIR/revlog-formatv0.py" | |||
|
56 | cd formatv0 | |||
|
57 | hg verify | |||
|
58 | ||||
51 | exit 0 |
|
59 | exit 0 |
@@ -50,3 +50,10 b' 1 files, 1 changesets, 0 total revisions' | |||||
50 | 1 warnings encountered! |
|
50 | 1 warnings encountered! | |
51 | 1 integrity errors encountered! |
|
51 | 1 integrity errors encountered! | |
52 | (first damaged changeset appears to be 0) |
|
52 | (first damaged changeset appears to be 0) | |
|
53 | % test revlog format 0 | |||
|
54 | repository uses revlog format 0 | |||
|
55 | checking changesets | |||
|
56 | checking manifests | |||
|
57 | crosschecking files in changesets and manifests | |||
|
58 | checking files | |||
|
59 | 1 files, 1 changesets, 1 total revisions |
General Comments 0
You need to be logged in to leave comments.
Login now