summaryrefslogtreecommitdiff
path: root/vcs-svn
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2010-11-19 18:49:17 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-11-24 14:51:43 -0800
commit5af8fae2df03d1888dbf315da29d1cdaa6214f57 (patch)
tree4aef51ac7f38455d4c8ea139cc86503c4a61ee78 /vcs-svn
parentvcs-svn: Use mark to indicate nodes with included text (diff)
downloadtgif-5af8fae2df03d1888dbf315da29d1cdaa6214f57.tar.xz
vcs-svn: handle_node: Handle deletion case early
Take care of "Node-action: delete" as soon as possible, so we can stop worrying about that case in the rest of the function. Functional change: catch deletion nodes with features that would not apply to them (text, properties, or origin data) and error out for those cases. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'vcs-svn')
-rw-r--r--vcs-svn/svndump.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 844076b669..bc70023073 100644
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
@@ -159,6 +159,13 @@ static void handle_node(void)
if (node_ctx.textLength != LENGTH_UNKNOWN)
mark = next_blob_mark();
+ if (node_ctx.action == NODEACT_DELETE) {
+ if (mark || have_props || node_ctx.srcRev)
+ die("invalid dump: deletion node has "
+ "copyfrom info, text, or properties");
+ return repo_delete(node_ctx.dst);
+ }
+
if (have_props && node_ctx.propLength)
read_props();
@@ -168,9 +175,7 @@ static void handle_node(void)
if (mark && node_ctx.type == REPO_MODE_DIR)
die("invalid dump: directories cannot have text attached");
- if (node_ctx.action == NODEACT_DELETE) {
- repo_delete(node_ctx.dst);
- } else if (node_ctx.action == NODEACT_CHANGE ||
+ if (node_ctx.action == NODEACT_CHANGE ||
node_ctx.action == NODEACT_REPLACE) {
if (node_ctx.action == NODEACT_REPLACE &&
node_ctx.type == REPO_MODE_DIR)