hg revert和hg backout有什么区别? [英] What is the difference between hg revert and hg backout?
问题描述
hg revert
和hg backout
都还原以前版本所做的更改.两者有什么区别?
Both hg revert
and hg backout
revert changes made by a former revision. What is the difference between the two?
推荐答案
给出变更集的历史记录:
Given the history of changesets:
A --- B --- C --- D --- E
[bad] (*)
hg revert -r B
:保持当前版本,但更新工作目录
从版本B
开始.它具有撤消更改的补丁程序的作用
C
,D
和E
.
hg revert -r B
: Stay at current revision, but update the working directory
as of revision B
. It has the effect of a patch that revokes the changes
of C
, D
and E
.
hg backout -r C
:更新工作目录,使其包含 merge
版本C的 parent (B
)和当前版本的副本,保留更改
在两个修订版之间进行修改(工作目录仍包含
版本D
和E
).这具有在E
上应用补丁的效果,
撤消仅C
的更改.
hg backout -r C
: Update the working directory so that it contains the merge
of revision C's parent (B
) and the current revision, preserving the changes
made in between the two revisions (working dir still contains changes of
revision D
and E
). This has the effect of a patch applied on E
,
undoing the changes of only C
.
如果不是所有的C
都不好,您可能要编辑一些文件.记得做
hg commit
在任何情况下:
You may want to edit some files if not all of C
was bad. Remember to do
a hg commit
in any case:
A --- B --- C --- D --- E --- F
[bad] (*)
这篇关于hg revert和hg backout有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!