root/trunk/svn-ls.py

Revision 296, 1.0 kB (checked in by rob, 20 months ago)

refs #153:
* added svn-ls.py to replace 'svn ls -R' that was missing from r295

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to "Url Rev Author Date Id"
Line 
1#!/usr/bin/env python
2
3import os,sys,re,os.path,time
4from optparse import OptionParser
5
6
7def directory(verbose=False):
8    files = []
9
10    # find packages to be installed
11    path = os.getcwd()
12    if verbose: print path
13    check = os.path.join('.svn','text-base')
14    def addsvn(arg, dirname, names):
15        if verbose: print "checking %s" % (dirname)
16        if dirname.find(check)>0:
17            dirname = dirname.replace(check, '')[len(path)+1:]
18            for name in names:
19                if name.find('.svn-base')>0:
20                    actualname = name.replace('.svn-base', '')
21                    if verbose: print "found %s" % actualname
22                    files.append(os.path.join(dirname, actualname))
23    os.path.walk(path, addsvn, None)
24
25    filelist = (" ".join(files)).replace(os.sep, '/')
26    print filelist
27   
28if __name__=='__main__':
29    usage="usage: %prog"
30    parser=OptionParser(usage=usage)
31    (options, args) = parser.parse_args()
32
33    directory()
34   
Note: See TracBrowser for help on using the browser.