Commit 82a8940b authored by Philip Thiem's avatar Philip Thiem

added querying externals to the classes

--HG--
extra : rebase_source : 9b76763b0ba0dc1ac6de130b04f6bb5ebf546fe6
parent fa323cad
...@@ -49,6 +49,28 @@ class SVNEntries(object): ...@@ -49,6 +49,28 @@ class SVNEntries(object):
all_revs = self.parse_revision_numbers() + [0] all_revs = self.parse_revision_numbers() + [0]
return max(all_revs) 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): class SVNEntriesXML(SVNEntries):
def is_valid(self): def is_valid(self):
return True return True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment