[Python-checkins] r68276 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS

Georg Brandl g.brandl at gmx.net
Sun Jan 4 01:12:18 CET 2009


tarek.ziade schrieb:
> Author: tarek.ziade
> Date: Sun Jan  4 01:04:49 2009
> New Revision: 68276
> 
> Log:
> fixed #1702551: distutils sdist was not pruning VCS directories under win32
> 
> Added:
>    python/trunk/Lib/distutils/tests/test_sdist.py   (contents, props changed)
> Modified:
>    python/trunk/Lib/distutils/command/sdist.py
>    python/trunk/Misc/NEWS
> 
> Modified: python/trunk/Lib/distutils/command/sdist.py
> ==============================================================================
> --- python/trunk/Lib/distutils/command/sdist.py	(original)
> +++ python/trunk/Lib/distutils/command/sdist.py	Sun Jan  4 01:04:49 2009
> @@ -7,6 +7,7 @@
>  __revision__ = "$Id$"
>  
>  import os, string
> +import sys
>  from types import *
>  from glob import glob
>  from distutils.core import Command
> @@ -354,8 +355,13 @@
>  
>          self.filelist.exclude_pattern(None, prefix=build.build_base)
>          self.filelist.exclude_pattern(None, prefix=base_dir)
> -        self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1)
>  
> +        # pruning out vcs directories
> +        # both separators are used under win32
> +        seps = sys.platform == 'win32' and r'/|\\' or '/'
> +        vcs_dirs = ['RCS', 'CVS', '\.svn', '\.hg', '\.git', '\.bzr', '_darcs']

                                      ^        ^       ^        ^
You should double these backslashes or use raw strings.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list