如果其他文件夹中不存在文件,请使用 ANT/SVNANT 从 SVN 工作副本中删除文件
场景:
- SVN Repo #1 具有应用程序代码库
- SVN Repo #2 具有先前编译的里程碑
我需要一个 ANT 构建脚本,它可以执行以下操作:
- 从 SVN repo #1 导出代码库(完成)
- 编译导出的代码库(完成)
- 查看 SVN repo #2 中的代码库(完成)
- 将 SVN repo #1 中编译/导出的代码库与 SVN repo #2 中的工作副本进行比较 一个。如果在 SVN repo #1 中添加了任何文件,则需要将它们添加到工作副本中 b.如果 SVN repo #1 中的任何文件已更新,它们会覆盖工作副本中的内容 c.如果从 SVN 存储库 #2 中删除了任何文件,则需要从工作副本中删除它们
- 将更新的代码库签入 SVN 存储库 #2
第 4 步是我遇到问题的地方。我相信只需将 SVN 存储库 #1 中编译/导出的代码库复制到从 SVN 存储库 #2 签出的工作副本上即可完成 4a 和 4b。我不确定如何区分两个代码库之间的差异来确定哪些文件需要从 SVN 存储库 #2 工作副本中删除。我知道我可以使用 SVNANT delete 来删除文件,但如何构建文件集?
Scenario:
- SVN Repo #1 with application code base
- SVN Repo #2 with previously compiled milestones
I need an ANT build script which can do the following:
- Export the code base from SVN repo #1 (done)
- Compile the exported code base (done)
- Check out the code base from SVN repo #2 (done)
- Compare the compiled/exported code base from SVN repo #1 to the working copy from SVN repo #2
a. If any files have been added in SVN repo #1, they need to be added to the working copy
b. If any files have been updated in SVN repo #1, they overwrite what is in the working copy
c. If any files have been removed from SVN repo #2, they need to be deleted from the working copy - Check in the updated code base into SVN repo #2
Step #4 is where I am running into issues. I believe I can accomplish 4a and 4b by just copying the compiled/exported code base from SVN repo #1 over the working copy that has been checked out from SVN repo #2. I am not sure how do do the diff between the two code bases to determine which files need to be deleted from the SVN repo #2 working copy though. I know I can use SVNANT delete to remove the files, but how do I build the fileset?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也做过类似的任务。在我的例子中,ant 代码看起来像这样
:
I did similar tasks. In my cases ant code looks like that:
where