robocopy命令
我正在使用 robocopy 的 /MIR 命令将源文件从 MKS 沙箱复制到 SVN 工作副本,然后提交到 svn 存储库。需要此过程是因为我们正在将源代码控制工具从 MKS 更改为 Subversion。
set mks_path=C:\test
robocopy "C:\test" "C:\testsvn\Source" /MIR /XD "%MKS_PATH%\bin" "%MKS_PATH%\obj" /XF "%MKS_PATH%\project.pj" >>%log%
现在的问题是 1) 我无法使用 robocopy \mir 命令,因为 robocopy /MIR 命令会删除目标目录中不再位于源目录中的文件/文件夹。 它从 SVN 工作副本中删除所有 .svn 目录,之后,除了 svn checkout 之外,我们无法执行任何命令。 2)我需要在MKS_path中递归地过滤一些文件和文件夹,我使用/XF和/XD,但它从顶层过滤这些文件和文件夹。
请建议我如何将 mks 源代码递归复制到 SVN 路径(不包括文件和文件夹)。
Iam using robocopy's /MIR command to copy the source files from MKS sandbox to SVN working copy and then iam committing to svn repository.this process is needed becasue we are in the process of changing the source control tool from MKS to Subversion.
set mks_path=C:\test
robocopy "C:\test" "C:\testsvn\Source" /MIR /XD "%MKS_PATH%\bin" "%MKS_PATH%\obj" /XF "%MKS_PATH%\project.pj" >>%log%
Now the issue is 1) i cant use robocopy \mir command because robocopy /MIR commad erases files/folders in the destination directory that are no longer in the source directory.
It deletes all the .svn directory from the SVN working copy, after wards, we cant execute any commands apart from svn checkout.
2) I need to filter few files and folders recursively in the MKS_path, i used /XF and /XD, but its filtering those files and folders from top level.
Please suggest me how can i copy the mks source code to SVN path excluding the files and folders recursively.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过使用 xxcopy 还有一个名为 Richcopy 的工具也不错对于这种事情。
Have you tried using xxcopy also a tool called Richcopy is good for this sort of thing.
如果您使用 TortoiseSVN,您可以使用
只需使用鼠标右键(即右键单击拖动)拖动包含要复制的文件的文件夹,然后从出现的上下文菜单中选择“此处的供应商分支”。然后您需要做的就是提交更改。
此功能旨在跟踪您自己的存储库中的第 3 方库,但从概念上讲,这基本上就是您正在做的事情:您正在跟踪 SVN 存储库中文件夹内“MKS”的更改。
If you use TortoiseSVN, you can accomplish a "copy from outside the working copy and remove any missing files" action using the vendor branch here feature.
Simply drag the folder containing the files you want to copy over using the right mouse button (i.e. right-click drag) and from the resulting context menu choose "vendor branch here". Then all you need to do is commit the changes.
This feature is intended to track 3rd-party libraries inside your own repository, but conceptually that's basically what you're doing: you're tracking changes in "MKS" inside a folder in your SVN repository.
/MIR 只是 /E 和 /PURGE 的组合。
为什么不简单地使用 /E 并省略 /MIR?
/MIR is just the combination of /E and /PURGE.
Why not simply use /E and leave out /MIR?