diff --git a/svn_mirror/git_to_svn.py b/svn_mirror/git_to_svn.py index 060a160..6399fe2 100644 --- a/svn_mirror/git_to_svn.py +++ b/svn_mirror/git_to_svn.py @@ -500,7 +500,28 @@ def _sync_git_to_svn_impl(mirror: Mirror) -> int: input=message.encode("utf-8"), wc=wc, timeout=120, auth_args=auth_args, ) - new_rev = _parse_commit_revision(result) + try: + new_rev = _parse_commit_revision(result) + except GitToSVNError: + logger.warning( + "svn commit no-op for %s on %s – recording HEAD", + commit_hash[:8], svn_branch, + ) + info = subprocess.run( + ["svnversion", str(wc)], + capture_output=True, text=True, timeout=30, + env={**os.environ, "LC_ALL": "C"}, + ) + rev_text = (info.stdout or "").strip().split(":")[0] + try: + new_rev = int(rev_text) + except (ValueError, TypeError): + logger.warning( + "Cannot determine current SVN revision for %s – " + "skipping mapping", + svn_branch, + ) + continue # Restore the real author as svn:author revprop try: