svn dump->通过Windows Powershell重命名路径->与格式错误的转储文件标头斗争 [英] svn dump -> path rename via windows powershell -> struggle with malformed dumpfile header

查看:327
本文介绍了svn dump->通过Windows Powershell重命名路径->与格式错误的转储文件标头斗争的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题说明了一切:)
我想要的是从一个项目中转储一个文件夹并将其存储到另一个项目中。这两个文件夹(src:proj1 / trunk / supplies,dest:extlibs / trunk)都位于同一存储库中。我的问题是,当我加载正常转储文件时,将保留先前文件夹的路径,并将在新位置(extlibs / trunk / proj1 / trunk / supplies)中重新创建该路径。因此,我尝试使用win7 powershell手动更改路径:

  svnrdump dump https:// localghost / svn / test_repo / proj1 / trunk /耗材| \ 
%{$ _ -replace Node-path:proj1, Node-path:extlibs} | \
%{$ _-替换节点路径:extlibs / trunk / supplies,节点路径:extlibs / trunk}} \ \
外文件foo.dmp

或者,我也使用了以下命令行:

  svnadmin dump< local svn dir> | svndumpfilter包括proj1 / trunk / supplies | \ 
%{$ _ -replace Node-path:proj1, Node-path:extlibs} | \
%{$ _-替换节点路径:extlibs / trunk / supplies,节点路径:extlibs / trunk} | \
外文件foo.dmp

但是,当我使用svnadmin load或svnrdump load上传经过路径修改的转储文件时,我收到格式错误的转储文件头错误。如果我手动更改路径,则会收到MD5校验和错误。我真的很困惑如何更改powershell的输出以使转储负载正常工作。我已经尝试过

  .. |外文件-Enc UTF foo.dmp 
.. |外文件-Enc ASCII foo.dmp

你们中的某人知道如何更改转储文件的文件夹路径吗?我的方法正确还是有更好的方法来更改存储库路径? / p>

我知道那里有一些工具,但是我现在不能使用它们,我必须手工做这件事以获得更深入的了解,但是



感谢您的帮助和时间,希望你们中的一个知道如何解决这个问题。问题。

解决方案


  • 不得手动更改转储文件

  • 您必须在转储后使用 svndumpfilter

  • 为了更改从转储文件夹的挂载点,您必须 svnadmin负载中使用-parent-dir 选项 code>



在此处阅读主题 SVN:如何合并来自单独项目的标签和(在答案中链接)使用svndumpfilter在自己的存储库中提取文件夹博客帖子


The title says it all :) What i want is to dump a folder from one project and store it into another. Both folders (src: proj1/trunk/supplies, dest: extlibs/trunk) are in the same repository. My problem is that the when i load the "normal" dumpfile, the previous folder's path is kept and will be recreated at the new location (extlibs/trunk/proj1/trunk/supplies). So i've tried to change the path manually with win7 powershell:

svnrdump dump https://localghost/svn/test_repo/proj1/trunk/supplies |           \ 
% {$_ -replace "Node-path: proj1", "Node-path: extlibs"} |                      \
% {$_ -replace "Node-path: extlibs/trunk/supplies", "Node-path: extlibs/trunk"}|\
Out-File foo.dmp

Alternatively, i also used this command line:

svnadmin dump <local svn dir> | svndumpfilter include proj1/trunk/supplies | \ 
% {$_ -replace "Node-path: proj1", "Node-path: extlibs"} |                   \
% {$_ -replace "Node-path: extlibs/trunk/supplies","Node-path: extlibs/trunk}|\
Out-File foo.dmp

However, when i use svnadmin load or svnrdump load to upload the path-modified dumpfile, i receive "malformed dumpfile header" error. If i change the path manually, i get MD5-checksum errors. I am really confused how to change powershell's output in order to make dump load work. I've tried

.. | Out-File -Enc UTF foo.dmp
.. | Out-File -Enc ASCII foo.dmp

Does someone of you know how to change the dumpfile's folder-path? Is my approach correct or is there a better way to change the repo-path?

I know that there are some tools out there but i can't use them now. I have to do this "by hand" in order to get a deeper understanding, but it seems that i may think too complicated.

Thanks for your help and time. I hope one of you knows how to solve this problem.

解决方案

  • You must not change dump-file by hand
  • You **must* to use svndumpfilter after dumping
  • In order to change "mount-point" of folder from dump, you must to use --parent-dir options in svnadmin load

Read here, on SO, topic SVN: how to merge tags from separate projects and (linked in answer) Using svndumpfilter to extract a folder in it's own repository blog-post

这篇关于svn dump-&gt;通过Windows Powershell重命名路径->与格式错误的转储文件标头斗争的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