指的是相对于命名修订的水银修订 [英] Refer to a mercurial revision relative to a named revision

查看:89
本文介绍了指的是相对于命名修订的水银修订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在git中,您可以使用master^^之类的东西来引用修订,这意味着在master之前有两个修订.您可以通过某种方式(或通过某种扩展)在Mercurial中执行相同的操作吗?例如,如果我要进行技巧修订",例如tip^.

In git, you can do refer to revisions by something like master^^, meaning two revisions before master. Can you do the same in Mercurial in some way (or with some extension)? For example, if I want to do "the revision before tip", something like tip^.

Rafa提到hg parents可以工作1级.对于任意级别的深度,我该怎么做.

edit: Rafa mentions hg parents which works for 1 level deep. How do I do it for arbitrary levels deep.

推荐答案

对于具有指定修订版本选项的命令,对于提示之前的修订版本,请使用-r -2,对于之前的修订版本,请使用-r -3.

For commands that have options to specify a revision, use -r -2 for the revision prior to the tip, -r -3 for the revision before that, etc.

来自hg help revs:

纯整数被视为修订号.负整数被视为距笔尖的连续偏移量,-1表示笔尖,-2表示笔尖之前的修订版,依此类推.

A plain integer is treated as a revision number. Negative integers are treated as sequential offsets from the tip, with -1 denoting the tip, -2 denoting the revision prior to the tip, and so forth.

还有 ParentrevspecExtension ,它允许您使用诸如tip^这样的父语法提示,tip^^为其父级,等等.

There is also the ParentrevspecExtension that allows you use syntax like: tip^ for the parent of tip, tip^^ for its parent, etc.

这篇关于指的是相对于命名修订的水银修订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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