diff --git a/svn_mirror/git_to_svn.py b/svn_mirror/git_to_svn.py index 0ba81e5..b4067e7 100644 --- a/svn_mirror/git_to_svn.py +++ b/svn_mirror/git_to_svn.py @@ -407,6 +407,19 @@ def _sync_git_to_svn_impl(mirror: Mirror) -> int: ) new_rev = _parse_commit_revision(result) + # Restore the real author as svn:author revprop + try: + _run_svn( + ["propset", "--revprop", "-r", str(new_rev), + "svn:author", svn_username], + timeout=30, auth_args=auth_args, wc=wc, + ) + except Exception: + logger.warning( + "Could not set svn:author for r%d (pre-revprop-change hook?)", + new_rev, + ) + mirror.db.record_mapping( new_rev, commit_hash, svn_branch, _git_ref_from_branch(svn_branch, svn_cfg), @@ -454,6 +467,20 @@ def _sync_git_to_svn_impl(mirror: Mirror) -> int: ) new_rev = _parse_commit_revision(result) + # Restore the real author as svn:author revprop + try: + svn_root = svn_cfg.url.rstrip("/") + _run_svn( + ["propset", "--revprop", "-r", str(new_rev), + "svn:author", svn_username, svn_root], + timeout=30, auth_args=auth_args, + ) + except Exception: + logger.warning( + "Could not set svn:author for r%d (pre-revprop-change hook?)", + new_rev, + ) + # The commit hash stored for a tag is the target commit hash target = _git(git_dir, "rev-parse", tag_ref, timeout=30) mirror.db.record_mapping(