summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc56732)
raw | patch | inline | side by side (parent: cc56732)
author | Sverre Rabbelier <srabbelier@gmail.com> | |
Sat, 16 Jul 2011 13:03:36 +0000 (15:03 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 19 Jul 2011 18:17:48 +0000 (11:17 -0700) |
In other words, use fast-export --use-done-feature to add a 'done'
command at the end of streams passed to remote helpers' "import"
commands, and teach the remote helpers implementing "export" to use
the 'done' command in turn when producing their streams.
The trailing \n in the protocol signals the helper that the
connection is about to close, allowing it to do whatever cleanup
neccesary.
Previously, the connection would already be closed by the
time the trailing \n was to be written. Now that the remote-helper
protocol uses the new done command in its fast-import streams, this
is no longer the case and we can safely write the trailing \n.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
command at the end of streams passed to remote helpers' "import"
commands, and teach the remote helpers implementing "export" to use
the 'done' command in turn when producing their streams.
The trailing \n in the protocol signals the helper that the
connection is about to close, allowing it to do whatever cleanup
neccesary.
Previously, the connection would already be closed by the
time the trailing \n was to be written. Now that the remote-helper
protocol uses the new done command in its fast-import streams, this
is no longer the case and we can safely write the trailing \n.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-remote-testgit.py | patch | blob | history | |
transport-helper.c | patch | blob | history |
diff --git a/git-remote-testgit.py b/git-remote-testgit.py
index cdbc49495f3ab51ffd411dd054963d79d161904a..af4d0403536137ae3b203b06a9294fa5661bd179 100644 (file)
--- a/git-remote-testgit.py
+++ b/git-remote-testgit.py
repo = update_local_repo(repo)
repo.exporter.export_repo(repo.gitdir, args)
+ print "done"
+
def do_export(repo, args):
"""Imports a fast-import stream from git to testgit.
diff --git a/transport-helper.c b/transport-helper.c
index e02f4a3e5a1bdbdbd1cfa7a9a1a449e3643485df..4c0d86113ce7d5a2900ab7e548f5a83b4f490346 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
/* we need to duplicate helper->in because we want to use it after
* fastexport is done with it. */
fastexport->out = dup(helper->in);
- fastexport->argv = xcalloc(4 + revlist_args->nr, sizeof(*fastexport->argv));
+ fastexport->argv = xcalloc(5 + revlist_args->nr, sizeof(*fastexport->argv));
fastexport->argv[argc++] = "fast-export";
+ fastexport->argv[argc++] = "--use-done-feature";
if (export_marks)
fastexport->argv[argc++] = export_marks;
if (import_marks)
sendline(data, &buf);
strbuf_reset(&buf);
}
- if (disconnect_helper(transport))
- die("Error while disconnecting helper");
if (finish_command(&fastimport))
die("Error while running fast-import");
-
free(fastimport.argv);
fastimport.argv = NULL;
export_marks, import_marks, &revlist_args))
die("Couldn't run fast-export");
- data->no_disconnect_req = 1;
if (finish_command(&exporter))
die("Error while running fast-export");
- if (disconnect_helper(transport))
- die("Error while disconnecting helper");
return 0;
}