aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-06-28 21:36:33 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-06-28 21:36:33 -0400
commit5d13194169ce785082a60233f2948f4eacbcedc9 (patch)
treed6d47bb2f7650cba1be822777c05cdecbbb2d591
parentfbf309d3e3b529f6ff0d57ecbb22514755b1154d (diff)
parent0b70ebffe2c8cacc4c229c21286e74d0d2ebbd65 (diff)
downloadexternal_python_setuptools-5d13194169ce785082a60233f2948f4eacbcedc9.tar.gz
external_python_setuptools-5d13194169ce785082a60233f2948f4eacbcedc9.tar.bz2
external_python_setuptools-5d13194169ce785082a60233f2948f4eacbcedc9.zip
Merge pull-request #575.3
--HG-- extra : amend_source : 9576c3d20e8d3bcb3b951cd2f588e782f885ebe6
-rw-r--r--CHANGES.txt9
-rwxr-xr-xsetuptools/command/egg_info.py10
-rw-r--r--setuptools/tests/test_egg_info.py37
3 files changed, 51 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 829a3705..8bcc529d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,15 @@ CHANGES
=======
---
+5.3
+---
+
+* Issue #185: Make svn tagging work on the new style SVN metadata.
+ Thanks cazabon!
+* Prune revision control directories (e.g .svn) from base path
+ as well as sub-directories.
+
+---
5.2
---
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 981c7ab7..a1818edc 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -171,10 +171,10 @@ class egg_info(Command):
version = ''
if self.tag_build:
version += self.tag_build
- if self.tag_svn_revision and (
- os.path.exists('.svn') or os.path.exists('PKG-INFO')
- ):
- version += '-r%s' % self.get_svn_revision()
+ if self.tag_svn_revision:
+ rev = self.get_svn_revision()
+ if rev: # is 0 if it's not an svn working copy
+ version += '-r%s' % rev
if self.tag_date:
import time
@@ -320,7 +320,7 @@ class manifest_maker(sdist):
self.filelist.exclude_pattern(None, prefix=build.build_base)
self.filelist.exclude_pattern(None, prefix=base_dir)
sep = re.escape(os.sep)
- self.filelist.exclude_pattern(sep + r'(RCS|CVS|\.svn)' + sep,
+ self.filelist.exclude_pattern(r'(^|' + sep + r')(RCS|CVS|\.svn)' + sep,
is_regex=1)
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 27854366..7531e37c 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -138,6 +138,43 @@ class TestSvnDummy(environment.ZippedEnvironment):
return data
+ @skipIf(not test_svn._svn_check, "No SVN to text, in the first place")
+ def test_svn_tags(self):
+ code, data = environment.run_setup_py(["egg_info",
+ "--tag-svn-revision"],
+ pypath=self.old_cwd,
+ data_stream=1)
+ if code:
+ raise AssertionError(data)
+
+ pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO')
+ infile = open(pkginfo, 'r')
+ try:
+ read_contents = infile.readlines()
+ finally:
+ infile.close()
+ del infile
+
+ self.assertTrue("Version: 0.1.1-r1\n" in read_contents)
+
+ @skipIf(not test_svn._svn_check, "No SVN to text, in the first place")
+ def test_no_tags(self):
+ code, data = environment.run_setup_py(["egg_info"],
+ pypath=self.old_cwd,
+ data_stream=1)
+ if code:
+ raise AssertionError(data)
+
+ pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO')
+ infile = open(pkginfo, 'r')
+ try:
+ read_contents = infile.readlines()
+ finally:
+ infile.close()
+ del infile
+
+ self.assertTrue("Version: 0.1.1\n" in read_contents)
+
class TestSvnDummyLegacy(environment.ZippedEnvironment):