Merge branch 'db/delta-applier' into db/text-delta
authorJonathan Nieder <jrnieder@gmail.com>
Thu, 26 May 2011 07:27:48 +0000 (02:27 -0500)
committerJonathan Nieder <jrnieder@gmail.com>
Thu, 26 May 2011 07:27:48 +0000 (02:27 -0500)
* db/delta-applier:
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

Conflicts:
Makefile
vcs-svn/LICENSE

1  2 
Makefile
vcs-svn/LICENSE
diff --combined Makefile
index 91e20d29c66eafa0294a921f68bd2f860fe7cc76,cd7dd9723d23f4b8cdceb17a5e850523886f99b7..e954dffa9e461396e6f78ae4f24fbd0f2ebf0935
+++ b/Makefile
@@@ -45,6 -45,11 +45,6 @@@ all:
  # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
  # d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
  #
 -# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
 -# do not support the 'size specifiers' introduced by C99, namely ll, hh,
 -# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
 -# some C compilers supported these specifiers prior to C99 as an extension.
 -#
  # Define NO_STRCASESTR if you don't have strcasestr.
  #
  # Define NO_MEMMEM if you don't have memmem.
  #
  # Define NO_REGEX if you have no or inferior regex support in your C library.
  #
 +# Define GETTEXT_POISON if you are debugging the choice of strings marked
 +# for translation.  In a GETTEXT_POISON build, you can turn all strings marked
 +# for translation into gibberish by setting the GIT_GETTEXT_POISON variable
 +# (to any value) in your environment.
 +#
  # Define JSMIN to point to JavaScript minifier that functions as
  # a filter to have gitweb.js minified.
  #
@@@ -316,7 -316,6 +316,7 @@@ INSTALL = instal
  RPMBUILD = rpmbuild
  TCL_PATH = tclsh
  TCLTK_PATH = wish
 +XGETTEXT = xgettext
  PTHREAD_LIBS = -lpthread
  PTHREAD_CFLAGS =
  GCOV = gcov
@@@ -342,6 -341,11 +342,11 @@@ BUILTIN_OBJS 
  BUILT_INS =
  COMPAT_CFLAGS =
  COMPAT_OBJS =
+ XDIFF_H =
+ XDIFF_OBJS =
+ VCSSVN_H =
+ VCSSVN_OBJS =
+ VCSSVN_TEST_OBJS =
  EXTRA_CPPFLAGS =
  LIB_H =
  LIB_OBJS =
@@@ -425,13 -429,16 +430,13 @@@ TEST_PROGRAMS_NEED_X += test-dump-cache
  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-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
  
@@@ -513,7 -520,6 +518,7 @@@ LIB_H += diff.
  LIB_H += dir.h
  LIB_H += exec_cmd.h
  LIB_H += fsck.h
 +LIB_H += gettext.h
  LIB_H += git-compat-util.h
  LIB_H += graph.h
  LIB_H += grep.h
