diff options
author | Guido van Rossum <guido@python.org> | 1995-06-23 22:05:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-06-23 22:05:39 (GMT) |
commit | 40de53c3bd543cd0a585f57be616c6263a5c1756 (patch) | |
tree | 25b922bc267ae303d694df9fb15b6dca33107627 | |
parent | 8608ab65e3fd0017302cc831f16eb3d56af45fff (diff) | |
download | cpython-40de53c3bd543cd0a585f57be616c6263a5c1756.zip cpython-40de53c3bd543cd0a585f57be616c6263a5c1756.tar.gz cpython-40de53c3bd543cd0a585f57be616c6263a5c1756.tar.bz2 |
use the new rcslib
-rwxr-xr-x | Demo/pdist/rcsbump | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Demo/pdist/rcsbump b/Demo/pdist/rcsbump index b915b17..421501e 100755 --- a/Demo/pdist/rcsbump +++ b/Demo/pdist/rcsbump @@ -1,9 +1,11 @@ #!/usr/local/bin/python +# -*- python -*- # -# rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp +# guido's version, from rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp # # Python script for bumping up an RCS major revision number. +import sys import regex import rcslib import string @@ -11,16 +13,21 @@ import string WITHLOCK = 1 majorrev_re = regex.compile('^[0-9]+') -dir = rcslib.RCSDirectory() +dir = rcslib.RCS() -for file in dir.listfiles(): +if sys.argv[1:]: + files = sys.argv[1:] +else: + files = dir.listfiles() + +for file in files: # get the major revnumber of the file headbranch = dir.info(file)['head'] majorrev_re.match(headbranch) majorrev = string.atoi(majorrev_re.group(0)) + 1 if not dir.islocked(file): - dir.get(file, WITHLOCK) + dir.checkout(file, WITHLOCK) msg = "Bumping major revision number (to %d)" % majorrev - dir.put((file, "%s.0" % majorrev), msg, "-f") + dir.checkin((file, "%s.0" % majorrev), msg, "-f") |