diff options
author | Florian Achleitner <florian.achleitner.2.6.31@gmail.com> | 2012-09-19 17:21:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-10-07 14:10:17 -0700 |
commit | 8e43a1d010e22a0e432de440b08cc4389d8370f9 (patch) | |
tree | b7b15e50ef8fbe1c4a67ce40a018b4b50f18f1c5 /vcs-svn/fast_export.c | |
parent | 8d7cd8eb3b4cee410ee391f7d59610e2f90adf4f (diff) | |
download | git-8e43a1d010e22a0e432de440b08cc4389d8370f9.tar.gz git-8e43a1d010e22a0e432de440b08cc4389d8370f9.tar.xz |
remote-svn: add incremental import
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 <florian.achleitner.2.6.31@gmail.com>
Acked-by: David Michael Barr <b@rr-dav.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'vcs-svn/fast_export.c')
-rw-r--r-- | vcs-svn/fast_export.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c index df51c59ca..f2b23c81d 100644 --- a/vcs-svn/fast_export.c +++ b/vcs-svn/fast_export.c @@ -68,13 +68,19 @@ void fast_export_modify(const char *path, uint32_t mode, const char *dataref) } void fast_export_begin_note(uint32_t revision, const char *author, - const char *log, unsigned long timestamp) + const char *log, unsigned long timestamp, const char *note_ref) { + static int firstnote = 1; size_t loglen = strlen(log); - printf("commit refs/notes/svn/revs\n"); + printf("commit %s\n", note_ref); printf("committer %s <%s@%s> %ld +0000\n", author, author, "local", timestamp); printf("data %"PRIuMAX"\n", (uintmax_t)loglen); fwrite(log, loglen, 1, stdout); + if (firstnote) { + if (revision > 1) + printf("from %s^0", note_ref); + firstnote = 0; + } fputc('\n', stdout); } |