aboutsummaryrefslogtreecommitdiff
path: root/vcs-svn
diff options
context:
space:
mode:
Diffstat (limited to 'vcs-svn')
-rw-r--r--vcs-svn/fast_export.c10
-rw-r--r--vcs-svn/fast_export.h6
-rw-r--r--vcs-svn/svndump.c10
-rw-r--r--vcs-svn/svndump.h2
4 files changed, 17 insertions, 11 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);
}
diff --git a/vcs-svn/fast_export.h b/vcs-svn/fast_export.h
index c2f6f11b1..c8b5adb81 100644
--- a/vcs-svn/fast_export.h
+++ b/vcs-svn/fast_export.h
@@ -11,10 +11,10 @@ void fast_export_delete(const char *path);
void fast_export_modify(const char *path, uint32_t mode, const char *dataref);
void fast_export_note(const char *committish, 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);
void fast_export_begin_commit(uint32_t revision, const char *author,
- const struct strbuf *log, const char *uuid,
- const char *url, unsigned long timestamp, const char *local_ref);
+ const struct strbuf *log, const char *uuid,const char *url,
+ unsigned long timestamp, const char *local_ref);
void fast_export_end_commit(uint32_t revision);
void fast_export_data(uint32_t mode, off_t len, struct line_buffer *input);
void fast_export_buf_to_data(const struct strbuf *data);
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 7ec1a5b99..31d1d83d4 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)
diff --git a/vcs-svn/svndump.h b/vcs-svn/svndump.h
index febeecbe9..b8eb12954 100644
--- a/vcs-svn/svndump.h
+++ b/vcs-svn/svndump.h
@@ -3,7 +3,7 @@
int svndump_init(const char *filename);
int svndump_init_fd(int in_fd, int back_fd);
-void svndump_read(const char *url, const char *local_ref);
+void svndump_read(const char *url, const char *local_ref, const char *notes_ref);
void svndump_deinit(void);
void svndump_reset(void);