如何更改 svnsync 中的 svn url?

发布于 2024-10-01 10:03:09 字数 357 浏览 3 评论 0原文

如何更改(重新定位)使用“svnsync init”创建镜像存储库时输入的 subversion url(例如从 #https://whateversvn://whatever)?

尝试使用新的 url 再次运行 svnsync init 但是

svnsync init file:///<path_to_mirror> http:///<new_url>
svnsync: Destination repository is already synchronizing from 'http:///<old_url>'

How can I change (relocate) a subversion url that I entered when creating a mirror repository using "svnsync init" (example from #https://whatever to svn://whatever)?

tried to run svnsync init again with new url but

svnsync init file:///<path_to_mirror> http:///<new_url>
svnsync: Destination repository is already synchronizing from 'http:///<old_url>'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

∞梦里开花 2024-10-08 10:03:09

同步源 URL 作为 revprop 存储在镜像存储库中。如果在具有镜像存储库的计算机上(我的情况),请使用 svnlook 工具查看并 svnadmin 进行更改:

[email protected][~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url
svn+ssh://svn.abc.com:1234/svn/foo

您将看到镜像所在存储库的 URL目前正在同步。在上面的示例中,主存储库 URL 以 .../foo 结尾。它的末尾可能没有换行符,因此您的 shell 提示符可能会跟随。现在您需要将其放入文件中,因为 svnadmin 使用文件作为输入来更改 revprops。

[email protected][~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url > t.txt

现在编辑 t.txt 以更改主存储库的 URL。这可能会导致 t.txt 末尾出现换行符,并导致 svnsync 产生模糊/无意义的错误消息。因此,删除它:

[email protected][~]$ cat t.txt | tr -d '\n' > t2.txt

请注意,我们现在有了 t2.txt,它是经过清理的文件。然后使用svnadmin将revprop更改为刚刚编辑和清理的文件的内容:

[email protected][~]$ svnadmin setrevprop /path/to/mirror/repo -r0 svn:sync-from-url t2.txt

请注意,使用的是t2.txt而不是t.txt。最后,检查您的更改:

[email protected][~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url
svn+ssh://svn.def.com:5678/svn/foo

您应该看到新的存储库 URL 后紧跟 shell 提示符,没有换行符。在上面的示例中,URL 以 foo 结尾,紧接着是 shell 提示符 [email protected ][~]$。

The sync-from URL is stored as a revprop in the mirror repo. If on the machine with the mirror repository (my situation), use the svnlook tool to look and svnadmin to change:

[email protected][~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url
svn+ssh://svn.abc.com:1234/svn/foo

You will see the URL of the repo to which your mirror is currently syncing. In the above example, the master repo URL ends with .../foo. It may not have a newline at the end, so your shell prompt may follow. Now you need to get that into a file as svnadmin uses a file for input to change revprops.

[email protected][~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url > t.txt

Now edit t.txt to change the URL to the master repo. This can cause a newline to appear at the end of t.txt and result in obscure/meaningless error messages from svnsync. So get rid of it:

[email protected][~]$ cat t.txt | tr -d '\n' > t2.txt

Note that we now have t2.txt which is the sanitized file. Then use svnadmin to change the revprop to the contents of the just-edited and sanitized file:

[email protected][~]$ svnadmin setrevprop /path/to/mirror/repo -r0 svn:sync-from-url t2.txt

Note that t2.txt is used not t.txt. Finally, check your changes:

[email protected][~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url
svn+ssh://svn.def.com:5678/svn/foo

You should see your new repo URL immediately followed by the shell prompt, with no newline. In the above example the URL ends in foo and is immediately followed by the shell prompt [email protected][~]$.

温暖的光 2024-10-08 10:03:09

如果您使用用于运行 svnsync 的帐户,则可以简单地使用:

svn propset --revprop -r 0 svn:sync-from-url http://my.new/url url://to.my.repo

如果您按照手册中的说明进行操作并添加了一个 pre-rev-props 钩子,该钩子拒绝除了 svnsync 用户之外的所有人更改 rev 属性,这应该可以工作。

If you use the account you use to run svnsync with you can simply use:

svn propset --revprop -r 0 svn:sync-from-url http://my.new/url url://to.my.repo

If you followed the instructions in the manual and added a pre-rev-props hook that denies everyone but the svnsync user to change the rev props this should work.

少年亿悲伤 2024-10-08 10:03:09

Svnsync 将远程存储库 URL 存储在修订属性中存储库镜像的第一个修订版。因此,您可以查看当前在本地镜像上配置的存储库 URL 如下:

$ svn pg --revprop -r0 svn:sync-from-url file:///path/to/svn-mirror

这意味着要更改远程存储库 URL,您只需 更改修订属性。例如:

$ svn ps --revprop -r0 svn:sync-from-url https://svn.example.org/repo \
         file:///path/to/svn-mirror/

示例输出:

property 'svn:sync-from-url' set on repository revision 0

Svnsync stores the remote repository URL in the revision properties of the first revision of the repository mirror. Thus, you can view the currently configured repository URL on your local mirror like this:

$ svn pg --revprop -r0 svn:sync-from-url file:///path/to/svn-mirror

That means for changing the remote repository URL you just have to change the revision property. For example:

$ svn ps --revprop -r0 svn:sync-from-url https://svn.example.org/repo \
         file:///path/to/svn-mirror/

Example output:

property 'svn:sync-from-url' set on repository revision 0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文