简体   繁体   中英

Archive Mercurial Changeset Files

I'm using Mercurial 1.7.2. on Windows and I want to extract all files within a specified change set (in my case tip). This is so I can upload only the files that I have changed to my web server.

If I want to take an un-versioned copy of the entire repo then I use hg arhive however I can't find a way to get just the files in a changeset.

And all the examples I can find use Unix tools.

With hg status --change <revno> --no-status you get a list of the files that's changed.

You should be able to feed that list into robocopy or xcopy or something else.

If you're using TortoiseHg you can do this from the Repository Explorer - in fact I do exactly what you're trying to do for a Wordpress install.

thg log will bring up the log of the repository in TortoiseHg. You can then right-click on a changeset and select (from memory, sorry) Archive . There are a few options, but you should see an option on the resulting dialog something like "Archive only changed files". Make sure that is checked, and away you go.

The command that's executed is shown to you, but to automate it on the command-line you need to get the list of files changed (see Macke's reply). With a little batch-magic you can feed that into the Archive command.

Have a look at this StackOverflow question for details of how to do it on the command-line, providing you have a SED interpreter installed, which you can easily find for Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM