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.
I tried this:
x:\projects\repo1> hg cat -o c:\sql\%s scripts\*.sql -r tip
I get this error:
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 forget ' is just shorthand for ' hg remove -Af '. From the ' hg remove ' help: ...and -Af can be used to remove files from the next revision without deleting them from the working directory. Bottom line: ' remove ' deletes the file from your working copy on disk (unless you uses -Af ) and ' forget ' doesn't.
If you see the help for hg rm --help : hg remove [OPTION]... FILE... Schedule the indicated files for removal from the current branch. This command schedules the files to be removed at the next commit.
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
It seems that hg cat
doesn't support wildcard symbols in paths. So you should use the full file name:
hg cat -r tip scripts/foo.sql
When your working copy is up to date with the tip
revision, your shell does wildcard substitution for you.
The hg manifest
command also might be helpful for getting tracked file listings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With