Skip to content

Commit 958dcec

Browse files
committed
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 <neverpanic@gmail.com>
1 parent 268b22f commit 958dcec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/svn.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,13 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change_t *change
568568
QString current = QString::fromUtf8(key);
569569

570570
// was this copied from somewhere?
571-
svn_revnum_t rev_from;
572-
const char *path_from;
573-
SVN_ERR(svn_fs_copied_from(&rev_from, &path_from, fs_root, key, revpool));
571+
svn_revnum_t rev_from = SVN_INVALID_REVNUM;
572+
const char *path_from = NULL;
573+
if (change->change_kind != svn_fs_path_change_delete) {
574+
// svn_fs_copied_from would fail on deleted paths, because the path
575+
// obviously no longer exists in the current revision
576+
SVN_ERR(svn_fs_copied_from(&rev_from, &path_from, fs_root, key, revpool));
577+
}
574578

575579
// is this a directory?
576580
svn_boolean_t is_dir;

0 commit comments

Comments
 (0)