/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
198 by mbp at sourcefrog
- experimental compressed Revfile support
1
#! /usr/bin/env python
2
200 by mbp at sourcefrog
revfile: fix up __getitem__ to allow simple iteration
3
# (C) 2005 Canonical Ltd
198 by mbp at sourcefrog
- experimental compressed Revfile support
4
200 by mbp at sourcefrog
revfile: fix up __getitem__ to allow simple iteration
5
# based on an idea by Matt Mackall
198 by mbp at sourcefrog
- experimental compressed Revfile support
6
# modified to squish into bzr by Martin Pool
7
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2 of the License, or
11
# (at your option) any later version.
12
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
# GNU General Public License for more details.
17
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
22
23
"""Packed file revision storage.
24
25
A Revfile holds the text history of a particular source file, such
26
as Makefile.  It can represent a tree of text versions for that
27
file, allowing for microbranches within a single repository.
28
29
This is stored on disk as two files: an index file, and a data file.
30
The index file is short and always read completely into memory; the
31
data file is much longer and only the relevant bits of it,
32
identified by the index file, need to be read.
33
34
Each text version is identified by the SHA-1 of the full text of
35
that version.  It also has a sequence number within the file.
36
37
The index file has a short header and then a sequence of fixed-length
38
records:
39
40
* byte[20]    SHA-1 of text (as binary, not hex)
41
* uint32      sequence number this is based on, or -1 for full text
42
* uint32      flags: 1=zlib compressed
43
* uint32      offset in text file of start
44
* uint32      length of compressed delta in text file
45
* uint32[3]   reserved
46
47
total 48 bytes.
48
199 by mbp at sourcefrog
- use -1 for no_base in revfile
49
The header is also 48 bytes for tidyness and easy calculation.
198 by mbp at sourcefrog
- experimental compressed Revfile support
50
51
Both the index and the text are only ever appended to; a consequence
52
is that sequence numbers are stable references.  But not every
53
repository in the world will assign the same sequence numbers,
54
therefore the SHA-1 is the only universally unique reference.
55
56
This is meant to scale to hold 100,000 revisions of a single file, by
57
which time the index file will be ~4.8MB and a bit big to read
58
sequentially.
59
60
Some of the reserved fields could be used to implement a (semi?)
61
balanced tree indexed by SHA1 so we can much more efficiently find the
62
index associated with a particular hash.  For 100,000 revs we would be
63
able to find it in about 17 random reads, which is not too bad.
64
"""
65
 
66
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
67
# TODO: Something like pread() would make this slightly simpler and
68
# perhaps more efficient.
69
70
# TODO: Could also try to mmap things...
71
198 by mbp at sourcefrog
- experimental compressed Revfile support
72
73
import sys, zlib, struct, mdiff, stat, os, sha
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
74
from binascii import hexlify, unhexlify
198 by mbp at sourcefrog
- experimental compressed Revfile support
75
76
factor = 10
77
78
_RECORDSIZE = 48
79
80
_HEADER = "bzr revfile v1\n"
81
_HEADER = _HEADER + ('\xff' * (_RECORDSIZE - len(_HEADER)))
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
82
_NO_RECORD = 0xFFFFFFFFL
198 by mbp at sourcefrog
- experimental compressed Revfile support
83
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
84
# fields in the index record
85
I_SHA = 0
86
I_BASE = 1
87
I_FLAGS = 2
88
I_OFFSET = 3
89
I_LEN = 4
90
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
91
FL_GZIP = 1
92
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
93
198 by mbp at sourcefrog
- experimental compressed Revfile support
94
class RevfileError(Exception):
95
    pass
96
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
97
98
198 by mbp at sourcefrog
- experimental compressed Revfile support
99
class Revfile:
100
    def __init__(self, basename):
202 by mbp at sourcefrog
Revfile:
101
        # TODO: Option to open readonly
102
103
        # TODO: Lock file  while open
104
105
        # TODO: advise of random access
106
198 by mbp at sourcefrog
- experimental compressed Revfile support
107
        self.basename = basename
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
108
        
109
        idxname = basename + '.irev'
110
        dataname = basename + '.drev'
111
206 by mbp at sourcefrog
new Revfile.add() dwim
112
        self.idxpos = 0L
113
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
114
        idx_exists = os.path.exists(idxname)
115
        data_exists = os.path.exists(dataname)
116
117
        if idx_exists != data_exists:
118
            raise RevfileError("half-assed revfile")
119
        
120
        if not idx_exists:
121
            self.idxfile = open(idxname, 'w+b')
122
            self.datafile = open(dataname, 'w+b')
123
            
198 by mbp at sourcefrog
- experimental compressed Revfile support
124
            print 'init empty file'
125
            self.idxfile.write(_HEADER)
126
            self.idxfile.flush()
