From 958dcec41d92e7101490a551b412f46ebd8b6d83 Mon Sep 17 00:00:00 2001 From: Clemens Lang Date: Sat, 24 Oct 2015 21:10:53 +0200 Subject: [PATCH] svn.cpp: Do not call svn_fs_copied_from on delete Deleted paths will not be in the repository in the revision where they were deleted. Calling svn_fs_copied_from() on such a path will return an error and abort operations, which is not what we want here. Fix this by not calling svn_fs_copied_form if the change is a deletion (i.e. change->change_kind == svn_fs_path_change_delete). Failure to do so leads to error messages when exporting a repository: Exporting revision 8 svn: E160013: File not found: revision 8, path '/trunk/base/Tcl/pkgIndex.tcl' Signed-off-by: Clemens Lang --- src/svn.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/svn.cpp b/src/svn.cpp index 0522618..02800bb 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -568,9 +568,13 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change_t *change QString current = QString::fromUtf8(key); // was this copied from somewhere? - svn_revnum_t rev_from; - const char *path_from; - SVN_ERR(svn_fs_copied_from(&rev_from, &path_from, fs_root, key, revpool)); + svn_revnum_t rev_from = SVN_INVALID_REVNUM; + const char *path_from = NULL; + if (change->change_kind != svn_fs_path_change_delete) { + // svn_fs_copied_from would fail on deleted paths, because the path + // obviously no longer exists in the current revision + SVN_ERR(svn_fs_copied_from(&rev_from, &path_from, fs_root, key, revpool)); + } // is this a directory? svn_boolean_t is_dir;