如何查看旧版本的 SVN 文件?

发布于 2024-10-03 01:52:23 字数 126 浏览 2 评论 0原文

我有一个 SVN 文件,现在缺少一些逻辑,所以我需要回溯到它具有我需要的逻辑时的大约 40 个修订版。除了尝试在命令行中查看文件的差异(很难阅读)之外,有什么方法可以获取该文件的副本进行查看,以便我可以研究它来恢复部件?

I have an SVN file which is now missing some logic and so I need to go back about 40 revisions to the time when it had the logic I need. Other than trying to view a diff of the file in the command line (very hard to read), is there any way I could get a copy of that file to review so I can study it to recover parts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(6

月下伊人醉 2024-10-10 01:52:23

您可以更新到较旧的版本:

svn update -r 666 file

或者您可以直接查看文件:

svn cat -r 666 file | less

You can update to an older revision:

svn update -r 666 file

Or you can just view the file directly:

svn cat -r 666 file | less
梦开始←不甜 2024-10-10 01:52:23

将当前工作修订版的文件与另一个修订版的相同文件进行比较也很有趣。

您可以执行以下操作:

$ svn diff -r34 file

It is also interesting to compare the file of the current working revision with the same file of another revision.

You can do as follows:

$ svn diff -r34 file
冷夜 2024-10-10 01:52:23

更新到特定修订版:

svn up -r1234 file

Update to a specific revision:

svn up -r1234 file
白色秋天 2024-10-10 01:52:23

我相信查看修订的最佳方式是使用方便您的程序/应用程序。我喜欢使用 trac : http://trac.edgewall.org/wiki/TracSubversion

它提供一个很棒的 svn 浏览器,可以很容易地返回你的修改。

为您想要检查的一个特定修订版进行此设置可能有点过分,但如果您将来要经常这样做,它可能会很有用。

I believe the best way to view revisions is to use a program/app that makes it easy for you. I like to use trac : http://trac.edgewall.org/wiki/TracSubversion

It provides a great svn browser and makes it really easy to go back through your revisions.

It may be a little overkill to set this up for one specific revision you want to check, but it could be useful if you're going to do this a lot in the future.

太阳男子 2024-10-10 01:52:23

直接回答如何“获取该文件的副本”的问题:

svn cat -r 666 file > file_r666

然后您可以使用任何查看器或比较程序查看新创建的file_r666,例如

kompare file_r666 file

很好地显示差异。

我发布了答案,因为接受的答案的命令实际上没有提供文件的副本,并且因为 svn cat -r 666 file | vim 不适用于我的系统 (Vim: 读取输入时出错,退出...)

To directly answer the question of how to "get a copy of that file":

svn cat -r 666 file > file_r666

then you can view the newly created file_r666 with any viewer or comparison program, e.g.

kompare file_r666 file

nicely shows the differences.

I posted the answer because the accepted answer's commands do actually not give a copy of the file and because svn cat -r 666 file | vim does not work with my system (Vim: Error reading input, exiting...)

_失温 2024-10-10 01:52:23

使用最新版本的 Subclipse,您实际上可以在不使用 cmd 提示符的情况下查看它们。在文件上,只需右键单击 =>团队 =>切换到另一个分支/标签/修订。除了修订字段之外,您单击选择,您将看到该文件的所有版本。

Using the latest versions of Subclipse, you can actually view them without using the cmd prompt. On the file, simply right-click => Team => Switch to another branch/tag/revision. Besides the revision field, you click select, and you'll see all the versions of that file.

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