127
        else:
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
128
            self.idxfile = open(idxname, 'r+b')
202 by mbp at sourcefrog
Revfile:
129
            self.datafile = open(dataname, 'r+b')
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
130
            
198 by mbp at sourcefrog
- experimental compressed Revfile support
131
            h = self.idxfile.read(_RECORDSIZE)
132
            if h != _HEADER:
133
                raise RevfileError("bad header %r in index of %r"
134
                                   % (h, self.basename))
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
135
136
206 by mbp at sourcefrog
new Revfile.add() dwim
137
198 by mbp at sourcefrog
- experimental compressed Revfile support
138
    def revision(self, rev):
139
        base = self.index[rev][0]
140
        start = self.index[base][1]
141
        end = self.index[rev][1] + self.index[rev][2]
142
        f = open(self.datafile())
143
144
        f.seek(start)
145
        data = f.read(end - start)
146
147
        last = self.index[base][2]
148
        text = zlib.decompress(data[:last])
149
150
        for r in range(base + 1, rev + 1):
151
            s = self.index[r][2]
152
            b = zlib.decompress(data[last:last + s])
153
            text = mdiff.bpatch(text, b)
154
            last = last + s
155
156
        return text    
157
158
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
159
    def _check_index(self, idx):
160
        if idx < 0 or idx > len(self):
161
            raise RevfileError("invalid index %r" % idx)
162
163
164
    def find_sha(self, s):
165
        assert isinstance(s, str)
166
        assert len(s) == 20
167
        
168
        for idx, idxrec in enumerate(self):
169
            if idxrec[I_SHA] == s:
170
                return idx
171
        else:
172
            return _NO_RECORD        
173
174
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
175
    def _add_common(self, text_sha, data, base):
176
        """Add pre-processed data, can be either full text or delta.
177
178
        This does the compression if that makes sense."""
179
180
        flags = 0
208 by mbp at sourcefrog
show compression ratio
181
        data_len = len(data)
182
        if data_len > 50:
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
183
            # don't do compression if it's too small; it's unlikely to win
184
            # enough to be worthwhile
185
            compr_data = zlib.compress(data)
208 by mbp at sourcefrog
show compression ratio
186
            compr_len = len(compr_data)
187
            if compr_len < data_len:
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
188
                data = compr_data
189
                flags = FL_GZIP
208 by mbp at sourcefrog
show compression ratio
190
                print '- compressed %d -> %d, %.1f%%' \
191
                      % (data_len, compr_len, float(compr_len)/float(data_len) * 100.0)
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
192
        
203 by mbp at sourcefrog
revfile:
193
        idx = len(self)
198 by mbp at sourcefrog
- experimental compressed Revfile support
194
        self.datafile.seek(0, 2)        # to end
195
        self.idxfile.seek(0, 2)
202 by mbp at sourcefrog
Revfile:
196
        assert self.idxfile.tell() == _RECORDSIZE * (idx + 1)
198 by mbp at sourcefrog
- experimental compressed Revfile support
197
        data_offset = self.datafile.tell()
198
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
199
        assert isinstance(data, str) # not unicode or anything wierd
198 by mbp at sourcefrog
- experimental compressed Revfile support
200
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
201
        self.datafile.write(data)
198 by mbp at sourcefrog
- experimental compressed Revfile support
202
        self.datafile.flush()
203
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
204
        assert isinstance(text_sha, str)
205
        entry = text_sha
206
        entry += struct.pack(">IIII12x", base, flags, data_offset, len(data))
198 by mbp at sourcefrog
- experimental compressed Revfile support
207
        assert len(entry) == _RECORDSIZE
208
209
        self.idxfile.write(entry)
210
        self.idxfile.flush()
211
212
        return idx
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
213
        
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
214
215
206 by mbp at sourcefrog
new Revfile.add() dwim
216
    def _add_full_text(self, text, text_sha):
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
217
        """Add a full text to the file.
218
219
        This is not compressed against any reference version.
220
221
        Returns the index for that text."""
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
222
        return self._add_common(text_sha, text, _NO_RECORD)
206 by mbp at sourcefrog
new Revfile.add() dwim
223
224
225
    def _add_delta(self, text, text_sha, base):
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
226
        """Add a text stored relative to a previous text."""
227
        self._check_index(base)
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
228
        base_text = self.get(base)
229
        data = mdiff.bdiff(base_text, text)
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
230
        return self._add_common(text_sha, data, base)
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
231
232
206 by mbp at sourcefrog
new Revfile.add() dwim
233
    def add(self, text, base=_NO_RECORD):
234
        text_sha = sha.new(text).digest()
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
235
206 by mbp at sourcefrog
new Revfile.add() dwim
236
        idx = self.find_sha(text_sha)
237
        if idx != _NO_RECORD:
238
            return idx                  # already present
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
239
        
