summaryrefslogtreecommitdiff
path: root/vcs-svn/fast_export.c
diff options
context:
space:
mode:
authorFlorian Achleitner <florian.achleitner.2.6.31@gmail.com>2012-09-19 17:21:25 +0200
committerJunio C Hamano <gitster@pobox.com>2012-10-07 14:10:17 -0700
commita9a55613cb9b92e0dd65f8c4554fd7b562377a6e (patch)
treed70476de9fd58a7635a89c3edb332a3a0c20321c /vcs-svn/fast_export.c
parent3c23953fb220675c1387c8afc23e0cb7c7ed914c (diff)
downloadgit-a9a55613cb9b92e0dd65f8c4554fd7b562377a6e.tar.gz
Create a note for every imported commit containing svn metadata
To provide metadata from svn dumps for further processing, e.g. branch detection, attach a note to each imported commit that stores additional information. The notes are currently hard-coded in refs/notes/svn/revs. Currently the following lines from the svn dump are directly accumulated in the note. This can be refined as needed. - "Revision-number" - "Node-path" - "Node-kind" - "Node-action" - "Node-copyfrom-path" - "Node-copyfrom-rev" 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.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index 1ecae4b6cf..df51c59ca5 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -3,8 +3,7 @@
* See LICENSE for details.
*/
-#include "git-compat-util.h"
-#include "strbuf.h"
+#include "cache.h"
#include "quote.h"
#include "fast_export.h"
#include "repo_tree.h"
@@ -68,6 +67,17 @@ void fast_export_modify(const char *path, uint32_t mode, const char *dataref)
putchar('\n');
}
+void fast_export_begin_note(uint32_t revision, const char *author,
+ const char *log, unsigned long timestamp)
+{
+ size_t loglen = strlen(log);
+ printf("commit refs/notes/svn/revs\n");
+ printf("committer %s <%s@%s> %ld +0000\n", author, author, "local", timestamp);
+ printf("data %"PRIuMAX"\n", (uintmax_t)loglen);
+ fwrite(log, loglen, 1, stdout);
+ fputc('\n', stdout);
+}
+
void fast_export_note(const char *committish, const char *dataref)
{
printf("N %s %s\n", dataref, committish);