3 """Print a list of files that are mentioned in CVS directories.
5 Usage: cvsfiles.py [-n file] [directory] ...
7 If the '-n file' option is given, only files under CVS that are newer
8 than the given file are printed; by default, all files under CVS are
9 printed. As a special case, if a file does not exist, it is always
22 opts
, args
= getopt
.getopt(sys
.argv
[1:], "n:")
23 except getopt
.error
, msg
:
31 cutofftime
= getmtime(a
)
41 names
= os
.listdir(dir)
43 fullname
= os
.path
.join(dir, name
)
47 if os
.path
.isdir(fullname
):
48 if not os
.path
.islink(fullname
):
49 subdirs
.append(fullname
)
51 entries
= os
.path
.join(cvsdir
, "Entries")
52 for e
in open(entries
).readlines():
54 if words
[0] == '' and words
[1:]:
56 fullname
= os
.path
.join(dir, name
)
57 if cutofftime
and getmtime(fullname
) <= cutofftime
:
64 def getmtime(filename
):
66 st
= os
.stat(filename
)
69 return st
[stat
.ST_MTIME
]