Follow-up to r29036: Now that the "mergeinfo" transaction file is no
[svn.git] / tools / examples / geturl.py
bloba87b3ef956f9d546e824bdf06c736ab91c5c3451
1 #!/usr/bin/env python
3 # USAGE: geturl.py FILE_OR_DIR1 FILE_OR_DIR2 ...
5 # prints out the URL associated with each item
8 import os
9 import sys
11 import svn.wc
12 import svn.core
14 def main(files):
15 for f in files:
16 dirpath = fullpath = os.path.abspath(f)
17 if not os.path.isdir(dirpath):
18 dirpath = os.path.dirname(dirpath)
19 adm_baton = svn.wc.adm_open(None, dirpath, 1, 1)
20 try:
21 entry = svn.wc.entry(fullpath, adm_baton, 0)
22 print entry.url
23 finally:
24 svn.wc.adm_close(adm_baton)
26 if __name__ == '__main__':
27 main(sys.argv[1:])