开发者

Mercurial: get contents of a specific revision of a file

开发者 https://www.devze.com 2023-04-04 00:26 出处:网络
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 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

精彩评论

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

关注公众号