@@@ -870,6 -876,7 +875,6 @@@ ifeq ($(uname_S),SunOS
                NO_UNSETENV = YesPlease
                NO_SETENV = YesPlease
                NO_STRLCPY = YesPlease
 -              NO_C99_FORMAT = YesPlease
                NO_STRTOUMAX = YesPlease
                GIT_TEST_CMP = cmp
        endif
                NO_UNSETENV = YesPlease
                NO_SETENV = YesPlease
                NO_STRLCPY = YesPlease
 -              NO_C99_FORMAT = YesPlease
                NO_STRTOUMAX = YesPlease
                GIT_TEST_CMP = cmp
        endif
        ifeq ($(uname_R),5.8)
                NO_UNSETENV = YesPlease
                NO_SETENV = YesPlease
 -              NO_C99_FORMAT = YesPlease
                NO_STRTOUMAX = YesPlease
                GIT_TEST_CMP = cmp
        endif
        ifeq ($(uname_R),5.9)
                NO_UNSETENV = YesPlease
                NO_SETENV = YesPlease
 -              NO_C99_FORMAT = YesPlease
                NO_STRTOUMAX = YesPlease
                GIT_TEST_CMP = cmp
        endif
@@@ -1037,7 -1047,6 +1042,7 @@@ ifeq ($(uname_S),HP-UX
        NO_UNSETENV = YesPlease
        NO_HSTRERROR = YesPlease
        NO_SYS_SELECT_H = YesPlease
 +      NO_FNMATCH_CASEFOLD = YesPlease
        SNPRINTF_RETURNS_BOGUS = YesPlease
        NO_NSEC = YesPlease
        ifeq ($(uname_R),B.11.00)
@@@ -1071,6 -1080,7 +1076,6 @@@ ifeq ($(uname_S),Windows
        NO_MEMMEM = YesPlease
        # NEEDS_LIBICONV = YesPlease
        NO_ICONV = YesPlease
 -      NO_C99_FORMAT = YesPlease
        NO_STRTOUMAX = YesPlease
        NO_STRTOULL = YesPlease
        NO_MKDTEMP = YesPlease
@@@ -1147,6 -1157,7 +1152,6 @@@ ifneq (,$(findstring MINGW,$(uname_S))
        NO_MEMMEM = YesPlease
        NEEDS_LIBICONV = YesPlease
        OLD_ICONV = YesPlease
 -      NO_C99_FORMAT = YesPlease
        NO_STRTOUMAX = YesPlease
        NO_MKDTEMP = YesPlease
        NO_MKSTEMPS = YesPlease
@@@ -1349,6 -1360,9 +1354,6 @@@ endi
  ifdef NO_NSEC
        BASIC_CFLAGS += -DNO_NSEC
  endif
 -ifdef NO_C99_FORMAT
 -      BASIC_CFLAGS += -DNO_C99_FORMAT
 -endif
  ifdef SNPRINTF_RETURNS_BOGUS
        COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
        COMPAT_OBJS += compat/snprintf.o
@@@ -1360,10 -1374,6 +1365,10 @@@ endi
  ifdef NO_SYMLINK_HEAD
        BASIC_CFLAGS += -DNO_SYMLINK_HEAD
  endif
 +ifdef GETTEXT_POISON
 +      LIB_OBJS += gettext.o
 +      BASIC_CFLAGS += -DGETTEXT_POISON
 +endif
  ifdef NO_STRCASESTR
        COMPAT_CFLAGS += -DNO_STRCASESTR
        COMPAT_OBJS += compat/strcasestr.o
@@@ -1575,7 -1585,6 +1580,7 @@@ ifndef 
        QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
        QUIET_GEN      = @echo '   ' GEN $@;
        QUIET_LNCP     = @echo '   ' LN/CP $@;
 +      QUIET_XGETTEXT = @echo '   ' XGETTEXT $@;
        QUIET_GCOV     = @echo '   ' GCOV $@;
        QUIET_SUBDIR0  = +@subdir=
        QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
@@@ -1832,11 -1841,27 +1837,23 @@@ 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
- VCSSVN_OBJS = vcs-svn/line_buffer.o vcs-svn/repo_tree.o \
-       vcs-svn/fast_export.o vcs-svn/svndump.o
- VCSSVN_TEST_OBJS = test-line-buffer.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
 -VCSSVN_OBJS += vcs-svn/string_pool.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-obj-pool.o
 -VCSSVN_TEST_OBJS += test-string-pool.o
+ VCSSVN_TEST_OBJS += test-line-buffer.o
 -VCSSVN_TEST_OBJS += test-treap.o
  OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
  
  dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
@@@ -1955,15 -1980,28 +1972,25 @@@ connect.o transport.o http-backend.o: u
  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
- $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
-       vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
-       vcs-svn/svndump.h
- test-svn-fe.o: vcs-svn/svndump.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_H += vcs-svn/obj_pool.h
 -VCSSVN_H += vcs-svn/trp.h
 -VCSSVN_H += vcs-svn/string_pool.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
+ $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) $(VCSSVN_H)
  endif
  
  exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
@@@ -2041,21 -2079,6 +2068,21 @@@ info
  pdf:
        $(MAKE) -C Documentation pdf
  
 +XGETTEXT_FLAGS = \
 +      --force-po \
 +      --add-comments \
 +      --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
 +      --from-code=UTF-8
 +XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
 +      --keyword=_ --keyword=N_ --keyword="Q_:1,2"
 +LOCALIZED_C := $(C_OBJ:o=c)
 +
 +po/git.pot: $(LOCALIZED_C)
 +      $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
 +      mv $@+ $@
 +
 +pot: po/git.pot
 +
  $(ETAGS_TARGET): FORCE
        $(RM) $(ETAGS_TARGET)
        $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
@@@ -2097,7 -2120,6 +2124,7 @@@ endi
  ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
        @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
  endif
 +      @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
  
  ### Detect Tck/Tk interpreter path changes
  ifndef NO_TCLTK
@@@ -2143,6 -2165,8 +2170,6 @@@ test-line-buffer$X: vcs-svn/lib.
  
  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)
@@@ -2156,7 -2180,7 +2183,7 @@@ check-sha1:: test-sha1$
  check: common-cmds.h
        if sparse; \
        then \
 -              for i in *.c; \
 +              for i in $(patsubst %.o, %.c, $(GIT_OBJS)); \
                do \
                        sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
                done; \
@@@ -2321,7 -2345,6 +2348,7 @@@ dist-doc
  
  distclean: clean
        $(RM) configure
 +      $(RM) po/git.pot
  
  clean:
        $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
diff --combined vcs-svn/LICENSE
index 533f585ebf8871f446bfc4cc10e30bf35eff53d7,805882c8383e9258e883dfd528baaa02ecfbf064..eb91858b825ba89131054444b7cac104285fad3c
@@@ -1,6 -1,11 +1,8 @@@
  Copyright (C) 2010 David Barr <david.barr@cordelta.com>.
  All rights reserved.
  
 -Copyright (C) 2008 Jason Evans <jasone@canonware.com>.
 -All rights reserved.
 -
+ Copyright (C) 2010 Jonathan Nieder <jrnieder@gmail.com>.
  Copyright (C) 2005 Stefan Hegny, hydrografix Consulting GmbH,
  Frankfurt/Main, Germany
  and others, see http://svn2cc.sarovar.org