Skip to content

Commit d475536

Browse files
committed
Merge branch 'svn-fe' of git://repo.or.cz/git/jrn into jn/svn-fe
This simplifies svn-fe a great deal and fulfills a longstanding wish: support for dumps with deltas in them, and incremental imports. The cost is that commandline usage of the svn-fe tool becomes a little more complicated since it no longer keeps state itself but instead reads blobs back from fast-import in order to copy them between revisions and apply deltas to them. Also removes a couple of custom data structures and replaces them with strbufs like other parts of Git. * 'svn-fe' of git://repo.or.cz/git/jrn: (32 commits) vcs-svn: reset first_commit_done in fast_export_init vcs-svn: do not initialize report_buffer twice vcs-svn: avoid hangs from corrupt deltas vcs-svn: guard against overflow when computing preimage length vcs-svn: cap number of bytes read from sliding view test-svn-fe: split off "test-svn-fe -d" into a separate function vcs-svn: implement text-delta handling vcs-svn: let deltas use data from preimage vcs-svn: let deltas use data from postimage vcs-svn: verify that deltas consume all inline data vcs-svn: implement copyfrom_data delta instruction vcs-svn: read instructions from deltas vcs-svn: read inline data from deltas vcs-svn: read the preimage when applying deltas vcs-svn: parse svndiff0 window header vcs-svn: skeleton of an svn delta parser vcs-svn: make buffer_read_binary API more convenient vcs-svn: learn to maintain a sliding view of a file Makefile: list one vcs-svn/xdiff object or header per line vcs-svn: avoid using ls command twice ... Conflicts: Makefile contrib/svn-fe/svn-fe.txt
2 parents 69204d0 + c5bcbcd commit d475536

28 files changed

+1432
-1362
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,13 @@
181181
/test-line-buffer
182182
/test-match-trees
183183
/test-mktemp
184-
/test-obj-pool
185184
/test-parse-options
186185
/test-path-utils
187186
/test-run-command
188187
/test-sha1
189188
/test-sigchain
190-
/test-string-pool
191189
/test-subprocess
192190
/test-svn-fe
193-
/test-treap
194191
/common-cmds.h
195192
*.tar.gz
196193
*.dsc

Makefile

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ BUILTIN_OBJS =
374374
BUILT_INS =
375375
COMPAT_CFLAGS =
376376
COMPAT_OBJS =
377+
XDIFF_H =
378+
XDIFF_OBJS =
379+
VCSSVN_H =
380+
VCSSVN_OBJS =
381+
VCSSVN_TEST_OBJS =
377382
EXTRA_CPPFLAGS =
378383
LIB_H =
379384
LIB_OBJS =
@@ -466,16 +471,13 @@ TEST_PROGRAMS_NEED_X += test-index-version
466471
TEST_PROGRAMS_NEED_X += test-line-buffer
467472
TEST_PROGRAMS_NEED_X += test-match-trees
468473
TEST_PROGRAMS_NEED_X += test-mktemp
469-
TEST_PROGRAMS_NEED_X += test-obj-pool
470474
TEST_PROGRAMS_NEED_X += test-parse-options
471475
TEST_PROGRAMS_NEED_X += test-path-utils
472476
TEST_PROGRAMS_NEED_X += test-run-command
473477
TEST_PROGRAMS_NEED_X += test-sha1
474478
TEST_PROGRAMS_NEED_X += test-sigchain
475-
TEST_PROGRAMS_NEED_X += test-string-pool
476479
TEST_PROGRAMS_NEED_X += test-subprocess
477480
TEST_PROGRAMS_NEED_X += test-svn-fe
478-
TEST_PROGRAMS_NEED_X += test-treap
479481

480482
TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
481483

