简体   繁体   中英

How to archive/export all files changed since a specific revision with Mercurial?

Mercurial supports a handy archive command which allows you to export all files as they were in a specific revision (thanks to Ry4an for pointing this out in a comment) to another folder/zip file etc. This is done as follows:

hg archive -r REV destination

Is there a way to export only the files changed since a certain revision and to the head?

Thanks, Boaz

See my comment about your misinterpretation of what archive does. Given that, it might not still be the case that you actually want a way to build an archive with only the files that have changed from revision X to revision Y, but just in case you really do, this will do it:

hg grep -r X:Y --all . | cut -d : -f 1 | sort -u | sed 's/^/-I /' | xargs echo hg archive

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