如何限制svn保存的历史记录数量?

发布于 2024-08-29 19:43:32 字数 329 浏览 4 评论 0原文

例如,我只想要某个分支或项目的 3 条记录。

非常感谢!

更新: 谢谢你们的回答。 也许这不是一个好问题。我有一个框架存储库和几个引用该框架的项目。我通常会继续做一个项目,有时我需要更新框架。但是,我不想因为框架的更新而影响任何其他项目,尽管我可能没有时间针对框架的更改来更新每个项目。所以我考虑的解决方案是检查每个项目中的框架.dll,以便每个项目都可以缓存一个版本的dll并且它们不会破坏。但是,我不希望我的 svn 保留大量 dll 签入,所以我提出了上面的问题...... 我只是想我应该在每个项目中保留一份框架源代码而不是 dll。一旦我决定使用更新的框架,我就可以合并每个项目的框架副本。听起来更好。

For example, I only want 3 records of a certain branch or item.

Thank you very much!

Update:
Thanks for you guys' answer.
Maybe it is not a good question. I have one framework repo and several projects referencing the framework. I usually keep working on one project and sometimes I need to update the framework. However, I don't want to affect any other projects because of my updates of framework, although I may not have time to update each project agains the framework changes. So the solution I considered was to chech in the framework .dlls in each projects so that every projects can cache a version of dlls and they won't break. However, I don't want my svn to keep a lot of dll checkins, so I come up with the above question.....
I just thought I should probably keep a copy of framework source code in each project instead of dlls. Once I decided to use updated framework, I can do a merge to each project's copy of framework. That sounds better.

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

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

发布评论

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

评论(4

陌伤浅笑 2024-09-05 19:43:32

根据您的更新,您应该查看 svn:externals 以从它将使用框架(dll 或可能是源代码)的每个项目中引用框架区域。另一方面,您可以存储二进制文件,SVN 也会使用增量文件。所以应该不是空间的问题。

Based on your update you should take a look for svn:externals to make a reference to the framework area from every project it will use the framework (dll or may be source code). On the other hand you can store binaries and SVN will use deltas as well. So it should't be a problem of space.

别再吹冷风 2024-09-05 19:43:32

不幸的是没有。 SVN 被设计为一座信息堡垒。您不能将其限制为 x 次修订。

这也是为什么您不能完全或轻松地从 SVN 中完全删除任何内容的原因。他们希望推出 obliterate 命令来处理不必转储存储库即可删除某些内容的情况(例如从存储库中完全删除),但它已经进行了相当长一段时间了。请查看此处更多信息

Unfortunately not. SVN is designed to be a fortress of information. You cannot limit it to x amount of revisions.

This is also the reason why you cannot entirely, or with ease delete anything from SVN completely. They are looking to bring out the obliterate command to deal with not having to dump your repository to delete something (as in delete completely from the repo), but it has been in the works for quite some time. Have a look here for more information.

荒岛晴空 2024-09-05 19:43:32

SVN 没有任何内置方法来执行此操作,但是如果您确实想要(不确定为什么会这样做),您可以定期运行以下命令(在本示例中,我假设您的 HEAD 版本为 200,因此之前的 3 是 197) :

svnadmin dump /path/to/repo -r196:200 > svn.dump
rm -rf /path/to/repo
svnadmin create /path/to/repo
svnadmin load /path/to/repo < svn.dump

这将执行整个存储库,您不能对单个项目执行此操作。

SVN doesn't have any inbuilt way to do this, however if you really want to (not sure why you would) you can run the following periodically (in this example I assume your HEAD is at revision 200, thus 3 before is 197):

svnadmin dump /path/to/repo -r196:200 > svn.dump
rm -rf /path/to/repo
svnadmin create /path/to/repo
svnadmin load /path/to/repo < svn.dump

This will do the entire repository, you can't do it on individual items.

一身仙ぐ女味 2024-09-05 19:43:32

您可以使用 svndumpfilter 从存储库转储中删除特定项目。

You can use svndumpfilter to remove specific items from a repository dump.

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