@@ -1988,12 +1990,24 @@ GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
19881990
ifndef NO_CURL
19891991
GIT_OBJS += http.o http-walker.o remote-curl.o
19901992
endif
1991-
XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
1992-
xdiff/xmerge.o xdiff/xpatience.o xdiff/xhistogram.o
1993-
VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
1994-
vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
1995-
VCSSVN_TEST_OBJS = test-obj-pool.o test-string-pool.o \
1996-
test-line-buffer.o test-treap.o
1993+
1994+
XDIFF_OBJS += xdiff/xdiffi.o
1995+
XDIFF_OBJS += xdiff/xprepare.o
1996+
XDIFF_OBJS += xdiff/xutils.o
1997+
XDIFF_OBJS += xdiff/xemit.o
1998+
XDIFF_OBJS += xdiff/xmerge.o
1999+
XDIFF_OBJS += xdiff/xpatience.o
2000+
XDIFF_OBJS += xdiff/xhistogram.o
2001+
2002+
VCSSVN_OBJS += vcs-svn/line_buffer.o
2003+
VCSSVN_OBJS += vcs-svn/sliding_window.o
2004+
VCSSVN_OBJS += vcs-svn/repo_tree.o
2005+
VCSSVN_OBJS += vcs-svn/fast_export.o
2006+
VCSSVN_OBJS += vcs-svn/svndiff.o
2007+
VCSSVN_OBJS += vcs-svn/svndump.o
2008+
2009+
VCSSVN_TEST_OBJS += test-line-buffer.o
2010+
19972011
OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
19982012

19992013
dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
@@ -2112,16 +2126,25 @@ connect.o transport.o url.o http-backend.o: url.h
21122126
http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
21132127
http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h url.h
21142128

2115-
xdiff-interface.o $(XDIFF_OBJS): \
2116-
xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
2117-
xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
2129+
XDIFF_H += xdiff/xinclude.h
2130+
XDIFF_H += xdiff/xmacros.h
2131+
XDIFF_H += xdiff/xdiff.h
2132+
XDIFF_H += xdiff/xtypes.h
2133+
XDIFF_H += xdiff/xutils.h
2134+
XDIFF_H += xdiff/xprepare.h
2135+
XDIFF_H += xdiff/xdiffi.h
2136+
XDIFF_H += xdiff/xemit.h
2137+
2138+
xdiff-interface.o $(XDIFF_OBJS): $(XDIFF_H)
21182139

2119-
$(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
2120-
vcs-svn/obj_pool.h vcs-svn/trp.h vcs-svn/string_pool.h \
2121-
vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
2122-
vcs-svn/svndump.h
2140+
VCSSVN_H += vcs-svn/line_buffer.h
2141+
VCSSVN_H += vcs-svn/sliding_window.h
2142+
VCSSVN_H += vcs-svn/repo_tree.h
2143+
VCSSVN_H += vcs-svn/fast_export.h
2144+
VCSSVN_H += vcs-svn/svndiff.h
2145+
VCSSVN_H += vcs-svn/svndump.h
21232146

2124-
test-svn-fe.o: vcs-svn/svndump.h
2147+
$(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) $(VCSSVN_H)
21252148
endif
21262149

21272150
exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
@@ -2349,8 +2372,6 @@ test-line-buffer$X: vcs-svn/lib.a
23492372

23502373
test-parse-options$X: parse-options.o parse-options-cb.o
23512374

2352-
test-string-pool$X: vcs-svn/lib.a
2353-
23542375
test-svn-fe$X: vcs-svn/lib.a
23552376

23562377
.PRECIOUS: $(TEST_OBJS)

contrib/svn-fe/svn-fe.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ svn-fe - convert an SVN "dumpfile" to a fast-import stream
88
SYNOPSIS
99
--------
1010
[verse]
11-
svnadmin dump --incremental REPO | svn-fe [url] | git fast-import
11+
mkfifo backchannel &&
12+
svnadmin dump --deltas REPO |
13+
svn-fe [url] 3<backchannel |
14+
git fast-import --cat-blob-fd=3 3>backchannel
1215

1316
DESCRIPTION
1417
-----------
@@ -29,9 +32,6 @@ Subversion's repository dump format is documented in full in
2932
Files in this format can be generated using the 'svnadmin dump' or
3033
'svk admin dump' command.
3134

32-
Dumps produced with 'svnadmin dump --deltas' (dumpfile format v3)
33-
are not supported.
34-
3535
OUTPUT FORMAT
3636
-------------
3737
The fast-import format is documented by the git-fast-import(1)

t/t0080-vcs-svn.sh

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)