是否可以在SVN中粘贴历史记录?(Is it possible to glue history in SVN?)

编程入门 行业动态 更新时间:2024-10-28 09:22:37
是否可以在SVN中粘贴历史记录?(Is it possible to glue history in SVN?)

我们有一个文件OLD_FILE,历史很长~100次修订。

然后从存储库中删除了此文件。 并创建了内容为OLD_FILE的新文件NEW_FILE。 不要问我 - 为什么文件不只是重命名;)

然后NEW_FILE改变了5次。 然后使用svn将NEW_FILE重命名为OLD_FILE。

现在,如果我们尝试查看OLD_FILE的历史记录 - 我们只会看到与NEW_FILE相关的最后5个修订版。 但是我们从第一个OLD_FILE的历史中看不到很多修改。

是否可以修复存储库以查看OLD_FILE(~100个修订版)和NEW_FILE(5个修订版)的所有修订版本? 我想使用命令svn lof -q OLD_FILE查看所有这些修订

BTW当我尝试从TortoiseSVN调用“显示日志”时,我可以看到下一个对话框:


下线?

连接服务器时出现问题。 您想要查看缓存的数据吗?

请理解,由于历史记录不完整,缓存的数据可能已过时,不完整甚至误导。

现在离线。 永久离线。 不要下线


然后我可以看到第一个OLD_FILE的所有100个修订版。

这是什么意思?

We had a file OLD_FILE with very long history ~ 100 revisions.

Then this file was removed from repository. And new file NEW_FILE with content of OLD_FILE was created. Don't ask me - why file was not just renamed ;)

Then NEW_FILE was changed 5 times. And then NEW_FILE was renamed to OLD_FILE using svn.

Now if we try to see history for OLD_FILE - we see only last 5 revisions related to NEW_FILE. But we do not see a lot of revisions from first OLD_FILE's history.

Is it possible to fix repository in order to see all revisions both for OLD_FILE(~100 revisions) and NEW_FILE(5 revisions)? I would like to see all these revisions using command svn lof -q OLD_FILE

BTW When I try to call "Show Log" from TortoiseSVN I can see next dialog:


Go offline?

There has been a problem connecting the server. Do you want to see the cached data instead?

Please understand that the cached data may be outdated, incomplete or even misleading due to incomplete history.

Offline for Now. Permanently offline. Don't go offline


And then I can see all 100 revisions for first OLD_FILE.

What does it mean?

最满意答案

最简洁的答案是不。

但是,如果日期,修订号和相对于NEW_FILE更改的其他更改的顺序不重要,您可以:

恢复旧修订历史记录:

svn rm OLD_FILE svn copy -r when_old_was_gone OLD_FILE OLD_FILE

使用对NEW_FILE的所有更改的svn diff填充新文件历史记录, 应用修补程序并提交 。 您必须分别对每个更改进行diff,patch和commit。

另一种解决方法是使用tortoise svn检索所有修订的日志,并按路径过滤 。 将选择相同路径的所有更改。

The short answer is no.

But if the dates, revision numberss and relative order to other changes of the NEW_FILE changes are not significant, you could:

Restore the old revision history:

svn rm OLD_FILE svn copy -r when_old_was_gone OLD_FILE OLD_FILE

Fill the new file history with svn diff of all changes to NEW_FILE, apply the patch and commit. You have to diff, patch, commit for every change separately.

Another workaround is to retrieve the log for all revisions with tortoise svn and filter by path. All changes of the same path will be selected.

更多推荐

本文发布于:2023-07-20 12:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1199609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:历史记录   SVN   history   glue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!