gpt4 book ai didi

mercurial - Mercurial 会自动将 $Id$ 转换为 Subversion 所做的吗?

转载 作者:行者123 更新时间:2023-12-03 07:03:42 25 4
gpt4 key购买 nike

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

最佳答案

不,不会,但您可以启用它。

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

Why You Don't Need It

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!

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:

...

Basic Emulation

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

...

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

See also KeywordExtension.

<小时/>

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

Keyword Extension

This extension is distributed with Mercurial

Overview

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.

If you just want to version your entire repo, do not use this extension but let your build system take care of it. Something along the lines of ...

,,,

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 - Mercurial 会自动将 $Id$ 转换为 Subversion 所做的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4426396/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com