fix: handle empty svn commit output (no-op) gracefully

This commit is contained in:
2026-07-16 16:10:32 +02:00
parent daa8ebcc39
commit 6c413b6191
+22 -1
View File
@@ -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: