From e3c28fea9dda6d9ee00b3643fa2bdcccf83aae02 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Wed, 24 Jun 2026 10:31:00 +0200 Subject: [PATCH] feat: set svn:author revprop after commit/tag to preserve real author --- svn_mirror/git_to_svn.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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(