Is there any project whose patches are all available?

skip at pobox.com skip at pobox.com
Fri Nov 28 07:48:18 EST 2008


    zellux> I want to write a version-tracking tool for Python projects, and
    zellux> need some sample projects whose even smallest modifications can
    zellux> be downloaded from the internet.

Sure.  Python itself.  Do a checkout of the code from Subversion then for
any given file just ask Subversion for a diff between it and the previous
version.  For example:

    % pwd
    /Users/skip/src/python/trunk
    % svn info Lib/os.py
    Path: Lib/os.py
    Name: os.py
    URL: svn+ssh://pythondev@svn.python.org/python/trunk/Lib/os.py
    Repository Root: svn+ssh://pythondev@svn.python.org
    Repository UUID: 6015fed2-1504-0410-9fe1-9d1591cc4771
    Revision: 67276
    ...
    % svn log Lib/os.py
    ------------------------------------------------------------------------
    r66142 | gregory.p.smith | 2008-09-02 00:36:11 -0500 (Tue, 02 Sep 2008) | 3 lines

    Issue #3708: os.urandom no longer goes into an infinite loop when passed a
    non-integer floating point number.

    ------------------------------------------------------------------------
    r65795 | brett.cannon | 2008-08-17 19:46:22 -0500 (Sun, 17 Aug 2008) | 3 lines

    Update __all__ for cookielib, csv, os, and urllib2 for objects imported into
    the module but exposed as part of the API.

    ------------------------------------------------------------------------
    r63493 | georg.brandl | 2008-05-20 02:49:57 -0500 (Tue, 20 May 2008) | 2 lines

    Revert copy_reg -> copyreg rename.

    ------------------------------------------------------------------------
    r63158 | ronald.oussoren | 2008-05-12 06:24:33 -0500 (Mon, 12 May 2008) | 5 lines

    Remove references to platform 'mac'

    The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port,
    which is no longer supported (as of Python 2.4 IIRC).
    ...
    % svn diff -r66142:65795 Lib/os.py
    Index: Lib/os.py
    ===================================================================
    --- Lib/os.py       (revision 66142)
    +++ Lib/os.py       (revision 65795)
    @@ -753,10 +753,8 @@
                 _urandomfd = open("/dev/urandom", O_RDONLY)
             except (OSError, IOError):
                 raise NotImplementedError("/dev/urandom (or equivalent) not found")
    -        try:
    -            bs = b""
    -            while n - len(bs) >= 1:
    -                bs += read(_urandomfd, n - len(bs))
    -        finally:
    -            close(_urandomfd)
    -        return bs
    +        bytes = ""
    +        while len(bytes) < n:
    +            bytes += read(_urandomfd, n - len(bytes))
    +        close(_urandomfd)
    +        return bytes
    % svn diff -r65795:63493 Lib/os.py
    Index: Lib/os.py
    ===================================================================
    --- Lib/os.py       (revision 65795)
    +++ Lib/os.py       (revision 63493)
    @@ -28,7 +28,7 @@
     _names = sys.builtin_module_names

     # Note:  more names are added to __all__ later.
    -__all__ = ["altsep", "curdir", "pardir", "sep", "extsep", "pathsep", "linesep",
    +__all__ = ["altsep", "curdir", "pardir", "sep", "pathsep", "linesep",
                "defpath", "name", "path", "devnull",
                "SEEK_SET", "SEEK_CUR", "SEEK_END"]

And so on.  In general, any open source project should be available in this
fashion.  The details for fetching diffs will depend on the specific source
code control system being used.

-- 
Skip Montanaro - skip at pobox.com - http://smontanaro.dyndns.org/



More information about the Python-list mailing list