如何更改 svnsync 中的 svn url?
如何更改(重新定位)使用“svnsync init”创建镜像存储库时输入的 subversion url(例如从 #https://whatever
到 svn://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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
同步源 URL 作为 revprop 存储在镜像存储库中。如果在具有镜像存储库的计算机上(我的情况),请使用 svnlook 工具查看并 svnadmin 进行更改:
您将看到镜像所在存储库的 URL目前正在同步。在上面的示例中,主存储库 URL 以 .../foo 结尾。它的末尾可能没有换行符,因此您的 shell 提示符可能会跟随。现在您需要将其放入文件中,因为 svnadmin 使用文件作为输入来更改 revprops。
现在编辑 t.txt 以更改主存储库的 URL。这可能会导致 t.txt 末尾出现换行符,并导致 svnsync 产生模糊/无意义的错误消息。因此,删除它:
请注意,我们现在有了 t2.txt,它是经过清理的文件。然后使用svnadmin将revprop更改为刚刚编辑和清理的文件的内容:
请注意,使用的是t2.txt而不是t.txt。最后,检查您的更改:
您应该看到新的存储库 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:
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.
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:
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:
Note that t2.txt is used not t.txt. Finally, check your changes:
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][~]$.
如果您使用用于运行 svnsync 的帐户,则可以简单地使用:
如果您按照手册中的说明进行操作并添加了一个 pre-rev-props 钩子,该钩子拒绝除了 svnsync 用户之外的所有人更改 rev 属性,这应该可以工作。
If you use the account you use to run svnsync with you can simply use:
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.
Svnsync 将远程存储库 URL 存储在修订属性中存储库镜像的第一个修订版。因此,您可以查看当前在本地镜像上配置的存储库 URL 如下:
这意味着要更改远程存储库 URL,您只需 更改修订属性。例如:
示例输出:
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:
That means for changing the remote repository URL you just have to change the revision property. For example:
Example output: