Commit 14e4970d authored by Robert Jensch's avatar Robert Jensch

Modified: - get basename of svn module with regular expression

parent 3db6af8e
......@@ -25,6 +25,7 @@
from __future__ import print_function
from __future__ import absolute_import
import os
import re
def url_parse(url):
......@@ -75,11 +76,10 @@ def svn_basename(url):
"""
Get basename from an SVN url
"""
words = url.split('//')
m = re.search(r'\/([^\/]*)\/(trunk|tags|branches)', url)
try:
words = words[1].split('/')
return '/'.join(words[1:])
except IndexError:
return m.group(1)
except AttributeError:
return None
......
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