path: root/contrib/svn-fe
AgeCommit message (Collapse)Author
2014-08-28contrib/svn-fe: fix MakefileMaxim Bublis
Fixes several problems: * include config.mak.uname, config.mak.autogen and config.mak in order to use settings for prefix and other such things; * link xdiff/lib.a as it is a requirement for libgit.a; * fix CFLAGS, LDFLAGS and EXTLIBS for Linux and Mac OS X. Signed-off-by: Maxim Bublis <> Signed-off-by: Junio C Hamano <>
2014-05-12svn-fe: conform to pep8William Giokas
Quite a large change, most of this was whitespace changes, though there were a few places where I removed a comma or added a few characters. Should pass through pep8 and pass every test. Signed-off-by: William Giokas <> Acked-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2014-03-31contrib: fix misuses of "nor"Justin Lebar
Signed-off-by: Justin Lebar <> Signed-off-by: Junio C Hamano <>
2013-01-25svn-fe: allow to run with Python 3John Keeping
The changes to allow this script to run with Python 3 are minimal and do not affect its functionality on the versions of Python 2 that are already supported (2.4 onwards). Signed-off-by: John Keeping <> Signed-off-by: Junio C Hamano <>
2012-12-28Add checks to Python scripts for version dependencies.Eric S. Raymond
Signed-off-by: Eric S. Raymond <> Signed-off-by: Junio C Hamano <>
2012-10-07Add a svnrdump-simulator replaying a dump file for testingFlorian Achleitner
To ease testing without depending on a reachable svn server, this compact python script mimics parts of svnrdumps behaviour. It requires the remote url to start with sim://. Start and end revisions are evaluated. If the requested revision doesn't exist, as it is the case with incremental imports, if no new commit was added, it returns 1 (like svnrdump). To allow using the same dump file for simulating multiple incremental imports, the highest revision can be limited by setting the environment variable SVNRMAX to that value. This simulates the situation where higher revs don't exist yet. Signed-off-by: Florian Achleitner <> Acked-by: David Michael Barr <> Signed-off-by: Junio C Hamano <>
2012-10-07remote-svn: add incremental importFlorian Achleitner
Search for a note attached to the ref to update and read it's 'Revision-number:'-line. Start import from the next svn revision. If there is no next revision in the svn repo, svnrdump terminates with a message on stderr an non-zero return value. This looks a little weird, but there is no other way to know whether there is a new revision in the svn repo. On the start of an incremental import, the parent of the first commit in the fast-import stream is set to the branch name to update. All following commits specify their parent by a mark number. Previous mark files are currently not reused. Signed-off-by: Florian Achleitner <> Acked-by: David Michael Barr <> Signed-off-by: Junio C Hamano <>
2012-10-07remote-svn, vcs-svn: Enable fetching to private refsFlorian Achleitner
The reference to update by the fast-import stream is hard-coded. When fetching from a remote the remote-helper shall update refs in a private namespace, i.e. a private subdir of refs/. This namespace is defined by the 'refspec' capability, that the remote-helper advertises as a reply to the 'capabilities' command. Extend svndump and fast-export to allow passing the target ref. Update svn-fe to be compatible. Signed-off-by: Florian Achleitner <> Acked-by: David Michael Barr <> Signed-off-by: Junio C Hamano <>
2012-03-28correct spelling: an URL -> a URLJim Meyering
Signed-off-by: Jim Meyering <> Signed-off-by: Junio C Hamano <>
2011-05-26vcs-svn: implement text-delta handlingDavid Barr
Handle input in Subversion's dumpfile format, version 3. This is the format produced by "svnrdump dump" and "svnadmin dump --deltas", and the main difference between v3 dumpfiles and the dumpfiles already handled is that these can include nodes whose properties and text are expressed relative to some other node. To handle such nodes, we find which node the text and properties are based on, handle its property changes, use the cat-blob command to request the basis blob from the fast-import backend, use the svndiff0_apply() helper to apply the text delta on the fly, writing output to a temporary file, and then measure that postimage file's length and write its content to the fast-import stream. The temporary postimage file is shared between delta-using nodes to avoid some file system overhead. The svn-fe interface needs to be more complicated to accomodate the backward flow of information from the fast-import backend to svn-fe. The backflow fd is not needed when parsing streams without deltas, though, so existing scripts using svn-fe on v2 dumps should continue to work. NEEDSWORK: generalize interface so caller sets the backflow fd, close temporary file before exiting Signed-off-by: David Barr <> Signed-off-by: Jonathan Nieder <> Signed-off-by: David Barr <> Signed-off-by: Jonathan Nieder <>
2011-03-07vcs-svn: set up channel to read fast-import cat-blob responseDavid Barr
Set up some plumbing: teach the svndump lib to pass a file descriptor number to the fast_export lib, representing where cat-blob/ls responses can be read from, and add a get_response_line helper function to the fast_export lib to read a line from that file. Unfortunately this means that svn-fe needs file descriptor 3 to be redirected from somewhere (preferrably the cat-blob stream of a fast-import backend); otherwise it will fail: $ svndump <path> | svn-fe fatal: cannot read from file descriptor 3: Bad file descriptor For the moment, "svn-fe 3</dev/null" works as a workaround but it will not work for very long. A fast-import backend that can retrieve old commits is needed in order to be able to fulfill svn "Node-copyfrom-rev" requests that refer to revs from a previous run. [jn: with new change description] Based-on-patch-by: Jonathan Nieder <> Signed-off-by: David Barr <> Signed-off-by: Jonathan Nieder <>
2011-02-26Merge commit 'jn/svn-fe' of git:// into svn-feJonathan Nieder
* git:// vcs-svn: Allow change nodes for root of tree (/) vcs-svn: Implement Prop-delta handling vcs-svn: Sharpen parsing of property lines vcs-svn: Split off function for handling of individual properties vcs-svn: Make source easier to read on small screens vcs-svn: More dump format sanity checks vcs-svn: Reject path nodes without Node-action vcs-svn: Delay read of per-path properties vcs-svn: Combine repo_replace and repo_modify functions vcs-svn: Replace = Delete + Add vcs-svn: handle_node: Handle deletion case early vcs-svn: Use mark to indicate nodes with included text vcs-svn: Unclutter handle_node by introducing have_props var vcs-svn: Eliminate node_ctx.mark global vcs-svn: Eliminate node_ctx.srcRev global vcs-svn: Check for errors from open() vcs-svn: Allow simple v3 dumps (no deltas yet) Conflicts: t/ vcs-svn/svndump.c
2011-02-11svn-fe: warn about experimental statusJonathan Nieder
svn-fe is young and some coming cleanups might involve backward incompatible UI changes. Add some words of warning to the manual so early adopters that are not following the project closely don't get burned. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-11-24vcs-svn: Check for errors from open()Jonathan Nieder
test-svn-fe segfaults when passed a bogus path. Simplify debugging by exiting with a meaningful error message instead. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-15svn-fe manual: Clarify warning about deltas in dump filesJonathan Nieder
Those in the know would notice that dump file format version 2 means "svnadmin dump --no-deltas", but for the rest of us, an explicit reminder is useful. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-15Update svn-fe manualJonathan Nieder
The svn-fe example does not litter the working directory with .bin files any more (hoorah!). The permissive error handling implies a known bug. We should be flagging iffy input and, even if we continue, reporting it on exit. Cc: David Barr <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-15SVN dump parserDavid Barr
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 <>, by Stefan Hegny and others. [rr: allow input from files other than stdin] [jn: with test, more error reporting] Signed-off-by: David Barr <> Signed-off-by: Ramkumar Ramachandra <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-03contrib/svn-fe: Add the svn-fe target to .gitignoreRamkumar Ramachandra
Add the svn-fe target to .gitignroe. Signed-off-by: Ramkumar Ramachandra <> Signed-off-by: Junio C Hamano <>
2010-08-03contrib/svn-fe: Fix IncludePathRamkumar Ramachandra
Include the path "../../vcs-svn" while compiling it in the Makefile and change svn-fe.c to include svndump.h. Signed-off-by: Ramkumar Ramachandra <> Signed-off-by: Junio C Hamano <>
2010-07-16Add a sample user for the svndump libraryJonathan Nieder
The svn-fe tool takes a Subversion dump file as input and produces a fast-import stream as output. This can be useful as a low-level tool in building other importers, or for debugging the vcs-svn library. make svn-fe make svn-fe.1 to test. Signed-off-by: Jonathan Nieder <> Signed-off-by: Ramkumar Ramachandra <> Signed-off-by: Junio C Hamano <>