AnkhSvn 撤消/恢复提交

发布于 2024-10-12 06:58:00 字数 235 浏览 8 评论 0原文

如何使用 AnkhSvn/VS 2010 撤消/恢复已提交的更改。 (我很清楚你不能“删除”颠覆存储库中的内容)。

问题很简单, 您正在开发 HEAD(例如 rev 100)。你发现有东西坏了。您查看历史记录,发现版本 93 可能是问题所在。您想要恢复在修订版 93 中完成的更改、测试并提交这些恢复的更改。

虽然我知道如何使用命令行来“撤消”此操作,但如何在 Visual Studio 中使用 AnkSvn 执行此操作?

How do I undo/revert a change I've commited, with AnkhSvn/VS 2010.
(I'm well aware you can't "delete" stuff in the subversion repository).

The issue is simple,
You're working on HEAD(e.g. rev 100). You figure out something is broken. You view the history, and figure out rev 93 might be the issue. You want to revert the change done in rev 93, test, and commit those reverted changes.

While I know how to resort to the command line to "undo" this, How do you do this with AnkSvn from within Visual Studio ?

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

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

发布评论

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

评论(3

将军与妓 2024-10-19 06:58:00

转到历史记录查看器(右键单击解决方案 -> 查看解决方案历史记录),在此处右键单击修订(或选择的修订),然后使用上下文菜单中的项目撤消更改。

Go to the history viewer (Right-click solution -> View Solution history), here right-click on a revision (or a selection of revisions), and use the items in the context menu to undo your changes.

我使用以下过程:
当解决方案在主干 HEAD 上运行并且没有本地文件时,右键单击解决方案,转到 Subversion -> >合并

将弹出合并向导。

在第一页上选择“合并两个不同的树”

在第二页上,您希望“From”成为 HEAD(最新版本),“To”成为要回滚到的特定修订版(OP 情况下为 93)并使用“发件人”URL。

在第三页上,对于文本和二进制冲突,我选择了“提示我每个冲突”。我将深度作为“工作副本”,并保留“忽略祖先”和“允许未版本控制的障碍”。

在最终的“合并摘要”页面上,首先执行试运行,检查更改是否正确。然后运行合并。

最后,将更改提交到主干。

I use the following process:
With the solution working on the trunk HEAD and with no local files, right click the Solution, go Subversion -> merge

The Merge Wizard will pop up.

On the first page select 'Merge two different trees'

On the second page you want the 'From' to be the HEAD (Latest Version) and 'To' to be the specific revision to roll back to (93 in OP case) and using the 'From' URL.

On the third page, for text and binary conflicts I have 'prompt me for each' selected. I have depth as 'working copy' and leave 'Ignore ancestry' and 'allow unversioned obstructions' unchecked.

On the final Merge Summary page perform a dry-run first, check to see that the changes look correct. Then run the merge.

Finally, commit the changes to the trunk.

好多鱼好多余 2024-10-19 06:58:00

当我更新到特定版本时,AnkhSVN 无法工作,我不断收到一条错误消息:“请更新过时的项目,然后重试提交”。经过一番尝试和错误后,我弄清楚了如何使用命令恢复到此修订版本来撤消已提交的文件。

举例来说,您的版本为 4440,并且您希望将 4435 作为新的头。使用恢复到此修订版放弃所选修订版之后的所有更改。

如何使先前提交的版本成为新的 HEAD 修订版

注意:您可能想要恢复整个解决方案,但保留在“未完成”修订版中所做的一些更改。如果在恢复之前出现这种情况,您可以:将较新的文件复制到临时位置,进行恢复,然后将它们复制回来以恢复所有内容,但将一些更改保留在所需状态。

以下是如何使用 ANKH 和 Tortoise 来撤消/恢复已提交的更改

ANKH

在 Visual Studio 中打开解决方案后,右键单击上下文菜单(这可以是解决方案、项目或任何特定文件)> 查看历史记录 > 选择修订版本 > 上下文菜单 > 恢复到此修订版

ToirtoiseSVN

在文件资源管理器中右键单击文件或文件夹(如果您想要进行批量撤消,这甚至可以是顶部文件夹):显示登录以显示修订版本列表,选择一个修订版本,然后选择上下文菜单恢复到此修订版本 。然后在顶级文件夹级别执行“Commit”,所有项目都将被还原。

AnkhSVN wasn't working when I did Update to a Specific Version, I kept getting an error message about "please update the out of date items and then retry commit". After some trial and error I figured out how to undo a committed file using the command Revert to this revision.

Say for example you are at revision 4440 and you want to make 4435 the new head. Use Revert to this revision to discard all changes after the selected revision.

How to make a prior committed version the new HEAD revision

NOTE: You may want to revert an entire a solution, but keep a couple changes made in the "un-done" revisions. If that's the case before you revert you could: copy out the newer files to a temporary location, do the revert, then copied them back in to revert everything but keep a few changed at the desired state.

Below is how to undo/revert a committed change with both ANKH and Tortoise.

ANKH

With solution open in Visual Studio, Right click context menu (this can be a Solution, Project, or any specific file) > View History > Select revision > context menu > Revert to this Revision.

ToirtoiseSVN

In file explorer right click on the file or folder (this could even be the top folder if you want to do a mass undo): Show Log to display a list of revisions, select a revision, then select Context MenuRevert to this revision. Then at the top folder level do Commit, and all of the items will be reverted.

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