SVN 对已删除目录中的文件进行日志/比较
在我的项目中,另一个开发人员重新组织了一些文件,现在我在获取它们的差异时遇到了一些问题:-(我开始认为让 webSVN 能够显示这些差异会很好,现在我' 我只是希望能够亲自看到它们!
我知道“svn 方式”是将删除视为对父目录的操作,但文件位于子目录中这一事实使我的问题变得更加复杂。 这就是发生的
原始结构:
conf/
files/
configfile1
configfile2
事情:
$ svn log -vr 5
...
D /conf/files
A /conf/combined_configfile
我想要得到的是删除发生之前在配置文件中引入的更改的差异,这样的事情会很好:
svn diff -r 2:4 conf/files/configfile1
svn: 'conf/files' is not a working copy
svn: 'conf/files' does not exist
或者甚至:
svn diff -r 2:4 'conf/files'
svn: 'conf/files' is not under version control
或者怎么样:
svn diff -r 2:4 'https://svnhost.localdomain/project1/conf/files'
svn: '/proj1/!svn/bc/1343/conf/files' path not found
看起来。就像获取此历史记录的唯一方法是通过对当前存在于存储库的 head 版本中的目录进行 svn 操作(在本例中为 conf/
),
这无疑 会极大地扩大差异的范围。一定有更好的办法吗?
In my project another dev reorganised some files, and now I'm having some issues getting at the diffs of them :-( I started out thinking that it'd be nice to get webSVN to be able to show these diffs, now I'd just like to be able to see them myself!
I know that the 'svn way' is to treat deletion as an operation on the parent directory, but my problem is compounded by the fact that the files were in a subdirectory, which has been deleted.
Original structure:
conf/
files/
configfile1
configfile2
Here's what happened:
$ svn log -vr 5
...
D /conf/files
A /conf/combined_configfile
What I'm trying to get is a diff of the changes previously introduced in the config files, before the delete happened. Something like this would be nice:
svn diff -r 2:4 conf/files/configfile1
svn: 'conf/files' is not a working copy
svn: 'conf/files' does not exist
or even:
svn diff -r 2:4 'conf/files'
svn: 'conf/files' is not under version control
or how about:
svn diff -r 2:4 'https://svnhost.localdomain/project1/conf/files'
svn: '/proj1/!svn/bc/1343/conf/files' path not found
It seems like the only way to get at this history is through svn operations on a directory that's currently present in the head revision of the repository (conf/
in this case), widening the scope of the diff massively.
Surely there must be a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
svn diff
有多种使用形式,其中一种是
当项目的目录结构发生更改时比
-r
选项更好。试试这个:svn diff
has several forms of usageone if them is
It's better than
-r
option when directory structure of the project is changed. Try this:为什么不从以前的版本中获取您关心的文件的副本,然后获取您想要对比的最新文件,然后利用众多开源差异程序...TortiseSVN(也将其作为 SVN 存储库的 UI)、WinMerge 等...
不要被迫使用 CVN CLI 进行差异化,请使用任何可用的工具。只要您可以访问以前的版本,这应该不是问题。
Why not get a copy of the files you care about from the previous version, then get your latest ones you want to dioff against, then make use of numerous open source differencing programs out there...TortiseSVN (make it your UI to the SVN repo as well), WinMerge, etc...
Don't feel forced into using the CVN CLI for your differencing, make use of any and all tools available. As long as you can get access to the previous versions, this should not be a problem.