determine URL to start with in cli.run()
This commit is contained in:
parent
610d69156e
commit
725e241984
@ -1,4 +1,21 @@
|
|||||||
import simplesvnbrowser
|
import simplesvnbrowser
|
||||||
|
import re
|
||||||
|
|
||||||
def run(argv):
|
def run(argv):
|
||||||
print(argv)
|
url = None
|
||||||
|
wc_path = "."
|
||||||
|
if len(argv) >= 2:
|
||||||
|
if re.search(r'://', argv[1]):
|
||||||
|
url = argv[1]
|
||||||
|
else:
|
||||||
|
wc_path = argv[1]
|
||||||
|
if url is None:
|
||||||
|
url = determine_url_from_wc(wc_path)
|
||||||
|
# TODO: start with url
|
||||||
|
|
||||||
|
def determine_url_from_wc(path):
|
||||||
|
stdout, _ = simplesvnbrowser.run_svn(["info", path])
|
||||||
|
m = re.search(r'^URL: (.*)$', stdout, re.MULTILINE)
|
||||||
|
if m is not None:
|
||||||
|
return m.group(1)
|
||||||
|
return ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user