diff options
author | Philip Thiem <ptthiem@gmail.com> | 2013-06-30 02:04:47 -0500 |
---|---|---|
committer | Philip Thiem <ptthiem@gmail.com> | 2013-06-30 02:04:47 -0500 |
commit | 82a8940be2ae4f000a95a964b0d945175a0a7cd7 (patch) | |
tree | 226123a368ada43b97309e4b57054de62961bdaf /setuptools/svn_utils.py | |
parent | fa323cad32fa1804f84b6421417828fbc9b15da0 (diff) | |
download | external_python_setuptools-82a8940be2ae4f000a95a964b0d945175a0a7cd7.tar.gz external_python_setuptools-82a8940be2ae4f000a95a964b0d945175a0a7cd7.tar.bz2 external_python_setuptools-82a8940be2ae4f000a95a964b0d945175a0a7cd7.zip |
added querying externals to the classes
--HG--
extra : rebase_source : 9b76763b0ba0dc1ac6de130b04f6bb5ebf546fe6
Diffstat (limited to 'setuptools/svn_utils.py')
-rw-r--r-- | setuptools/svn_utils.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/setuptools/svn_utils.py b/setuptools/svn_utils.py index 3311d9cf..d36f64ea 100644 --- a/setuptools/svn_utils.py +++ b/setuptools/svn_utils.py @@ -49,6 +49,28 @@ class SVNEntries(object): all_revs = self.parse_revision_numbers() + [0]
return max(all_revs)
+ def __get_cached_external_dirs(self):
+ return self.external_dirs
+
+ def get_external_dirs(self):
+ #regard the shell argument, see: http://bugs.python.org/issue8557
+ # and http://stackoverflow.com/questions/5658622/python-subprocess-popen-environment-path
+ proc = _Popen(['svn', 'propget', self.path],
+ stdout=_PIPE, shell=(sys.platform=='win32'))
+ data = unicode(proc.communicate()[0], encoding='utf-8').splitlines()
+ data = [line.split() for line in data]
+
+ # http://svnbook.red-bean.com/en/1.6/svn.advanced.externals.html
+ #there appears to be three possible formats for externals since 1.5
+ #but looks like we only need the local relative path names so it's just
+ #2 either the first column or the last (of 2 or 3)
+ index = -1
+ if all("://" in line[-1] for line in data):
+ index = 0
+
+ self.external_dirs = [line[index] for line in data]
+ return self.dir_data
+
class SVNEntriesXML(SVNEntries):
def is_valid(self):
return True
|