Code

Merge branch 'svn-fe' of git://repo.or.cz/git/jrn into jn/svn-fe
authorJunio C Hamano <gitster@pobox.com>
Fri, 27 Jan 2012 19:04:28 +0000 (11:04 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Jan 2012 19:20:00 +0000 (11:20 -0800)
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

1  2 
.gitignore
Makefile
vcs-svn/svndump.c

diff --cc .gitignore
Simple merge
diff --cc Makefile
index a782409306df85985e1f465eab4bd3cd7fa2cc83,e954dffa9e461396e6f78ae4f24fbd0f2ebf0935..e58cb649e17c02e321ad8df7ba0a4356722fdffa
+++ b/Makefile
@@@ -460,22 -427,18 +465,19 @@@ TEST_PROGRAMS_NEED_X += test-ctyp
  TEST_PROGRAMS_NEED_X += test-date
  TEST_PROGRAMS_NEED_X += test-delta
  TEST_PROGRAMS_NEED_X += test-dump-cache-tree
 +TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
  TEST_PROGRAMS_NEED_X += test-genrandom
 +TEST_PROGRAMS_NEED_X += test-index-version
  TEST_PROGRAMS_NEED_X += test-line-buffer
  TEST_PROGRAMS_NEED_X += test-match-trees
- TEST_PROGRAMS_NEED_X += test-obj-pool
 +TEST_PROGRAMS_NEED_X += test-mktemp
  TEST_PROGRAMS_NEED_X += test-parse-options
  TEST_PROGRAMS_NEED_X += test-path-utils
  TEST_PROGRAMS_NEED_X += test-run-command
  TEST_PROGRAMS_NEED_X += test-sha1
  TEST_PROGRAMS_NEED_X += test-sigchain
- TEST_PROGRAMS_NEED_X += test-string-pool
  TEST_PROGRAMS_NEED_X += test-subprocess
  TEST_PROGRAMS_NEED_X += test-svn-fe
- TEST_PROGRAMS_NEED_X += test-treap
 -TEST_PROGRAMS_NEED_X += test-index-version
 -TEST_PROGRAMS_NEED_X += test-mktemp
  
  TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
  
@@@ -1988,12 -1837,23 +1990,24 @@@ GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS
  ifndef NO_CURL
        GIT_OBJS += http.o http-walker.o remote-curl.o
  endif
- XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
-       xdiff/xmerge.o xdiff/xpatience.o xdiff/xhistogram.o
- VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
-       vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
- VCSSVN_TEST_OBJS = test-obj-pool.o test-string-pool.o \
-       test-line-buffer.o test-treap.o
+ XDIFF_OBJS += xdiff/xdiffi.o
+ XDIFF_OBJS += xdiff/xprepare.o
+ XDIFF_OBJS += xdiff/xutils.o
+ XDIFF_OBJS += xdiff/xemit.o
+ XDIFF_OBJS += xdiff/xmerge.o
+ XDIFF_OBJS += xdiff/xpatience.o
++XDIFF_OBJS += xdiff/xhistogram.o
+ VCSSVN_OBJS += vcs-svn/line_buffer.o
+ VCSSVN_OBJS += vcs-svn/sliding_window.o
+ VCSSVN_OBJS += vcs-svn/repo_tree.o
+ VCSSVN_OBJS += vcs-svn/fast_export.o
+ VCSSVN_OBJS += vcs-svn/svndiff.o
+ VCSSVN_OBJS += vcs-svn/svndump.o
+ VCSSVN_TEST_OBJS += test-line-buffer.o
  OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
  
  dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
@@@ -2112,19 -1972,28 +2126,28 @@@ connect.o transport.o url.o http-backen
  http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
  http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h url.h
  
- xdiff-interface.o $(XDIFF_OBJS): \
-       xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
-       xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
+ XDIFF_H += xdiff/xinclude.h
+ XDIFF_H += xdiff/xmacros.h
+ XDIFF_H += xdiff/xdiff.h
+ XDIFF_H += xdiff/xtypes.h
+ XDIFF_H += xdiff/xutils.h
+ XDIFF_H += xdiff/xprepare.h
+ XDIFF_H += xdiff/xdiffi.h
+ XDIFF_H += xdiff/xemit.h
+ xdiff-interface.o $(XDIFF_OBJS): $(XDIFF_H)
  
- $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
-       vcs-svn/obj_pool.h vcs-svn/trp.h vcs-svn/string_pool.h \
-       vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
-       vcs-svn/svndump.h
+ VCSSVN_H += vcs-svn/line_buffer.h
+ VCSSVN_H += vcs-svn/sliding_window.h
+ VCSSVN_H += vcs-svn/repo_tree.h
+ VCSSVN_H += vcs-svn/fast_export.h
+ VCSSVN_H += vcs-svn/svndiff.h
+ VCSSVN_H += vcs-svn/svndump.h
  
- test-svn-fe.o: vcs-svn/svndump.h
+ $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) $(VCSSVN_H)
  endif
  
 -exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
 +exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
        '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
        '-DBINDIR="$(bindir_relative_SQ)"' \
        '-DPREFIX="$(prefix_SQ)"'
@@@ -2347,10 -2168,8 +2370,8 @@@ test-delta$X: diff-delta.o patch-delta.
  
  test-line-buffer$X: vcs-svn/lib.a
  
 -test-parse-options$X: parse-options.o
 +test-parse-options$X: parse-options.o parse-options-cb.o
  
- test-string-pool$X: vcs-svn/lib.a
  test-svn-fe$X: vcs-svn/lib.a
  
  .PRECIOUS: $(TEST_OBJS)
index bc792223b2638bce4196eb0dc6626beb32f48da4,b1f4161068d478b52d0af15990d58f4a3d838da3..ca63760fe2108e5df0b0c84c85a8cfce5878c78a
@@@ -11,9 -11,7 +11,8 @@@
  #include "repo_tree.h"
  #include "fast_export.h"
  #include "line_buffer.h"
- #include "string_pool.h"
  #include "strbuf.h"
 +#include "svndump.h"
  
  /*
   * Compare start of string to literal of equal length;