3rd party software customizations

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Apr 17 19:04:58 UTC 2012


On Tue, Apr 17, 2012 at 1:38 PM, Cristiano Cortezia
<cristiano.cortezia at gmail.com> wrote:
> Em 17 de abril de 2012 02:24, Arne Babenhauserheide <arne_bab at web.de> escreveu:
>> I did that once and I used a simple vendor-branch. Every new release
>
> Thanks for your prompt response.
> I have one more question, regarding this subject. How do you proceed when it
> is not desirable to accept the whole new vendor release, but to pick only
> some of the changes to your customization branch (i.e. taking bugfixes while
> leaving new features unmerged) ?

If you import release snapshots, you can always use what e.g. FreeBSD
does with vendor code: commit along-side the vendor sources an
"exclude list" that helps future importers to exclude the files you don't
really need.

For example is the vendor source tree has the following files:

    foo-1.0/src/foo.c
    foo-1.0/src/foo.h
    foo-1.0/doc/foo-manual.txt

and you don't want the manual sources in your "vendor imports",
you can create in your thirdparty repository area a directory that
includes the source code:

    myproject/contrib/foo/...

and a plain text file that is called "myproject/contrib/foo-xlist.txt"
with contents:

    foo/doc/foo-manual.txt

Then when you have to import version 1.1 of foo/ you can do
something like this:

    # checkout the appropriate vendor branch
    hg update --clean "vendor-foo-branch"

    # go into the 'vendor area' and remove old sources
    cd contrib
    rm -fr foo

    # extract the new sources in place
    tar xzvf ~/Downloads/foo-1.1.tar.gz
    mv foo-1.1 foo

    # cleanup the vendor sources, by removing files we don't care about
    rm -f $( cat foo-xlist.txt )

    # commit and tag the newly imported release
    hg addremove foo
    hg commit -m "Import foo-1.1 release"
    hg tag "vendor-foo-1.1"

    # (optional) merge the new release into the 'default' branch
    hg update --clean default
    hg merge vendor-foo-branch

With a bit of care you can keep a really 'clean' version of the vendor
sources in their own vendor-specific branch.



More information about the Mercurial mailing list