5

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

Boaz
  • 25,331
  • 21
  • 69
  • 77
  • 1
    You're misreading what `hg archive` does. It's not " all files changed in a specific revision ", it's ***all files as they looked after a specific revision***. So, `hg archive -r tip` gets you an archive of all the files as they are now, regardless of how many changed in that final (tip) revision. – Ry4an Brase May 11 '10 at 20:20

1 Answers1

1

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
Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169