[Python-Dev] Incorporating external packages into Python's stddistribution

Fredrik Lundh fredrik at pythonware.com
Mon Dec 12 23:12:38 CET 2005


skip at pobox.com wrote:

> BTW, there is one project I'm theoretically familiar with that attempts to
> handle the dual source situation: XEmacs.  I'm still trying to come to terms
> with the practical issues involved.  I'm supposed to be updating the
> python-mode code, and am only taking baby steps in that direction, so I'm
> probably not the best person to describe how it works, but here goes.
>
> For any given externally maintained package you give it a place to live in
> the xemacs-packages CVS repository.  Each file gets two versions, e.g.,
> python-mode.el and python-mode.el.upstream.  I believe the intent is that
> the difference between the two represents XEmacs-specific changes to the
> code.  When you import a new version of your code, you're supposed to factor
> in the diffs between the upstream version and the XEmacs version.  You could
> maintain a context/unified diff instead I suppose, then just update the
> .upstream version and patch it to get the candidate version.

in the model I proposed (and just implemented), the "external" repository
corresponds to your "upstream" copy.  you can use

    $ svn log -v --stop-on-copy <file>

to get an overview of all changes since the last upstream copy

$ svn log -v --stop-on-copy Lib/xml/etree/ElementTree.py
------------------------------------------------------------------------
r41651 | fredrik.lundh | 2005-12-12 16:10:44 +0100 (Mon, 12 Dec 2005) | 3 lines
Changed paths:
   A /python/trunk/Lib/xml/etree
   A /python/trunk/Lib/xml/etree/ElementInclude.py
   (from /external/elementtree-1.2.6-20050316/elementtree/ElementInclude.py:41650)
   A /python/trunk/Lib/xml/etree/ElementPath.py
   (from /external/elementtree-1.2.6-20050316/elementtree/ElementPath.py:41650)
   A /python/trunk/Lib/xml/etree/ElementTree.py
   (from /external/elementtree-1.2.6-20050316/elementtree/ElementTree.py:41650)
   A /python/trunk/Lib/xml/etree/__init__.py
   (from /external/elementtree-1.2.6-20050316/elementtree/__init__.py:41650)

added ElementTree core components to xml.etree

and use

    $ svn diff -r <version> <file>

to get a full diff:

$ svn diff -r 41651 Lib/xml/etree/ElementTree.py
$

(nothing has changed yet)

to update to a new upstream release, save the diff somewhere, import
the new release under external, copy relevant files to trunk, commit, merge
in the diff by hand, or using "svn merge".  when you're done, commit again.
that's it.

</F>





More information about the Python-Dev mailing list