SVN:如何比较工作副本与存储库修订版?
我只想查看已修改、添加等的文件列表,而不是内容(svn diff
输出该内容),仅查看 之类的文件列表>svn 状态
。
svn diff -r HEAD
转储了大量信息,这些信息很难快速理解。
svn status
仅显示工作副本与其本地原始版本(不与存储库修订版)进行比较的更改。
svn update
不支持 --dry-run
简而言之,我需要类似 svn status
的东西,但是比较当前工作副本与存储库修订版(我将与 HEAD 修订版进行比较)。
我查阅了 SVN 手册,但不幸的是没有任何帮助:-/
I want see only the list of files that have been modified, added, etc., not the content (svn diff
outputs that), only the list of files like svn status
.
svn diff -r HEAD
dumps me tons of information, which is hard to understand quickly.
svn status
shows only the changes comparing the working copy with its local original version (not with the repository revision).
svn update
does not support --dry-run
Briefly, I need something like svn status
, but what compares the current working copy with the repository revision (I'm going to compare with a HEAD revision).
I looked through the SVN manual, but nothing helped to me, unfortunately :-/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尝试
使用
svn status
的-u
(或--show-updates
)选项使 svn 联系存储库并显示在存储库 - 这对你来说足够了吗?根据您的需要,您可能还需要-q
或--verbose
标志Try
The
-u
(or--show-updates
) option tosvn status
causes svn to contact the repository and show stuff that's changed in the repository - is that enough for you ? Depending on what you need, you might want the-q
or--verbose
flag too这将为工作副本和存储库之间存在差异的所有文件生成一个
diff
列表,给出文件列表和实际更改。正如你所说,这可能很难理解。所以试试这个:
这做同样的事情,但使用
meld
显示更改(您可以在您的武器库中提供任何其他视觉差异工具),这更易于管理。但说真的,要习惯阅读这些 diff 输出,因为它们构成了许多其他东西(例如补丁)的基础,并且在 Linux 世界中很难避免。为了减少输出:
将为您提供已修改文件的列表,然后:
将为您提供您感兴趣的特定文件的视觉差异。
This will produce a
diff
listing for all files which differ between the working copy and the repository, giving a list of files and the actual changes. Which, as you say, can be hard to understand.So try this:
This dos the same thing, but displays the changes using
meld
(you can provide any other visual diff tool in your arsenal), which is a lot more manageable.But seriously, get used to reading those diff outputs, as they form the basis for so many other things (for example, patches) and are pretty hard to avoid in the Linux world. To cut down on the output:
will give you a list of modified files, then:
will give you a visual difference of just the particular file you are interested in.
按照您提出原始问题的方式,正确的答案是 svn status -u ,如已经给出的那样。根据后续评论,您还应该了解 svn diff --summarize,因为这可能就是您正在寻找的内容。您可以使用它来比较两个存储库修订版或两个标签或存储库中的其他内容。您不能使用此选项将工作副本与存储库进行比较(状态可以做到这一点)。
请参阅:http://blogs.collab.net/subversion/2007/03/computing_the_d/
The way you worded the original question, the right answer is svn status -u as given already. Based on followup comments, you should also be aware of svn diff --summarize as this might be what you are looking for. This is what you would use to compare two repository revisions or two tags or something else in the repository. You cannot use this option to compare your working copy with the repository (status does that).
See: http://blogs.collab.net/subversion/2007/03/computing_the_d/
这就是我所做的,它解决了我的问题:我想看看我的工作副本和存储库副本之间有什么不同。
然后我在 SublimeText 2 中提取了纯文本文件,这样我就可以更轻松地阅读它。我猜这是非常基本的东西,但我想我会发布它,因为它帮助我解决了类似的问题。
Here's what I did, and it solved my problem: I want to see what's different between my working copy and the repo's copy.
And then I pulled up the plaintext file in SublimeText 2 so I could read it easier. Guess this is pretty basic stuff, but thought I'd post it since it helped me with a similar issue.
这可能就是您正在寻找的:
This may be what you are looking for:
操作:
像OP一样,我想看到项目分支的当前工作副本的“svn状态”样式报告,这些分支嵌套在更大的svn存储库下,并针对其最新的主干,并且我想使用与svn diff使用的相同的路径和修订参数。
以下内容就是这样做的:
当然,将“pathToTrunk”替换为存储库使用的实际路径。
op:
Like the OP, I want to see an "svn status" style report of the current working copy for project branches that are nested below a larger svn repository against their latest trunk and I want to use the same path and revision arguments that svn diff uses.
The following does that:
Of course, replace "pathToTrunk" to the actual path your repository uses.