-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
524 lines (352 loc) · 13.9 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
SvnDumpTool
===========
SvnDumpTool is a tool for processing Subversion dump files (Subversion is a
version control system available from http://subversion.tigris.org/). It's
written in Python (tested with Python 2.4.4 on Linux, though 2.3 should
work fine too).
It has the following commands:
* apply-autoprops apply the auto-props defined in SVN's config
* check check a dump file
* copy copy a dump file
* cvs2svnfix fix a cvs2svn created dump file
* diff show differences between two dump files
* edit edit files in a dump file
* eolfix fix EOL of text files in a dump
* export export files from a dump file
* join join dump files
* log show the log of a dump file
* ls list files of a given revision
* merge merge dump files
* sanitize sanitize dump files
* split split dump files
* transform-revprop transform a revision property
* transform-prop transform a node property
Its homepage is:
http://svn.borg.ch/svndumptool/
Installing
==========
Unpack the tarball, cd into the directory and run the following command:
./setup.py install
Usage
=====
svndumptool.py command [options] [dumpfiles...]
Only Version 2 dump files can be processed with this tool!
(Version 2 dumps are those created without the --deltas option)
Apply-Autoprops
---------------
Applies the automatic properties defined in Subversion's config file.
The value of "enable-auto-props" is ignored and the properties are
always applied.
usage: svndumptool.py apply-autoprops [options] inputdump outputdump
options:
--version show program's version number and exit
-h, --help show this help message and exit
--config-file=CONFIGFILE
Subversion config file [default:
$HOME/.subversion/config].
Check
-----
Checks a dump file.
svndumptool.py check [options] dumpfiles...
options:
--version show program's version number and exit
-h, --help show this help message and exit
-a, --check-actions check actions like add/change/delete
-d, --check-dates check that svn:date increases
-m, --check-md5 check md5 sums of the files
-A, --all-checks do all checks
-v, --verbose verbose output
Known bugs:
* cvs2svn created dumps may cause false negatives.
Copy
----
Copies a dump file. Doesn't sound like that makes sense but it's a useful
test of svndump classes (and sometimes it's able to fix broken dump files).
svndumptool.py copy [options] source destination
options:
--version show program's version number and exit
-h, --help show this help message and exit
Known bugs:
* None
Cvs2svnfix
----------
Fixes a cvs2svn created dump file. Some (all?) versions of cvs2svn do not
create 100% valid dump files according to Subversion's specification of the
dump file format. It omits the node kind for copied nodes. This command
repairs those nodes.
svndumptool.py cvs2svnfix [options] inputfile outputfile
options:
--version show program's version number and exit
-h, --help show this help message and exit
Known bugs:
* None
Diff
----
Shows differences between two Subversion dump files.
svndumptool.py diff [options] dumpfile1 dumpfile2
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-e, --check-eol check for EOL differences
-q, --quiet quiet output
-v, --verbose verbose output
-IIGNORES, --ignore=IGNORES
Ignore types of differences. This option can be
specified more than once. Valid types are 'UUID',
'RevNr', 'RevDate', 'RevDateStr', 'NodeCount', 'Path',
'Action', 'Kind', 'CopyFromPath', 'CopyFromRev',
'HasText', 'TextLen', 'TextMD5', 'EOL', 'Text',
'PropDiff', 'PropMissing', 'RevPropDiff' and
'RevPropMissing'
--ignore-revprop=IGNOREREVPROP
ignore a differing/missing revision property
--ignore-property=IGNOREPROPERTY
ignore a differing/missing property
Known bugs:
* cvs2svn created dumps may cause false negatives.
Edit
----
Edits the content of files in a dump by replacing them with the contents of
another file. Also allows properties to be deleted from files.
svndumptool.py edit [options] sourcedump [destinationdump]
options:
--version show program's version number and exit
-h, --help show this help message and exit
-r REVNR, --revision=REVNR
revision number to edit.
-f FILENAME, --file=FILENAME
filename of repos path to edit.
--replace=REPLACE path of a replacement file.
--propdel=PROPDEL prop name to delete.
-q, --quiet quiet output.
-v, --verbose verbose output.
--dry-run just show what would be done but don't do it.
Known bugs:
* None
Eolfix
------
Textfiles normally contain only one kind of 'end-of-line' characters
(LF, CRLF or CR). This command fixes the EOL's in text files, it converts
all EOL's to LF.
svndumptool.py eolfix [options] sourcedump destinationdump
options:
--version show program's version number and exit
-h, --help show this help message and exit
-EEOLSTYLE, --eol-style=EOLSTYLE
add svn:eol-style property to text files, the value can
be 'native', 'LF', 'CRLF' or 'CR'
-fFIX, --fix=FIX a comma separated list of what (and how) to fix, can be
a combination of 'CRLF', 'CR' and 'RemCR'. If 'CR' and
'RemCR' both specified 'RemCR' is ignored. 'CRLF' and
'CR' mean replace them by LF, 'RemCR' means remove
CR's.
-FFIXREVPATH, --fix-rev-path=FIXREVPATH
a colon separated list of fix option, revision number
and path of a file.
-rREGEXP, --regexp=REGEXP
regexp for matching text file names
-tTMPDIR, --temp-dir=TMPDIR
directory for temporary files (default: './').
-wWARNFILE, --warn-file=WARNFILE
file for storing the warnings.
--dry-run just show what would be done but don't do it
Known bugs:
* EOL's aren't fixed in a file which was copied and the old file was not a
text file.
* Diff shows a few Text changes after eolfix !?!
Export
------
Exports files from a dump file.
svndumptool.py export [options] dumpfile
options:
--version show program's version number and exit
-h, --help show this help message and exit
-e REV REPOSPATH FILENAME, --export= REV REPOSPATH FILENAME
adds a file to export.
-dDIR, --directory=DIR
set the directory for the exported files.
Known bugs:
* None
Join
----
Concatenates two or more dump files.
svndumptool.py join -o outputfile dumpfiles...
options:
--version show program's version number and exit
-h, --help show this help message and exit
-o OUTFILE, --output-file=OUTFILE
set the name of the output dump file.
Known bugs:
* None
Log
---
Shows the log of a dump file in (almost) the same format as "svn log".
svndumptool.py log [options] dumpfiles...
options:
--version show program's version number and exit
-h, --help show this help message and exit
-r REVISION, --revision=REVISION
revision number or range (X:Y)
-v, --verbose verbose output
Known bugs:
* None
Ls
--
Lists all files and dirs in the given revision or HEAD.
svndumptool.py ls [options] dumpfiles...
options:
--version show program's version number and exit
-h, --help show this help message and exit
-r REVNR, --revision=REVNR
revision number
Known bugs:
* None
Merge
-----
Merges multiple dump files into one. It does this by reading all dump files
at the same time and always adding the revision with the oldest revision
date to the output dump file.
Use 'svndumptool.py check -a -d dumpfile' to check that actions and dates
in the merged file make sense.
svndumptool.py merge [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-i INFILE, --input-file=INFILE
adds an input dump filename.
-r FROM TO, --rename= FROM TO
adds a rename to the previously added file.
-s SEARCH REPLACE, --regex-substitute= SEARCH REPLACE
performs regular expression search and replace
-x DIR, --mkdir-exclude=DIR
exclude mkdir from the previously added file.
-o OUTFILE, --output-file=OUTFILE
sets the output filename.
-d DIR, --mkdir=DIR create an additional directory.
-m MSG, --message=MSG
logmessage for the directory creating revision.
--example show a little usage example.
Known bugs:
* There's no warning when a dump file does not have monotonic increasing
revision dates. Use 'svndumptool.py check -d dumpfile' to check the
revision dates of a dump file.
* mkdir-exclude may fail in some cases in cvs2svn created dumps.
* using -r and -s options on the same path will have unknown results
Sanitize
--------
Replaces data and/or metadata of a dump file with md5 hashes.
svndumptool.py sanitize [options] source destination
options:
--version show program's version number and exit
-h, --help show this help message and exit
-f, --no-file-data Do not sanitize file data. (Equivalent to --file-
data=none.)
-m FILE_DATA_METHOD, --file-data=FILE_DATA_METHOD
Method to sanitize file data: whole, line, none.
Default is whole.
-n, --no-filenames Do not sanitize filenames
-e FILENAME_EXCLUDES, --exclude-filename=FILENAME_EXCLUDES
Do not sanitize this filename. May be used multiple
times.
-u, --no-usernames Do not sanitize usernames
-l, --no-logs Do not sanitize log messages
-s SALT, --salt=SALT Specify the salt to use in hex
Known bugs:
* None
Split
-----
Splits a dump file into multiple smaller dump files.
svndumptool.py split inputfile [startrev endrev filename]...
options:
--version show program's version number and exit
-h, --help show this help message and exit
Known bugs:
* None
Transform-revprop
-----------------
Transforms a revision property using a regular expression and a
replacement string.
svndumptool.py transform-revprop propname regex replace source destination
options:
--version show program's version number and exit
-h, --help show this help message and exit
Known bugs:
* None
Transform-prop
--------------
Transforms a property using a regular expression and a replacement string.
svndumptool.py transform-prop propname regex replace source destination
options:
--version show program's version number and exit
-h, --help show this help message and exit
Known bugs:
* None
Some tips
=========
Moving things around
--------------------
The merge command has a rename option so merge can be 'abused' to just
rename parts of a repository.
The following example shows how to add trunk, tags and branches directories
and move everything from the repository root into trunk:
svndumptool.py merge -i source.svndmp -r "" trunk \
-d trunk -d tags -d branches -m "Create trunk, tags and branches." \
-o destination.svndmp
Fixing end-of-line
------------------
While testing with real data I found some weird stuff in these files.
The safest way to convert EOL's is:
1. Do a test conversion (without --dry-run) converting CRLF only and
generate a warnings file.
svndumptool.py eolfix -Enative -fCRLF -wwarnings.log \
-r '\.txt$' input.svndmp output.svndmp
2. Check all files mentioned in warnings.log and decide how to convert
each of them. Also choose a set of default fix options to minimize the
list of special fix options.
Maybe it's possible to choose a better set of regular expressions.
2.1 Binary files: set empty fix option for that rev/file pair.
svndumptool.py ... -F :12:binary_file.txt ...
2.2 Textfiles containing CR EOL's: convert these
svndumptool.py ... -F CRLF,CR:12:cr_file.txt ...
2.3 Textfiles containing CR which aren't EOL's: remove these
svndumptool.py ... -F CRLF,RemCR:12:weird_file.txt ...
3. Do the real conversion.
4. Use 'svndumptool.py diff [options] input.svndmp output.svndmp' to
compare the dump files. svnadmin load will do another check.
Python classes
==============
The Python classes are documented using epydoc
(http://epydoc.sourceforge.net/).
To generate the HTML docs just enter the following commands:
mkdir doc
epydoc --html -o doc -n "SvnDump 0.5.0" svndump
Packaging
=========
Updating the version number
---------------------------
Check the following files:
- svndump/__init__.py
- svndumptool.spec
Creating a source tar.gz
------------------------
./setup.py sdist --formats gztar
This will create:
./dist/svndumptool-0.5.0.tar.gz
Creating an rpm
---------------
mkdir workarea
cd workarea
mkdir SPECS RPMS SRPMS BUILD SOURCES buildroot
cp ../svndumptool.spec SPECS/
cp ../dist/svndumptool-0.5.0.tar.gz SOURCES/
rpmbuild --define="_topdir `pwd`" \
--define="buildroot `pwd`/buildroot" \
-ba SPECS/svndumptool.spec
This will generate 2 files, a binary rpm and a source rpm:
$ find -name \*.rpm
./SRPMS/svndumptool-0.5.0-1.src.rpm
./RPMS/noarch/svndumptool-0.5.0-1.noarch.rpm
Creating a .exe
---------------
Needs py2exe from http://www.py2exe.org/
.\setup.py py2exe