Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
トピックのように、指定されたSVNリポジトリURLのタグ(または単にサブディレクトリ)のリストをフェッチするための推奨される方法は何ですか?
リポジトリを操作するためにpySVNを使用しています。
たとえば、次のようなツリー構造がある場合:
trunk/ branch/ tags/ tag1/ tag2/ tag3/
どうすれば次のようなものを入手できますか?
['tag1', 'tag2', 'tag3']
?
どんな助けでもいただければ幸いです!
次のコードで解決策があります。
from pysvn import Client import urlparse, posixpath tagsUrl="svn://MyRepoUrl/tags" tag_list=[posixpath.basename(urlparse.urlparse(elem[0].get('path'))[2]) for elem in Client().list(tagsUrl)[1:]]