206 by mbp at sourcefrog
new Revfile.add() dwim
240
        if base == _NO_RECORD:
241
            return self._add_full_text(text, text_sha)
242
        else:
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
243
            return self._add_delta(text, text_sha, base)
206 by mbp at sourcefrog
new Revfile.add() dwim
244
245
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
246
    def addrevision(self, text, changeset):
247
        t = self.tip()
248
        n = t + 1
249
250
        if not n % factor:
251
            data = zlib.compress(text)
252
            base = n
253
        else:
254
            prev = self.revision(t)
255
            data = zlib.compress(mdiff.bdiff(prev, text))
256
            base = self.index[t][0]
257
258
        offset = 0
259
        if t >= 0:
260
            offset = self.index[t][1] + self.index[t][2]
261
262
        self.index.append((base, offset, len(data), changeset))
263
        entry = struct.pack(">llll", base, offset, len(data), changeset)
264
265
        open(self.indexfile(), "a").write(entry)
266
        open(self.datafile(), "a").write(data)
267
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
268
206 by mbp at sourcefrog
new Revfile.add() dwim
269
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
270
    def get(self, idx):
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
271
        idxrec = self[idx]
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
272
        base = idxrec[I_BASE]
273
        if base == _NO_RECORD:
274
            text = self._get_full_text(idx, idxrec)
275
        else:
276
            text = self._get_patched(idx, idxrec)
277
278
        if sha.new(text).digest() != idxrec[I_SHA]:
279
            raise RevfileError("corrupt SHA-1 digest on record %d"
280
                               % idx)
281
282
        return text
283
284
285
286
    def _get_raw(self, idx, idxrec):
209 by mbp at sourcefrog
Revfile: handle decompression
287
        flags = idxrec[I_FLAGS]
288
        if flags & ~FL_GZIP:
289
            raise RevfileError("unsupported index flags %#x on index %d"
290
                               % (flags, idx))
291
        
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
292
        l = idxrec[I_LEN]
293
        if l == 0:
294
            return ''
295
296
        self.datafile.seek(idxrec[I_OFFSET])
297
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
298
        data = self.datafile.read(l)
299
        if len(data) != l:
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
300
            raise RevfileError("short read %d of %d "
301
                               "getting text for record %d in %r"
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
302
                               % (len(data), l, idx, self.basename))
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
303
209 by mbp at sourcefrog
Revfile: handle decompression
304
        if flags & FL_GZIP:
305
            data = zlib.decompress(data)
306
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
307
        return data
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
308
        
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
309
310
    def _get_full_text(self, idx, idxrec):
311
        assert idxrec[I_BASE] == _NO_RECORD
312
313
        text = self._get_raw(idx, idxrec)
314
315
        return text
316
317
318
    def _get_patched(self, idx, idxrec):
319
        base = idxrec[I_BASE]
320
        assert base >= 0
321
        assert base < idx    # no loops!
322
323
        base_text = self.get(base)
324
        patch = self._get_raw(idx, idxrec)
325
326
        text = mdiff.bpatch(base_text, patch)
327
328
        return text
329
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
330
331
198 by mbp at sourcefrog
- experimental compressed Revfile support
332
    def __len__(self):
203 by mbp at sourcefrog
revfile:
333
        """Return number of revisions."""
334
        l = os.fstat(self.idxfile.fileno())[stat.ST_SIZE]
335
        if l % _RECORDSIZE:
336
            raise RevfileError("bad length %d on index of %r" % (l, self.basename))
337
        if l < _RECORDSIZE:
338
            raise RevfileError("no header present in index of %r" % (self.basename))
339
        return int(l / _RECORDSIZE) - 1
198 by mbp at sourcefrog
- experimental compressed Revfile support
340
200 by mbp at sourcefrog
revfile: fix up __getitem__ to allow simple iteration
341
198 by mbp at sourcefrog
- experimental compressed Revfile support
342
    def __getitem__(self, idx):
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
343
        """Index by sequence id returns the index field"""
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
344
        ## TODO: Can avoid seek if we just moved there...
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
345
        self._seek_index(idx)
346
        return self._read_next_index()
347
348
349
    def _seek_index(self, idx):
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
350
        if idx < 0:
351
            raise RevfileError("invalid index %r" % idx)
198 by mbp at sourcefrog
- experimental compressed Revfile support
352
        self.idxfile.seek((idx + 1) * _RECORDSIZE)
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
353
        
354
355
    def _read_next_index(self):
198 by mbp at sourcefrog
- experimental compressed Revfile support
356
        rec = self.idxfile.read(_RECORDSIZE)
200 by mbp at sourcefrog
revfile: fix up __getitem__ to allow simple iteration
357
        if not rec:
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
358
            raise IndexError("end of index file")
200 by mbp at sourcefrog
revfile: fix up __getitem__ to allow simple iteration
359
        elif len(rec) != _RECORDSIZE:
