Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在svnsync中更改svn url?_Svn_Svnsync - Fatal编程技术网

如何在svnsync中更改svn url?

如何在svnsync中更改svn url?,svn,svnsync,Svn,Svnsync,如何更改(重新定位)使用“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 'ht

如何更改(重新定位)使用“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>'
svnsync init文件:///http:///
svnsync:目标存储库已从“http://”进行同步

来自URL的同步将作为revprop存储在镜像repo中。如果在具有镜像存储库的机器上(我的情况),请使用svnlook工具查看,并使用svnadmin更改:

user@q.r[~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url
svn+ssh://svn.abc.com:1234/svn/foo
您将看到镜像当前同步到的回购协议的URL。在上面的示例中,主repo URL以…/foo结尾。它的结尾可能没有换行符,因此您的shell提示可能会随之出现。现在您需要将其放入一个文件中,因为svnadmin使用一个文件作为输入来更改revprops

user@q.r[~]$ svnlook pg --revprop -r0 /path/to/mirror/repo svn:sync-from-url > t.txt
现在编辑t.txt将URL更改为主回购。这可能导致换行符出现在t.txt的末尾,并导致来自svnsync的模糊/无意义的错误消息。所以,摆脱它:

user@q.r[~]$ cat t.txt | tr -d '\n' > t2.txt
请注意,我们现在有了t2.txt,它是经过消毒的文件。然后使用svnadmin将revprop更改为刚刚编辑和清理的文件的内容:

user@q.r[~]$ svnadmin setrevprop /path/to/mirror/repo -r0 svn:sync-from-url t2.txt
注意t2.txt不是t.txt。最后,检查您的更改:

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

您应该立即看到新的repo URL,后跟shell提示符,没有换行符。在上面的示例中,URL以foo结尾,紧接着是shell提示符user@q.r[~]$。

如果您使用用于运行svnsync的帐户,只需使用:

svn propset --revprop -r 0 svn:sync-from-url http://my.new/url url://to.my.repo
如果按照手册中的说明添加了pre-rev props钩子,该钩子拒绝除svnsync用户以外的所有人更改rev props,则应该可以使用。

将远程存储库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与新url一起用于后续同步。我的直觉是它应该可以工作。我尝试过用新的url再次调用svnsync init,但这不起作用-svnsync说镜像存储库与“旧”同步urlI按照此步骤操作,在尝试svnsync sync/repo/path svnsync:Repository UUID“72fa8357-5795-f84a-b72d-10573eb4d6c2”与预期UUID“a3f6904a-36ca-4011-b160-aab731c98da0”修改文件db\revprops\0\0并更改svn:sync from UUID属性时出错。现在一切都好了