Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
svndump parses data that is in SVN dumpfile format produced by `svnadmin dump` with the help of line_buffer and uses repo_tree and fast_export to emit a git fast-import stream. Based roughly on com.hydrografix.svndump 0.92 from the SvnToCCase project at <http://svn2cc.sarovar.org/>, by Stefan Hegny and others. [rr: allow input from files other than stdin] [jn: with test, more error reporting] Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Showing
8 changed files
with
372 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,7 @@ | |
/test-sha1 | ||
/test-sigchain | ||
/test-string-pool | ||
/test-svn-fe | ||
/test-treap | ||
/common-cmds.h | ||
*.tar.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
test_description='check svn dumpfile importer' | ||
|
||
. ./lib-git-svn.sh | ||
|
||
test_dump() { | ||
label=$1 | ||
dump=$2 | ||
test_expect_success "$dump" ' | ||
svnadmin create "$label-svn" && | ||
svnadmin load "$label-svn" < "$TEST_DIRECTORY/$dump" && | ||
svn_cmd export "file://$(pwd)/$label-svn" "$label-svnco" && | ||
git init "$label-git" && | ||
test-svn-fe "$TEST_DIRECTORY/$dump" >"$label.fe" && | ||
( | ||
cd "$label-git" && | ||
git fast-import < ../"$label.fe" | ||
) && | ||
( | ||
cd "$label-svnco" && | ||
git init && | ||
git add . && | ||
git fetch "../$label-git" master && | ||
git diff --exit-code FETCH_HEAD | ||
) | ||
' | ||
} | ||
|
||
test_dump simple t9111/svnsync.dump | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* test-svn-fe: Code to exercise the svn import lib | ||
*/ | ||
|
||
#include "git-compat-util.h" | ||
#include "vcs-svn/svndump.h" | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if (argc != 2) | ||
usage("test-svn-fe <file>"); | ||
svndump_init(argv[1]); | ||
svndump_read(NULL); | ||
svndump_deinit(); | ||
svndump_reset(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.