SVN:如何比较工作副本与存储库修订版?

发布于 2024-10-16 02:08:36 字数 425 浏览 1 评论 0原文

我只想查看已修改、添加等的文件列表,而不是内容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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

萌︼了一个春 2024-10-23 02:08:36

尝试

svn status --show-updates

使用 svn status-u (或 --show-updates)选项使 svn 联系存储库并显示在存储库 - 这对你来说足够了吗?根据您的需要,您可能还需要 -q--verbose 标志

Try

svn status --show-updates

The -u (or --show-updates) option to svn 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

那伤。 2024-10-23 02:08:36
svn diff -r head

这将为工作副本和存储库之间存在差异的所有文件生成一个 diff 列表,给出文件列表和实际更改。正如你所说,这可能很难理解。

所以试试这个:

svn diff -r head --diff-cmd meld

这做同样的事情,但使用 meld 显示更改(您可以在您的武器库中提供任何其他视觉差异工具),这更易于管理。

但说真的,要习惯阅读这些 diff 输出,因为它们构成了许多其他东西(例如补丁)的基础,并且在 Linux 世界中很难避免。为了减少输出:

svn status -u 

将为您提供已修改文件的列表,然后:

svn diff <file> -r head --diff-cmd <tool>

将为您提供您感兴趣的特定文件的视觉差异。

svn diff -r head

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:

svn diff -r head --diff-cmd meld

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:

svn status -u 

will give you a list of modified files, then:

svn diff <file> -r head --diff-cmd <tool>

will give you a visual difference of just the particular file you are interested in.

谁与争疯 2024-10-23 02:08:36

按照您提出原始问题的方式,正确的答案是 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/

神经大条 2024-10-23 02:08:36

这就是我所做的,它解决了我的问题:我想看看我的工作副本和存储库副本之间有什么不同。

svn diff > ~/svndiff.txt

然后我在 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.

svn diff > ~/svndiff.txt

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.

妳是的陽光 2024-10-23 02:08:36

这可能就是您正在寻找的:

svn diff -r HEAD --summarize

This may be what you are looking for:

svn diff -r HEAD --summarize

回忆那么伤 2024-10-23 02:08:36

操作:

我只想查看已修改、添加等的文件列表,而不是内容(svn diff 输出),仅查看 svn status 等文件列表。

像OP一样,我想看到项目分支的当前工作副本的“svn状态”样式报告,这些分支嵌套在更大的svn存储库下,并针对其最新的主干,并且我想使用与svn diff使用的相同的路径和修订参数。

以下内容就是这样做的:

svn diff --old . --new ^/pathToProject/trunk --summarize

当然,将“pathToTrunk”替换为存储库使用的实际路径。

op:

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.

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:

svn diff --old . --new ^/pathToProject/trunk --summarize

Of course, replace "pathToTrunk" to the actual path your repository uses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文