Move the long option name enum from cl.h into main.c, because it is
[svn.git] / tools / examples / check-modified.py
blob47e32c26209e7f10eac6f87075860654a03e4219
1 #!/usr/bin/env python
3 # USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
5 # prints out the URL associated with each item
8 import sys
9 import os
10 import os.path
11 import svn.core
12 import svn.client
13 import svn.wc
15 FORCE_COMPARISON = 0
17 def usage():
18 print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
19 sys.exit(0)
21 def run(files):
23 for f in files:
24 dirpath = fullpath = os.path.abspath(f)
25 if not os.path.isdir(dirpath):
26 dirpath = os.path.dirname(dirpath)
28 adm_baton = svn.wc.adm_open(None, dirpath, False, True)
30 try:
31 entry = svn.wc.entry(fullpath, adm_baton, 0)
33 if svn.wc.text_modified_p(fullpath, FORCE_COMPARISON,
34 adm_baton):
35 print "M %s" % f
36 else:
37 print " %s" % f
38 except:
39 print "? %s" % f
41 svn.wc.adm_close(adm_baton)
43 if __name__ == '__main__':
44 run(sys.argv[1:])