From: Junio C Hamano Date: Tue, 31 Aug 2010 23:23:38 +0000 (-0700) Subject: Merge branch 'jn/svn-fe' X-Git-Tag: v1.7.3-rc0~31 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/aca35505db3706c87d391dd213e856f73edfd42c?hp=-c Merge branch 'jn/svn-fe' * jn/svn-fe: t/t9010-svn-fe.sh: add an +x bit to this test t9010 (svn-fe): avoid symlinks in test t9010 (svn-fe): use Unix-style path in URI vcs-svn: Avoid %z in format string vcs-svn: Rename dirent pool to build on Windows compat: add strtok_r() treap: style fix vcs-svn: remove build artifacts on "make clean" svn-fe manual: Clarify warning about deltas in dump files Update svn-fe manual SVN dump parser Infrastructure to write revisions in fast-export format Add stream helper library Add string-specific memory pool Add treap implementation Add memory pool library Introduce vcs-svn lib --- aca35505db3706c87d391dd213e856f73edfd42c diff --combined .gitignore index fcdd822d8a,258723f681..4cb14e0bae --- a/.gitignore +++ b/.gitignore @@@ -158,7 -158,7 +158,7 @@@ /gitk-git/gitk-wish /gitweb/GITWEB-BUILD-OPTIONS /gitweb/gitweb.cgi -/gitweb/gitweb.min.* +/gitweb/static/gitweb.min.* /test-chmtime /test-ctype /test-date @@@ -166,12 -166,17 +166,17 @@@ /test-dump-cache-tree /test-genrandom /test-index-version + /test-line-buffer /test-match-trees + /test-obj-pool /test-parse-options /test-path-utils /test-run-command /test-sha1 /test-sigchain + /test-string-pool + /test-svn-fe + /test-treap /common-cmds.h *.tar.gz *.dsc diff --combined Makefile index b4745a5412,fbc658143c..32e3eb385d --- a/Makefile +++ b/Makefile @@@ -68,6 -68,8 +68,8 @@@ all: # # Define NO_MKSTEMPS if you don't have mkstemps in the C library. # + # Define NO_STRTOK_R if you don't have strtok_r in the C library. + # # Define NO_LIBGEN_H if you don't have libgen.h. # # Define NEEDS_LIBGEN if your libgen needs -lgen when linking @@@ -408,12 -410,17 +410,17 @@@ TEST_PROGRAMS_NEED_X += test-dat TEST_PROGRAMS_NEED_X += test-delta TEST_PROGRAMS_NEED_X += test-dump-cache-tree TEST_PROGRAMS_NEED_X += test-genrandom + 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-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-svn-fe + TEST_PROGRAMS_NEED_X += test-treap TEST_PROGRAMS_NEED_X += test-index-version TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X)) @@@ -468,6 -475,7 +475,7 @@@ export PYTHON_PAT LIB_FILE=libgit.a XDIFF_LIB=xdiff/lib.a + VCSSVN_LIB=vcs-svn/lib.a LIB_H += advice.h LIB_H += archive.h @@@ -1035,6 -1043,7 +1043,7 @@@ ifeq ($(uname_S),Windows NO_UNSETENV = YesPlease NO_STRCASESTR = YesPlease NO_STRLCPY = YesPlease + NO_STRTOK_R = YesPlease NO_MEMMEM = YesPlease # NEEDS_LIBICONV = YesPlease NO_ICONV = YesPlease @@@ -1089,6 -1098,7 +1098,7 @@@ ifneq (,$(findstring MINGW,$(uname_S)) NO_UNSETENV = YesPlease NO_STRCASESTR = YesPlease NO_STRLCPY = YesPlease + NO_STRTOK_R = YesPlease NO_MEMMEM = YesPlease NEEDS_LIBICONV = YesPlease OLD_ICONV = YesPlease @@@ -1319,6 -1329,10 +1329,10 @@@ endi ifdef NO_STRTOULL COMPAT_CFLAGS += -DNO_STRTOULL endif + ifdef NO_STRTOK_R + COMPAT_CFLAGS += -DNO_STRTOK_R + COMPAT_OBJS += compat/strtok_r.o + endif ifdef NO_SETENV COMPAT_CFLAGS += -DNO_SETENV COMPAT_OBJS += compat/setenv.o @@@ -1739,7 -1753,9 +1753,9 @@@ ifndef NO_CUR endif XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \ xdiff/xmerge.o xdiff/xpatience.o - OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) + 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 + OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS) dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d) dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS)))) @@@ -1861,6 -1877,11 +1877,11 @@@ http.o http-walker.o http-push.o http-f 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 + + $(VCSSVN_OBJS): \ + 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 endif exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \ @@@ -1873,7 -1894,7 +1894,7 @@@ builtin/init-db.s builtin/init-db.o: EX config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' -http.s http.o: EXTRA_CPPFLAGS = -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' +http.s http.o: EXTRA_CPPFLAGS = -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"' ifdef NO_EXPAT http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT @@@ -1909,6 -1930,8 +1930,8 @@@ $(LIB_FILE): $(LIB_OBJS $(XDIFF_LIB): $(XDIFF_OBJS) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS) + $(VCSSVN_LIB): $(VCSSVN_OBJS) + $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS) doc: $(MAKE) -C Documentation all @@@ -2007,12 -2030,18 +2030,18 @@@ test-date$X: date.o ctype. test-delta$X: diff-delta.o patch-delta.o + test-line-buffer$X: vcs-svn/lib.a + test-parse-options$X: parse-options.o + test-string-pool$X: vcs-svn/lib.a + + test-svn-fe$X: vcs-svn/lib.a + .PRECIOUS: $(TEST_OBJS) test-%$X: test-%.o $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) check-sha1:: test-sha1$X ./test-sha1.sh @@@ -2187,8 -2216,8 +2216,8 @@@ distclean: clea $(RM) configure clean: - $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \ - builtin/*.o $(LIB_FILE) $(XDIFF_LIB) + $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \ + builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB) $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X $(RM) $(TEST_PROGRAMS) $(RM) -r bin-wrappers diff --combined git-compat-util.h index fe845ae639,28d6b008c1..877096ecb0 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -312,6 -312,11 +312,11 @@@ extern size_t gitstrlcpy(char *, const extern uintmax_t gitstrtoumax(const char *, char **, int); #endif + #ifdef NO_STRTOK_R + #define strtok_r gitstrtok_r + extern char *gitstrtok_r(char *s, const char *delim, char **save_ptr); + #endif + #ifdef NO_HSTRERROR #define hstrerror githstrerror extern const char *githstrerror(int herror); @@@ -388,8 -393,6 +393,8 @@@ extern int odb_pack_keep(char *name, si static inline size_t xsize_t(off_t len) { + if (len > (size_t) len) + die("Cannot handle files this big"); return (size_t)len; }