在Mercurial中回退多个变更集的最佳方法是什么?

编程入门 行业动态 更新时间:2024-10-27 16:33:42
本文介绍了在Mercurial中回退多个变更集的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是对每个变更集使用backout命令进行逐一处理的最可靠方法,或者是否有办法创建一个大的反转变更集以覆盖整个 [edit:non -contiguous] 变更集.

Is the most reliable method to go one-by-one, using the backout command for each of many changesets, or is there a way to create one big reversal changeset to cover a whole bunch of [edit: non-contiguous] changesets.

如果一对一,顺序重要吗? (应该倒数第一吗?)

If one-by-one, does order matter? (Should one go last-to-first?)

如果在此过程中不同子项目之间存在合并,最好的方法是否有所不同?

Does the best method differ if there are merges among different sub-projects along the way?

在您的体验中,这种做法是否会顺利进行? :-)

Does this tend to go smoothly in your experience? :-)

推荐答案

rebase有--collapse选项.

Helgi 的答案可以升级为:

1 -- A -- 2 -- B -- 3 -- C -- 4 -- 5 \ C' -- B' -- A' $ hg update --clean C $ hg backout --rev C --message "Backed out changeset: C" $ hg backout --rev B $ hg commit --message "Backed out changeset: B" $ hg backout --rev A $ hg commit --message "Backed out changeset: A" $ hg rebase --collapse --source C' --dest 5 $ hg commit --message "Backed out C, B, A"

这将导致以下结果

1 -- A -- 2 -- B -- 3 -- C -- 4 -- 5 -- C'B'A'

但是,在单独的分支中退出可能会导致后续合并中的 [逻辑] 冲突.

However, backing out in separate branch may result in [logical] conflict in the subsequent merge.

1 -- A -- 2 -- B -- 3 -- X -- 4 \ \ B' -- A' -- M

如果X依赖于A或B,则M将具有冲突(至少是逻辑冲突).

if X depends on A or B, then M will have conflict (at least logical conflict).

更多推荐

在Mercurial中回退多个变更集的最佳方法是什么?

本文发布于:2023-11-08 11:48:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569288.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   方法   Mercurial   中回退

发布评论

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

>www.elefans.com

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