I’d like to export only the files that were changed in a hg changeset, to make a patch – but I’m not sure how to do this. I’m using bitbucket as a hosting service – how do I go about this?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
hg exportcommand actually generates a patch (in unified diff format), but also includes some extra info like the author and the commit message in case you want to use it withhg import.If you just want a patch, with no extra info, generated from a changeset, it is as simple as:
EDIT
Since you only want the files changed in a revision, a la
hg archiveI presume, I came up with the following bourne shell script:It takes two arguments: the revision to export and the directory where you want to save the files. You could achieve the same in a similar script but using
hg archivealong with a bunch of-Iarguments. However, I think the proposed script is a bit more intuitive, at least to me.NOTE: This script will not work correctly when files are moved or deleted from the repository.