Skip to contentSkip to conversation

Towards a Git to SVN bridge

PATCH In review Ramkumar Ramachandra 2 participants 9 messages Jun 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Towards a Git to SVN bridge

Hi,

Thanks to Jonathan, Junio, Peter, and Erik among others for reviewing previous iterations of this series. This iteration should take care of most error handling and design issues addressed in the previous iterations- it also comes along with a battery of tests.

Small introduction: svn-fi's design is modelled after git-fast-import. It aims to be more comprehensive and production-ready than the existing alternative, git2svn. It converts a fast-import stream to a Subversion dumpfile which can be loaded using svnadmin load (or alternatively using svnrdump load, which will feature in Subversion 1.7). The shortcomings can be summarized as follows:
1. dir_cache is a very naive implementation using string_list. This will not scale well either in memory or time, and should be replaced with a prefix tree in future.
2. It currently only supports one branch. For supporting multiple branches, two things need to be implemented: a branch-specific dir_cache, and a mapper that maps branch names to directories (if the standard "trunk", "branches", "tags" layout is not to be hardcoded).
3. Tags are currently unsupported, although it should be trivial to implement once a mapping is in place.
4. Merges are unsupported. This requires more thought.
5. The from command in the fast-import stream is ignored. This should probably be implemented like branching.
6. The data can't make round trips back-and-fourth yet. Although this topic has been discussed at length, there is no implementation of this yet.

Thanks for reading.

-- Ram

Ramkumar Ramachandra (5):
date: Expose the time_to_tm function
fast-export: Introduce --inline-blobs
strbuf: Introduce strbuf_fwrite corresponding to strbuf_fread
vcs-svn: Introduce svnload, a dumpfile producer
t9012-svn-fi: Add tests for svn-fi

 .gitignore                        |    1 +
 Documentation/git-fast-export.txt |    5 +
 Makefile                          |    6 +-
 builtin/fast-export.c             |   23 ++-
 cache.h                           |    1 +
 contrib/svn-fe/.gitignore         |    1 +
 contrib/svn-fe/Makefile           |   23 ++-
 contrib/svn-fe/svn-fi.c           |   16 +
 contrib/svn-fe/svn-fi.txt         |   28 ++
 date.c                            |    2 +-
 strbuf.c                          |   11 +
 strbuf.h                          |    1 +
 t/t9012-svn-fi.sh                 |  705 +++++++++++++++++++++++++++++++++++++
 test-svn-fi.c                     |   17 +
 vcs-svn/dir_cache.c               |   52 +++
 vcs-svn/dir_cache.h               |   11 +
 vcs-svn/dump_export.c             |  164 +++++++++
 vcs-svn/dump_export.h             |   26 ++
 vcs-svn/svnload.c                 |  485 +++++++++++++++++++++++++
 vcs-svn/svnload.h                 |   19 +
 20 files changed, 1591 insertions(+), 6 deletions(-)
 create mode 100644 contrib/svn-fe/svn-fi.c
 create mode 100644 contrib/svn-fe/svn-fi.txt
 create mode 100755 t/t9012-svn-fi.sh
 create mode 100644 test-svn-fi.c
 create mode 100644 vcs-svn/dir_cache.c
 create mode 100644 vcs-svn/dir_cache.h
 create mode 100644 vcs-svn/dump_export.c
 create mode 100644 vcs-svn/dump_export.h
 create mode 100644 vcs-svn/svnload.c
 create mode 100644 vcs-svn/svnload.h
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty
#1 lore raw

PATCH 1/5 date: Expose the time_to_tm function

---
 cache.h |    1 +
 date.c  |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
cache.h +1 -0
index f765cf5..76a14c6 100644
@@ -834,6 +834,7 @@ enum date_mode {
 	DATE_RAW
 };
 
+struct tm *time_to_tm(unsigned long time, int tz);
 const char *show_date(unsigned long time, int timezone, enum date_mode mode);
 const char *show_date_relative(unsigned long time, int tz,
 			       const struct timeval *now,
date.c +1 -1
index 00f9eb5..e601a50 100644
@@ -54,7 +54,7 @@ static time_t gm_time_t(unsigned long time, int tz)
  * thing, which means that tz -0100 is passed in as the integer -100,
  * even though it means "sixty minutes off"
  */
-static struct tm *time_to_tm(unsigned long time, int tz)
+struct tm *time_to_tm(unsigned long time, int tz)
 {
 	time_t t = gm_time_t(time, tz);
 	return gmtime(&t);
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty
#2 lore raw

PATCH 2/5 fast-export: Introduce --inline-blobs

In reply to Ramkumar Ramachandra

Introduce a new command-line option --inline-blobs that always inlines blobs instead of referring to them via marks or their original SHA-1 hash.

---
 Documentation/git-fast-export.txt |    5 +++++
 builtin/fast-export.c             |   23 +++++++++++++++++++++--
 contrib/svn-fe/.gitignore         |    1 +
 contrib/svn-fe/Makefile           |   23 +++++++++++++++++++++--
 contrib/svn-fe/svn-fi.c           |   16 ++++++++++++++++
 contrib/svn-fe/svn-fi.txt         |   28 ++++++++++++++++++++++++++++
 6 files changed, 92 insertions(+), 4 deletions(-)
 create mode 100644 contrib/svn-fe/svn-fi.c
 create mode 100644 contrib/svn-fe/svn-fi.txt
Documentation/git-fast-export.txt +5 -0
index 781bd6e..363e768 100644
@@ -90,6 +90,11 @@ marks the same across runs.
 	resulting stream can only be used by a repository which
 	already contains the necessary objects.
 
+--inline-blobs::
+	Inline all blobs, instead of referring to them via marks or
+	their original SHA-1 hash.  This is useful to parsers, as they
+	don't need to persist blobs.
+
 --full-tree::
 	This option will cause fast-export to issue a "deleteall"
 	directive for each commit followed by a full list of all files
builtin/fast-export.c +21 -2
index daf1945..891ad5c 100644
@@ -27,6 +27,7 @@ static enum { ABORT, VERBATIM, WARN, STRIP } signed_tag_mode = ABORT;
 static enum { ERROR, DROP, REWRITE } tag_of_filtered_mode = ABORT;
 static int fake_missing_tagger;
 static int no_data;
+static int inline_blobs;
 static int full_tree;
 
 static int parse_opt_signed_tag_mode(const struct option *opt,
@@ -118,7 +119,7 @@ static void handle_object(const unsigned char *sha1)
 	char *buf;
 	struct object *object;
 
-	if (no_data)
+	if (no_data || inline_blobs)
 		return;
 
 	if (is_null_sha1(sha1))
@@ -218,7 +219,23 @@ static void show_filemodify(struct diff_queue_struct *q,
 			if (no_data || S_ISGITLINK(spec->mode))
 				printf("M %06o %s %s\n", spec->mode,
 				       sha1_to_hex(spec->sha1), spec->path);
-			else {
+			else if (inline_blobs) {
+				unsigned long size;
+				enum object_type type;
+				char *buf;
+
+				buf = read_sha1_file(spec->sha1, &type, &size);
+				if (!buf)
+					die("Could not read blob %s",
+						sha1_to_hex(spec->sha1));
+				printf("M %06o inline %s\n", spec->mode, spec->path);
+				printf("data %lu\n", size);
+				if (size && fwrite(buf, size, 1, stdout) != 1)
+					die_errno("Could not write blob '%s'",
+						sha1_to_hex(spec->sha1));
+				printf("\n");
+
+			} else {
 				struct object *object = lookup_object(spec->sha1);
 				printf("M %06o :%d %s\n", spec->mode,
 				       get_object_mark(object), spec->path);
@@ -627,6 +644,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
 			     "Fake a tagger when tags lack one"),
 		OPT_BOOLEAN(0, "full-tree", &full_tree,
 			     "Output full tree for each commit"),
+		OPT_BOOLEAN(0, "inline-blobs", &inline_blobs,
+			     "Output all blobs inline"),
 		{ OPTION_NEGBIT, 0, "data", &no_data, NULL,
 			"Skip output of blob data",
 			PARSE_OPT_NOARG | PARSE_OPT_NEGHELP, NULL, 1 },
contrib/svn-fe/.gitignore +1 -0
index 02a7791..35f205d 100644
@@ -2,3 +2,4 @@
 /*.1
 /*.html
 /svn-fe
+/svn-fi
contrib/svn-fe/Makefile +21 -2
index 360d8da..555a8ff 100644
@@ -37,7 +37,7 @@ svn-fe$X: svn-fe.o $(VCSSVN_LIB) $(GIT_LIB)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ svn-fe.o \
 		$(ALL_LDFLAGS) $(LIBS)
 
-svn-fe.o: svn-fe.c ../../vcs-svn/svndump.h
+svn-fe.o: svn-fe.c ../../vcs-svn/svnload.h
 	$(QUIET_CC)$(CC) -I../../vcs-svn -o $*.o -c $(ALL_CFLAGS) $<
 
 svn-fe.html: svn-fe.txt
@@ -51,6 +51,24 @@ svn-fe.1: svn-fe.txt
 		../contrib/svn-fe/$@
 	$(MV) ../../Documentation/svn-fe.1 .
 
+svn-fi$X: svn-fi.o $(VCSSVN_LIB) $(GIT_LIB)
+	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ svn-fi.o \
+		$(ALL_LDFLAGS) $(LIBS)
+
+svn-fi.o: svn-fi.c ../../vcs-svn/svnload.h
+	$(QUIET_CC)$(CC) -I../../vcs-svn -o $*.o -c $(ALL_CFLAGS) $<
+
+svn-fi.html: svn-fi.txt
+	$(QUIET_SUBDIR0)../../Documentation $(QUIET_SUBDIR1) \
+		MAN_TXT=../contrib/svn-fe/svn-fi.txt \
+		../contrib/svn-fe/$@
+
+svn-fi.1: svn-fi.txt
+	$(QUIET_SUBDIR0)../../Documentation $(QUIET_SUBDIR1) \
+		MAN_TXT=../contrib/svn-fe/svn-fi.txt \
+		../contrib/svn-fe/$@
+	$(MV) ../../Documentation/svn-fi.1 .
+
 ../../vcs-svn/lib.a: FORCE
 	$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) vcs-svn/lib.a
 
@@ -58,6 +76,7 @@ svn-fe.1: svn-fe.txt
 	$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) libgit.a
 
 clean:
-	$(RM) svn-fe$X svn-fe.o svn-fe.html svn-fe.xml svn-fe.1
+	$(RM) svn-fe$X svn-fe.o svn-fe.html svn-fe.xml svn-fe.1 \
+	svn-fi$X svn-fi.o svn-fi.html svn-fi.xml svn-fi.1
 
 .PHONY: all clean FORCE
contrib/svn-fe/svn-fi.c new file +16 -0
new file mode 100644
index 0000000..81347b0
@@ -0,0 +1,16 @@
+/*
+ * This file is in the public domain.
+ * You may freely use, modify, distribute, and relicense it.
+ */
+
+#include <stdlib.h>
+#include "svnload.h"
+
+int main(int argc, char **argv)
+{
+	if (svnload_init(NULL))
+		return 1;
+	svnload_read();
+	svnload_deinit();
+	return 0;
+}
contrib/svn-fe/svn-fi.txt new file +28 -0
new file mode 100644
index 0000000..996a175
@@ -0,0 +1,28 @@
+svn-fe(1)
+=========
+
+NAME
+----
+svn-fi - convert fast-import stream to an SVN "dumpfile"
+
+SYNOPSIS
+--------
+[verse]
+svn-fi
+
+DESCRIPTION
+-----------
+
+Converts a git-fast-import(1) stream into a Subversion dumpfile.
+
+INPUT FORMAT
+-------------
+The fast-import format is documented by the git-fast-import(1)
+manual page.
+
+OUTPUT FORMAT
+------------
+Subversion's repository dump format is documented in full in
+`notes/dump-load-format.txt` from the Subversion source tree.
+Files in this format can be generated using the 'svnadmin dump' or
+'svk admin dump' command.
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty
#3 lore raw

Re: [PATCH 2/5] fast-export: Introduce --inline-blobs

Hi,

Quoted 3 lines · Ramkumar Ramachandra

Introduce a new command-line option --inline-blobs that always inlines blobs instead of referring to them via marks or their original SHA-1 hash.

Could you expand on this? What does it mean to inline a blob (is it the same thing as the reference manual describes as using the inline data format with the filemodify command)? Why do we want to always do that? How would a person or script choose whether to use this option? Are there any downsides?

I ask because I would be happy to use something like this. ;-) Thanks for working on it.

Documentation/git-fast-export.txt marks the same across runs. · line 96

Quoted 10 lines
Documentation/git-fast-export.txt +4 -0
@@ -90,6 +90,11 @@ marks the same across runs.
 	resulting stream can only be used by a repository which
 	already contains the necessary objects.
 
+--inline-blobs::
+	Inline all blobs, instead of referring to them via marks or
+	their original SHA-1 hash.  This is useful to parsers, as they
+	don't need to persist blobs.

This explanation leaves something out, I think. If it is useful to parsers, that means it simplifies the syntax, so a natural conclusion would be that parsers do not need to learn about the non-inline syntax. But I think the last time[1] this came up, we decided that one should not encourage that, because it moves away from a world in which "git fast-export", "hg fast-export", and svn-fe use one standard format and can be used interchangeably.

[1] http://thread.gmane.org/gmane.comp.version-control.git/165237/focus=165289

Perhaps it would be better to say something to the effect that "This can decrease the memory footprint and complexity of the work some fast-import backends have to do"? In other words, it's just an optimization.

To that end, if the same blob keeps on coming up again and again, I'd be tempted to allow making a mark for it in the future, even when --inline-blobs is specified. In other words, I'd prefer (unless real-world considerations prevent it) for --inline-blobs to be a hint or a permission instead of something binding.

Quoted 2 lines
builtin/fast-export.c +0 -0

[...]

builtin/fast-export.c static void handle_object(const unsigned char *sha1) · line 123

Quoted 7 lines
builtin/fast-export.c +1 -1
@@ -118,7 +119,7 @@ static void handle_object(const unsigned char *sha1)
 	char *buf;
 	struct object *object;
 
-	if (no_data)
+	if (no_data || inline_blobs)
 		return;

Maybe inline_blobs should imply no_data internally?

builtin/fast-export.c static void show_filemodify(struct diff_queue_struct *q, · line 222

Quoted 8 lines
builtin/fast-export.c +1 -1
 	if (is_null_sha1(sha1))
@@ -218,7 +219,23 @@ static void show_filemodify(struct diff_queue_struct *q,
 			if (no_data || S_ISGITLINK(spec->mode))
 				printf("M %06o %s %s\n", spec->mode,
 				       sha1_to_hex(spec->sha1), spec->path);
-			else {
+			else if (inline_blobs) {

If so, this could be something like

	int inline_me = inline_blobs && !S_ISGITLINK(spec->mode);
	...

	if (no_data || S_ISGITLINK(spec->mode)) {
		const char *dataref =
			inline_me ? "inline" : sha1_to_hex(spec->sha1);
		printf("M %06o %s %s\n", spec->mode, dataref, spec->path);
	} else {
		struct object *object = lookup_object(spec->sha1);
		printf("M %06o :%d %s\n", spec->mode,
		       get_object_mark(object), spec->path);
	}

	if (inline_blob && export_data(spec->data, spec->size))
		die_errno("Could not write blob '%s'",
				sha1_to_hex(spec->sha1));
Quoted 2 lines
contrib/svn-fe/.gitignore +0 -0

[...]

Quoted 2 lines
contrib/svn-fe/Makefile +0 -0

[...]

Quoted 2 lines
contrib/svn-fe/svn-fi.c new file +0 -0

[...]

contrib/svn-fe/svn-fi.txt

Quoted 2 lines
contrib/svn-fe/svn-fi.txt new file +0 -0

Snuck in from another patch?

Hope that helps,
Jonathan

#4 lore raw

PATCH 3/5 strbuf: Introduce strbuf_fwrite corresponding to strbuf_fread

In reply to Ramkumar Ramachandra
---
 strbuf.c |   11 +++++++++++
 strbuf.h |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)
strbuf.c +11 -0
index 77444a9..bdfd0d0 100644
@@ -290,6 +290,17 @@ size_t strbuf_fread(struct strbuf *sb, size_t size, FILE *f)
 	return res;
 }
 
+size_t strbuf_fwrite(struct strbuf *sb, size_t size, FILE *f)
+{
+	size_t res;
+
+	if (size > sb->len)
+		res = fwrite(sb->buf, 1, sb->len, f);
+	else 
+		res = fwrite(sb->buf, 1, size, f);
+	return res;
+}
+
 ssize_t strbuf_read(struct strbuf *sb, int fd, size_t hint)
 {
 	size_t oldlen = sb->len;
strbuf.h +1 -0
index f722331..c68361c 100644
@@ -124,6 +124,7 @@ __attribute__((format (printf,2,0)))
 extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap);
 
 extern size_t strbuf_fread(struct strbuf *, size_t, FILE *);
+extern size_t strbuf_fwrite(struct strbuf *, size_t, FILE *);
 /* XXX: if read fails, any partial read is undone */
 extern ssize_t strbuf_read(struct strbuf *, int fd, size_t hint);
 extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint);
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty
#5 lore raw

Re: [PATCH 3/5] strbuf: Introduce strbuf_fwrite corresponding to strbuf_fread

Quoted 3 lines · Ramkumar Ramachandra

[Subject: strbuf: Introduce strbuf_fwrite corresponding to strbuf_fread]

And why? FWIW strbuf_fread takes care of (1) setting the size of sb to accomodate the input, (2) starting reading at the end of the current strbuf, and (3) freeing the buffer if nothing could be read, so symmetry doesn't seem like a strong justification.

Which is not to say this is a bad change. Just that it's hard to see how it lives up to its goals without knowing what those goals are.

#6 lore raw

PATCH 4/5 vcs-svn: Introduce svnload, a dumpfile producer

In reply to Ramkumar Ramachandra

Design-wise, svnload resembles svndump. Include a Makefile rule to build it into vcs-svn/lib.a.

---
I'm not very happy with the parse_data and parse_data_len API. It's probably too cryptic? See also: two skip_optional_lf() calls in the parse_data function. It seems to be necessary- is the fast-import documentation wrong about one optional lf?

 Makefile              |    3 +-
 vcs-svn/dir_cache.c   |   52 ++++++
 vcs-svn/dir_cache.h   |   11 +
 vcs-svn/dump_export.c |  164 +++++++++++++++++
 vcs-svn/dump_export.h |   26 +++
 vcs-svn/svnload.c     |  485 +++++++++++++++++++++++++++++++++++++++++++++++++
 vcs-svn/svnload.h     |   19 ++
 7 files changed, 759 insertions(+), 1 deletions(-)
 create mode 100644 vcs-svn/dir_cache.c
 create mode 100644 vcs-svn/dir_cache.h
 create mode 100644 vcs-svn/dump_export.c
 create mode 100644 vcs-svn/dump_export.h
 create mode 100644 vcs-svn/svnload.c
 create mode 100644 vcs-svn/svnload.h
Makefile +2 -1
index b0f155a..7206d35 100644
@@ -1838,7 +1838,8 @@ 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/string_pool.o vcs-svn/line_buffer.o \
-	vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
+	vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o \
+	vcs-svn/svnload.o vcs-svn/dump_export.o vcs-svn/dir_cache.o
 VCSSVN_TEST_OBJS = test-obj-pool.o test-string-pool.o \
 	test-line-buffer.o test-treap.o
 OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
vcs-svn/dir_cache.c new file +52 -0

52 lines not on this page · raw message

vcs-svn/dir_cache.h new file +11 -0
new file mode 100644
index 0000000..e7e83fb
@@ -0,0 +1,11 @@
+#ifndef DIR_CACHE_H_
+#define DIR_CACHE_H_
+
+#include "dump_export.h"
+
+void dir_cache_add(const char *path, mode_t mode);
+void dir_cache_remove(const char *path);
+mode_t dir_cache_lookup(const char *path);
+void dir_cache_mkdir_p(const char *path);
+
+#endif
vcs-svn/dump_export.c new file +164 -0

164 lines not on this page · raw message

vcs-svn/dump_export.h new file +26 -0
new file mode 100644
index 0000000..647701d
@@ -0,0 +1,26 @@
+#ifndef DUMP_EXPORT_H_
+#define DUMP_EXPORT_H_
+
+#define MAX_GITSVN_LINE_LEN 4096
+#define SVN_INVALID_REV 0
+
+enum node_action {
+	NODE_ACTION_CHANGE,
+	NODE_ACTION_ADD,
+	NODE_ACTION_DELETE,
+	NODE_ACTION_REPLACE,
+	NODE_ACTION_COUNT
+};
+
+void dump_export_revision(struct strbuf *revprops);
+void dump_export_node(const char *path, mode_t mode,
+		enum node_action action, size_t text_len,
+		const char *copyfrom_path);
+void dump_export_mkdir(const char *path);
+void dump_export_m(const char *path, mode_t mode, size_t text_len);
+void dump_export_d(const char *path);
+void dump_export_cr(const char *path, const char *copyfrom_path,
+		int delete_old);
+void dump_export_init();
+
+#endif
vcs-svn/svnload.c new file +485 -0

485 lines not on this page · raw message

vcs-svn/svnload.h new file +19 -0
new file mode 100644
index 0000000..12bb559
@@ -0,0 +1,19 @@
+#ifndef SVNLOAD_H_
+#define SVNLOAD_H_
+
+#include "strbuf.h"
+
+#define SVN_DATE_FORMAT "%Y-%m-%dT%H:%M:%S.000000Z"
+#define SVN_DATE_LEN 28
+#define COPY_BUFFER_LEN 4096
+
+struct ident {
+	struct strbuf name, email;
+	char date[SVN_DATE_LEN];
+};
+
+int svnload_init(const char *filename);
+void svnload_deinit(void);
+void svnload_read(void);
+
+#endif
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty
#7 lore raw

PATCH 5/5 t9012-svn-fi: Add tests for svn-fi

In reply to Ramkumar Ramachandra

Create a test-svn-fi in toplevel directory, add rules to build it, and add some basic tests.

---
Verifying svn:date is very non-trivial, because of timezone conversion issues. I tried fuzzing those out and checking only year and month, but a timezone shift can cause a change in both of them as well. Example: 31 Dec 2011 11:45 PM in one timezone can very well be 1 Jan 2012 in another timezone.

More tests? Suggestions for reduced testcases of complex revision history tasks? I'll probably import some tests from svnrdump in the next iteration.

 .gitignore        |    1 +
 Makefile          |    3 +
 t/t9012-svn-fi.sh |  705 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 test-svn-fi.c     |   17 ++
 4 files changed, 726 insertions(+), 0 deletions(-)
 create mode 100755 t/t9012-svn-fi.sh
 create mode 100644 test-svn-fi.c
.gitignore +1 -0
index c460c66..1cf145d 100644
@@ -181,6 +181,7 @@
 /test-subprocess
 /test-svn-fe
 /test-treap
+/test-svn-fi
 /common-cmds.h
 *.tar.gz
 *.dsc
Makefile +3 -0
index 7206d35..7fc5a2c 100644
@@ -435,6 +435,7 @@ 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-svn-fi
 TEST_PROGRAMS_NEED_X += test-index-version
 TEST_PROGRAMS_NEED_X += test-mktemp
 
@@ -2152,6 +2153,8 @@ test-string-pool$X: vcs-svn/lib.a
 
 test-svn-fe$X: vcs-svn/lib.a
 
+test-svn-fi$X: vcs-svn/lib.a
+
 .PRECIOUS: $(TEST_OBJS)
 
 test-%$X: test-%.o $(GITLIBS)
t/t9012-svn-fi.sh new file +705 -0

705 lines not on this page · raw message

test-svn-fi.c new file +17 -0
new file mode 100644
index 0000000..cc6b312
@@ -0,0 +1,17 @@
+/*
+ * test-svn-fe: Code to exercise the svn import lib
+ */
+
+#include "git-compat-util.h"
+#include "vcs-svn/svnload.h"
+
+int main(int argc, char *argv[])
+{
+	if (argc != 2)
+		usage("test-svn-fe <file>");
+	if (svnload_init(argv[1]))
+		return 1;
+	svnload_read();
+	svnload_deinit();
+	return 0;
+}
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty
#8 lore raw

Re: [PATCH 5/5] t9012-svn-fi: Add tests for svn-fi

Quoted 2 lines · Ramkumar Ramachandra

Verifying svn:date is very non-trivial, because of timezone conversion issues.

Maybe the TZ variable can help.