Mercurial会自动将$ Id $转换为Subversion做什么吗? [英] Will Mercurial automatically convert $Id$ to what Subversion does?

查看:77
本文介绍了Mercurial会自动将$ Id $转换为Subversion做什么吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Mercurial默认情况下是否将$ Id $转换为Subversion的等价物,如下所示:test.php 110 2009-04-28 05:20:41Z dordal $.有人知道吗?

I am wondering if Mercurial by default converts $Id$ to the equivalent of Subversion which is something like this: test.php 110 2009-04-28 05:20:41Z dordal $. Does anyone know?

推荐答案

否,不会,但是您可以启用它.

https://web.archive.org/web/20121007024058/
https://www.mercurial-scm.org/wiki/KeywordPlan

为什么不需要它

Mercurial的核心不支持关键字扩展,因为它在现代系统中用途有限,并且从性能和二进制完整性的角度来看都是有问题的.对于大多数人来说,可以简单地要求版本控制系统.对于无法使用版本控制系统的情况,该标签很可能是不正确的!

Keyword expansion is not supported in the core of Mercurial because it's of limited utility in a modern system and it's problematic from performance and binary integrity standpoints. For most human uses, one can simply ask the revision control system. And for situations where the revision control system is not available, the tag is very likely to be incorrect!

剩下的一种常见用途是将版本信息自动集成到软件版本中.通过在Makefile中执行以下操作,无需关键词替换就可以轻松完成此操作:

One common use that remains is automatically integrating version information into a software build. This is pretty easily accomplished without keyword substitution by doing something like the following in your Makefile:

...

基本仿真

如果这还不足以满足您的需求,则可以使用扩展程序模拟此行为.

If that's not enough for you, it is possible to emulate this behavior with an extension.

...

附加了提供$ Author $和$ Date $关键字的示例扩展(keyword.py)

An example extension that provides $Author$ and $Date$ keywords is attached (keyword.py)

另请参见关键字扩展.


https://www.mercurial-scm.org/wiki/KeywordExtension

关键字扩展

此扩展程序与Mercurial一起分发

This extension is distributed with Mercurial

概述

此扩展名允许在由Mercurial跟踪的文本文件中扩展类似于RCS/CVS的键和用户定义的键.在工作目录中或/和使用"hg存档"创建发行版时进行扩展.

This extension allows the expansion of RCS/CVS-like and user defined keys in text files tracked by Mercurial. Expansion takes place in the working directory or/and when creating a distribution using "hg archive".

关键字扩展到与每个文件的工作目录父目录相关的最新更改的变更集数据.

Keywords expand to the changeset data pertaining to the latest change relative to the working directory parent of each file.

如果只想对整个仓库进行版本控制,请不要使用此扩展名,而应由构建系统来处理.类似于...

、、

出于速度和安全性的考虑(避免无意扩展关键字),建议仅在repo/.hg/hgrc中启用每个repo的扩展名,而不是在全局中启用,并微调[keyword]文件名模式时要格外小心.

For speed and security reasons (avoidance of inadvertently expanded keywords) it is recommended to enable the extension per repo only in repo/.hg/hgrc, not globally, and to fine tune the [keyword] filename patterns with great care.

这篇关于Mercurial会自动将$ Id $转换为Subversion做什么吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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