198 by mbp at sourcefrog
- experimental compressed Revfile support
360
            raise RevfileError("short read of %d bytes getting index %d from %r"
361
                               % (len(rec), idx, self.basename))
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
362
        
199 by mbp at sourcefrog
- use -1 for no_base in revfile
363
        return struct.unpack(">20sIIII12x", rec)
198 by mbp at sourcefrog
- experimental compressed Revfile support
364
365
        
199 by mbp at sourcefrog
- use -1 for no_base in revfile
366
    def dump(self, f=sys.stdout):
367
        f.write('%-8s %-40s %-8s %-8s %-8s %-8s\n' 
368
                % tuple('idx sha1 base flags offset len'.split()))
369
        f.write('-------- ---------------------------------------- ')
370
        f.write('-------- -------- -------- --------\n')
371
200 by mbp at sourcefrog
revfile: fix up __getitem__ to allow simple iteration
372
        for i, rec in enumerate(self):
199 by mbp at sourcefrog
- use -1 for no_base in revfile
373
            f.write("#%-7d %40s " % (i, hexlify(rec[0])))
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
374
            if rec[1] == _NO_RECORD:
199 by mbp at sourcefrog
- use -1 for no_base in revfile
375
                f.write("(none)   ")
376
            else:
377
                f.write("#%-7d " % rec[1])
378
                
379
            f.write("%8x %8d %8d\n" % (rec[2], rec[3], rec[4]))
198 by mbp at sourcefrog
- experimental compressed Revfile support
380
        
381
382
383
def main(argv):
384
    r = Revfile("testrev")
203 by mbp at sourcefrog
revfile:
385
386
    try:
387
        cmd = argv[1]
388
    except IndexError:
198 by mbp at sourcefrog
- experimental compressed Revfile support
389
        sys.stderr.write("usage: revfile dump\n"
201 by mbp at sourcefrog
Revfile: - get full text from a record- fix creation of files if they don't exist- protect against half-assed storage
390
                         "       revfile add\n"
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
391
                         "       revfile add-delta BASE\n"
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
392
                         "       revfile get IDX\n"
393
                         "       revfile find-sha HEX\n")
203 by mbp at sourcefrog
revfile:
394
        return 1
198 by mbp at sourcefrog
- experimental compressed Revfile support
395
        
203 by mbp at sourcefrog
revfile:
396
397
    if cmd == 'add':
206 by mbp at sourcefrog
new Revfile.add() dwim
398
        new_idx = r.add(sys.stdin.read())
198 by mbp at sourcefrog
- experimental compressed Revfile support
399
        print 'added idx %d' % new_idx
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
400
    elif cmd == 'add-delta':
207 by mbp at sourcefrog
Revfile: compress data going into datafile if that would be worthwhile
401
        new_idx = r.add(sys.stdin.read(), int(argv[2]))
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
402
        print 'added idx %d' % new_idx
203 by mbp at sourcefrog
revfile:
403
    elif cmd == 'dump':
198 by mbp at sourcefrog
- experimental compressed Revfile support
404
        r.dump()
203 by mbp at sourcefrog
revfile:
405
    elif cmd == 'get':
202 by mbp at sourcefrog
Revfile:
406
        try:
203 by mbp at sourcefrog
revfile:
407
            idx = int(argv[2])
202 by mbp at sourcefrog
Revfile:
408
        except IndexError:
203 by mbp at sourcefrog
revfile:
409
            sys.stderr.write("usage: revfile get IDX\n")
410
            return 1
411
412
        if idx < 0 or idx >= len(r):
413
            sys.stderr.write("invalid index %r\n" % idx)
414
            return 1
415
205 by mbp at sourcefrog
Revfile:- store and retrieve deltas!mdiff:- work on bytes not lines
416
        sys.stdout.write(r.get(idx))
204 by mbp at sourcefrog
Revfile:- new find-sha command and implementation- new _check_index helper
417
    elif cmd == 'find-sha':
418
        try:
419
            s = unhexlify(argv[2])
420
        except IndexError:
421
            sys.stderr.write("usage: revfile find-sha HEX\n")
422
            return 1
423
424
        idx = r.find_sha(s)
425
        if idx == _NO_RECORD:
426
            sys.stderr.write("no such record\n")
427
            return 1
428
        else:
429
            print idx
430
            
198 by mbp at sourcefrog
- experimental compressed Revfile support
431
    else:
203 by mbp at sourcefrog
revfile:
432
        sys.stderr.write("unknown command %r\n" % cmd)
433
        return 1
198 by mbp at sourcefrog
- experimental compressed Revfile support
434
    
435
436
if __name__ == '__main__':
437
    import sys
203 by mbp at sourcefrog
revfile:
438
    sys.exit(main(sys.argv) or 0)