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/svndump.c | |
parent | 8d7cd8eb3b4cee410ee391f7d59610e2f90adf4f (diff) | |
download | git-8e43a1d010e22a0e432de440b08cc4389d8370f9.tar.gz |
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/svndump.c')
-rw-r--r-- | vcs-svn/svndump.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c index 7ec1a5b993..31d1d83d45 100644 --- a/vcs-svn/svndump.c +++ b/vcs-svn/svndump.c @@ -309,20 +309,20 @@ static void begin_revision(const char *remote_ref) rev_ctx.timestamp, remote_ref); } -static void end_revision(void) +static void end_revision(const char *note_ref) { struct strbuf mark = STRBUF_INIT; if (rev_ctx.revision) { fast_export_end_commit(rev_ctx.revision); fast_export_begin_note(rev_ctx.revision, "remote-svn", - "Note created by remote-svn.", rev_ctx.timestamp); + "Note created by remote-svn.", rev_ctx.timestamp, note_ref); strbuf_addf(&mark, ":%"PRIu32, rev_ctx.revision); fast_export_note(mark.buf, "inline"); fast_export_buf_to_data(&rev_ctx.note); } } -void svndump_read(const char *url, const char *local_ref) +void svndump_read(const char *url, const char *local_ref, const char *notes_ref) { char *val; char *t; @@ -363,7 +363,7 @@ void svndump_read(const char *url, const char *local_ref) if (active_ctx == REV_CTX) begin_revision(local_ref); if (active_ctx != DUMP_CTX) - end_revision(); + end_revision(notes_ref); active_ctx = REV_CTX; reset_rev_ctx(atoi(val)); strbuf_addf(&rev_ctx.note, "%s\n", t); @@ -479,7 +479,7 @@ void svndump_read(const char *url, const char *local_ref) if (active_ctx == REV_CTX) begin_revision(local_ref); if (active_ctx != DUMP_CTX) - end_revision(); + end_revision(notes_ref); } static void init(int report_fd) |