如何使用SVN存储库获取一批文件版本
我有一个构建过程,可以将文件从存储库中复制出来以生成二进制映像。我需要存储库中所有文件的文件修订版以进行构建过程。我知道我可以运行 svn info [filename] 并以这种方式获取文件版本,但我有超过 4k 个文件需要版本信息。
有没有办法全体获取这些版本号,或者我是否需要编写一个 svn 钩子来维护 XML 文件或具有最新版本号的文件?
编辑:我正在寻找的输出是文件夹的修订版 4329,文件修订版列表为: file1.txt = revision 3; file2.txt = 修订版 9; ...我们需要有这个列表,这样当我们更新设备上的固件时,我们只复制他们绝对需要的更改。因此,他们可以跳过两个或三个固件修订版,但因为设备知道它具有 file1.txt 的修订版 3,所以我们不需要更新固件中的该文件,而 file2.txt 在设备上具有修订版 7,并且需要已更新至修订版 9。
希望这有助于使其比以前更清晰。
I have a build process that copies files out of the repository to make a binary image. I need the file revisions for all of the files in the repository for the build process. I know that I can run svn info [filename]
and get the file version that way but I have over 4k files I need version info for.
Is there a way to get these version numbers en masse or do I need to write a svn hook that maintains an XML file or something with the latest version numbers?
EDIT: The output I am looking for would be that for revision 4329 for the folder the list of files revisions are: file1.txt = revision 3; file2.txt = revision 9; ... We need to have this list so when we update the firmware on our devices we only copy the changes they absolutely need. So they can skip two or three firmware revisions, but because the device knows it has revision 3 of file1.txt we don't need to update that file in the firmware vs file2.txt which has revision 7 on the device and would need to be updated to revision 9.
Hope that helps make it more clear than before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我是否理解这个问题 - 您是否想从 SVN 获取给定 revnum 的文件负载(记住每次提交都会增加全局 revnum,而不是为每个文件增加 revnum),那么您只需要指定修订。
因此,如果您签出修订版 x,您将获得当时所有文件的快照。无需确定每个单独文件最后一次更改的转速。
I'm not sure I understand the question - do you want to get a load of files from SVN for a given revnum (remembering that each commit increments a global revnum, not increments a revnum for each file) then you just need to specify the revision.
so if you checkout revision x, you get a snapshot of all the files at that point. There's no need to determine the revnum for the last time each individual file was changed.