Mercurial:嫁接vs.记录vs. qrecord.搁置vs.移植vs. dirstate vs.队列 [英] Mercurial: graft vs. record vs. qrecord vs. shelve vs. transplant vs. dirstate vs. queue

查看:180
本文介绍了Mercurial:嫁接vs.记录vs. qrecord.搁置vs.移植vs. dirstate vs.队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mercurial的新手,并且仍然以某种方式参与评估,因此这四个概念对我来说有点令人困惑.有人说它们等同于Git的暂存/索引概念,甚至比Git的暂存/索引概念更好.

I am new to Mercurial and still somehow in the evaluation process, so these four concepts are kind of confusing for me. Some are mentioned to be an equivalent to Git's Staging/Index concept, or some even a better one than Git's Staging.

这四个命令hg grafthg recordhg qrecordhg shelve(和hg transplant)如何工作,但这在

How do the four commands hg graft, hg record, hg qrecord and hg shelve (and hg transplant, but this is explained in Graft vs. Transplant already) compare to each other, and how the concepts of queues and the dirstate? In which use cases is one choosen over the other?

我知道每个人都有帮助页面,但是仍然很难弄清楚每个人的工作,因为VCS通常是我的新话题.

I know there are help pages for each one, but it still is difficult to figure out what each one does as VCS in general is a new topic for me.

推荐答案

Mercurial的设计根本不包括临时区域的概念.也就是说,本地修改和提交之间没有中间状态.

The design of Mercurial simply does not include the concept of a staging area. That is, there is no intermediate state between local modification and commit.

以下是您提到的每个概念的概述:

Here is an overview of each of the concepts you mentioned:

hg graft 等同于 git cherry-pick .它将提交从一个分支复制到另一个分支.此功能的典型用例是将错误修复程序从一个发行分支复制到另一个发行分支.该命令替换了较旧的(现在已过时)的 hg transplant 扩展名.

hg graft is the equivalent of git cherry-pick. It copies a commit from one branch to another. A typical use case for this feature is to copy a bug fix from one release branch to another. This command replaces the older (and now obsolete) hg transplant extension.

hg record hg qrecord

hg record and hg qrecord are similar to git add --patch. They allow you to interactively select hunks for commit. So if you modified several different areas of one file, you could select which areas (i.e. hunks) you actually want to commit and which you want to leave as local modifications.

qrecord仅在启用mq的情况下可用.它提交给mq补丁而不是标准提交.

qrecord is only available if you have mq enabled. It commits to an mq patch rather than a standard commit.

hg shelve dirstate是Mercurial源代码的内部类.它不会暴露给用户.

dirstate is an internal class of of the Mercurial source code. It is not exposed to the user.

Mercurial Queues (也称为mq)可能是最接近的您将到达Mercurial的登台区域.这是Mercurial Wiki的描述:

Mercurial Queues (also know as mq) are probably the closest you will get to a staging area in Mercurial. Here is a description from the Mercurial wiki:

更改将作为提交给Mercurial的补丁进行维护. 提交可以删除或重新排序,并且可以修补基础补丁 根据工作目录中的更改刷新.补丁 目录也可以置于版本控制下,因此您可以 单独的补丁更改历史记录.

Changes are maintained as patches which are committed into Mercurial. Commits can be removed or reordered, and the underlying patch can be refreshed based on changes made in the working directory. The patch directory can also be placed under revision control, so you can have a separate history of changes made to your patches.

mq通常用于完善/返工您正在本地测试但尚未推送到公共场所的提交.某些人还使用它来维护对第三方代码的一组修改.

mq is often used to polish/rework commits that you are testing locally, but have not pushed to a public location. Some people also use it to maintain a set of modifications to 3rd party code.

这篇关于Mercurial:嫁接vs.记录vs. qrecord.搁置vs.移植vs. dirstate vs.队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