[oe] mtnpatch (updated)
c.romain at laposte.net
Sun Mar 11 15:59:12 CET 2007
Justin Patrin wrote:
> Just thought I'd let everyone know that I just cherrypicked my first
> revision with mtnpatch.py. I made some efl/e17 updates to .dev and
> edited one file, made a diff, and applied the diff to .oz354x with
> mtnpatch.py. It worked like a charm.
> For those that missed it, I have checked in mtnpatch.py into
> org.openembedded.dev in contrib/. I have also switch to using a regex
> instead of split() so that whitespace in filenames should be correctly
> taken care of.
> The script is used like this:
> mtn diff -r ParentRev -r RevToCherryPick > file.patch
> cd /branch/to/cherrypick/to
> contrib/mtnpatch.py file.patch
> Look at the output to make sure it's sane
> contrib/mtnpatch.py file.patch | sh
> mtn ci
Maybe I've just missed the right mtn command reading the documentation,
but as I'm submitting some patches/recipes for OE metadata, I'd like to:
1. test that my 'mtn diff' patches successfully apply on a up-to-date
metadata tree without any local modifications.
2. apply some patches to another development tree.
And this script is "almost" what I'm looking for :)
"Almost" because it does not takes file/directory drop order into
account, i.e. "mtnpatch.py the.patch | sh" can fail.
For example if mtnpatch dumps:
mtn drop -e packages/quilt/files/install.patch
mtn drop -e packages/quilt/files
And if you run these commands in that order, you get "mtn: misuse:
cannot remove packages/quilt/files/, it is not empty"
In attachment, an updated version of mtnpatch.py with the following
1. output command are sorted, so that 'mtnpatch.py my_patch.patch | sh'
should now succeed in all cases, hopefully :)
2. help (-h, --help) option added, and usage message is printed on misuse
3. reverse mode (-R option) can be also set with --reverse
4. the reverse option is used to unapply the patch. The dropped files
are reverted (not added), but maybe it is not what you, Justin, wanted
to do with -R ?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3369 bytes
Desc: not available
More information about the Openembedded-devel