开发者

Mercurial: get contents of a specific revision of a file

I need to get contents of a specific revision/node of a file in a local repository and write it to a temporary file.

I know it is possible to do through the internal Mercurial API.

Is there a b开发者_Go百科uilt-in command or an extension?


You can use hg cat:

hg cat -r revisionid filename > tmpfile


The fastest, large and/or binary file friendly way to do this is:

hg cat -r revisionid repoRelativeFilePath -o tempFilePath

The tempFilePath, unless absolutely rooted (ex. 'C:\') will be relative to the repo's root

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