Mercurial how to create a patch for a single file in a repo

I have a file called some / work / file.py in my repo.

I work in a repo (and in other files except the .py file) and made my changes and went from revising 20 to 30.

How can I create a patch for file.py only with versions 20 to 30 without including other files?

Sort of:

hg export 20:30 file.py > new.patch

I tried the command, but it doesnโ€™t work.

thank

+5
source share
1 answer

hg export exports individual changes as individual objects.

If you understand correctly, you need an answer to the question โ€œWhat changes have been made file.cbetween revision 20 and revision 30?โ€, That is, you only need one diff file.

Here's how you can do it:

hg diff file.c -r 20:30 > new.diff

-I ( )/-X ().

+5

All Articles