如何从一个空的工作目录中使用`hg cat`? [英] How to use `hg cat` from an empty working directory?
问题描述
我有一个位于x:/projects/repo1的仓库.使用hg update null
清空了工作目录.我想将某些文件的最新版本从那里解压缩到本地目录.
I have a repo located at x:/projects/repo1. The working directory has been emptied using hg update null
. I want to extract the latest version of some files from there to a local directory.
我尝试过:
x:\projects\repo1> hg cat -o c:\sql\%s scripts\*.sql -r tip
我收到此错误:
scripts\*.sql: No such file in rev 14f07c26178b
如果工作目录不为空,则相同的命令可以正常工作.有充分的理由为什么这不起作用?还是您知道另一种从那里将文件提取到本地目录的方法?
The same command works fine if the working directory is not empty. Is there a good reason why this does not work? Or do you know another way of extract some files from there to a local directory?
推荐答案
hg cat
命令用于单个文件.如果要多个文件,请使用hg archive
命令,该命令将使zipfiles或目录中充满文件.这是您的命令:
The hg cat
command is for single files. If you want multiple files use the hg archive
command, which makes zipfiles or directories full of files. Here's your command:
x:\projects\repo1> hg archive --include scripts\*.sql -r tip c:\sql
这篇关于如何从一个空的工作目录中使用`hg cat`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!