Re: DNS change of users emails

Daniel Sahlberg <[email protected]> Thu, 30 Jul 2026 18:44:36 +0200
Newsgroups gmane.comp.version-control.subversion.user
Message-ID <CAMHy98MH+s3MXLwMD-KL5ncPxLWHyzRTJNBbw=gUOAVf6DRAqA@mail.gmail.com>
--0000000000003b5eac0657d6ca21
Content-Type: text/plain; charset="UTF-8"

Den tors 30 juli 2026 kl 12:32 skrev Sascha Kolb <[email protected]>:

> Hello,
>
> We are planning to change the DNS root
>
> So
>
> [email protected]
>
> Will become
>
> [email protected]
>
> It's there any way to translate that
>
>
> If a user committed before the change as
> [email protected]
>
> Can I instruct SVN to use
> [email protected] for ldap authentication but still commit as
> [email protected] so that the user in the SVN is not altered and
> consistent?
>
> Something like a translation table
>
>
> I did not find much on that.
>
> Thanks a lot for your help.
>
>
If you want to change the svn:author property you can do this in a
pre-commit hook. Something like this will set the author to "sid" on all
woody's commits:
[[[
#!/usr/bin/python

import sys
import svn.fs
import svn.repos

repo = sys.argv[1]
txn_name = sys.argv[2]

repo = svn.core.svn_path_canonicalize(repo)
fs = svn.repos.svn_repos_fs(svn.repos.svn_repos_open(repo))
txn = svn.fs.svn_fs_open_txn(fs, txn_name)
author = svn.fs.svn_fs_txn_prop(txn, b"svn:author")
if author == b"woody":
   svn.fs.svn_fs_change_txn_prop(txn, b"svn:author", b"sid")
exit(0)
]]]

(The translation table is left as an exercise for the reader)

Cheers,
Daniel

--0000000000003b5eac0657d6ca21
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><span style=3D"background-color:transpare=
nt">Den tors 30 juli 2026 kl 12:32 skrev Sascha Kolb &lt;<a href=3D"mailto:=
[email protected]">[email protected]</a>&gt;:</span></div><div clas=
s=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex"><div dir=3D"auto">Hello,=C2=A0<div dir=3D"auto"><br></div><d=
iv dir=3D"auto">We are planning to change the DNS root=C2=A0</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">So</div><div dir=3D"auto"><br></div><=
div dir=3D"auto"><a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a></div><div dir=3D"auto"><br></div><div dir=3D"auto"=
>Will become</div><div dir=3D"auto"><br></div><div dir=3D"auto"><a href=3D"=
mailto:[email protected]" target=3D"_blank">[email protected]</a></di=
v><div dir=3D"auto"><br></div><div dir=3D"auto">It&#39;s there any way to t=
ranslate that</div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">If a user committed before the change as=C2=A0</div><div =
dir=3D"auto"><a href=3D"mailto:[email protected]" target=3D"_blank">myna=
[email protected]</a></div><div dir=3D"auto"><br></div><div dir=3D"auto">Can=
 I instruct SVN to use=C2=A0</div><div dir=3D"auto"><a href=3D"mailto:mynam=
[email protected]" target=3D"_blank">[email protected]</a> for ldap authen=
tication but still commit as</div><div dir=3D"auto"><a href=3D"mailto:mynam=
[email protected]" target=3D"_blank">[email protected]</a> so that the use=
r in the SVN is not altered and consistent?</div><div dir=3D"auto"><br></di=
v><div dir=3D"auto">Something like a translation table</div><div dir=3D"aut=
o"><br></div><div dir=3D"auto"><br></div><div dir=3D"auto">I did not find m=
uch on that.=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto">Thank=
s a lot for your help.=C2=A0</div><div dir=3D"auto"><br></div></div></block=
quote><div><br></div><div>If you want to change the svn:author property you=
 can do this in a pre-commit hook. Something like this will set the author =
to &quot;sid&quot; on all woody&#39;s commits:</div><div>[[[</div><div>#!/u=
sr/bin/python<br><br>import sys<br>import svn.fs<br>import svn.repos<br><br=
>repo =3D sys.argv[1]<br>txn_name =3D sys.argv[2]<br><br>repo =3D svn.core.=
svn_path_canonicalize(repo)<br>fs =3D svn.repos.svn_repos_fs(svn.repos.svn_=
repos_open(repo))<br>txn =3D svn.fs.svn_fs_open_txn(fs, txn_name)<br>author=
 =3D svn.fs.svn_fs_txn_prop(txn, b&quot;svn:author&quot;)<br>if author =3D=
=3D b&quot;woody&quot;:<br>=C2=A0 =C2=A0svn.fs.svn_fs_change_txn_prop(txn, =
b&quot;svn:author&quot;, b&quot;sid&quot;)</div><div>exit(0)</div><div>]]]<=
/div><div><br></div><div>(The translation table is left as an exercise for =
the reader)</div><div><br></div><div>Cheers,</div><div>Daniel</div><div><br=
></div></div></div>

--0000000000003b5eac0657d6ca21--