0
0
mirror of https://github.com/python/cpython.git synced 2024-11-25 01:20:47 +01:00
cpython/Demo/pdist/rcsbump

34 lines
746 B
Plaintext
Raw Normal View History

1995-06-23 16:40:06 +02:00
#!/usr/local/bin/python
1995-06-24 00:05:39 +02:00
# -*- python -*-
1995-06-23 16:40:06 +02:00
#
1995-06-24 00:05:39 +02:00
# guido's version, from rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp
1995-06-23 16:40:06 +02:00
#
# Python script for bumping up an RCS major revision number.
1995-06-24 00:05:39 +02:00
import sys
1995-06-23 16:40:06 +02:00
import regex
import rcslib
import string
WITHLOCK = 1
majorrev_re = regex.compile('^[0-9]+')
1995-06-24 00:05:39 +02:00
dir = rcslib.RCS()
1995-06-23 16:40:06 +02:00
1995-06-24 00:05:39 +02:00
if sys.argv[1:]:
files = sys.argv[1:]
else:
files = dir.listfiles()
for file in files:
1995-06-23 16:40:06 +02:00
# 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):
1995-06-24 00:05:39 +02:00
dir.checkout(file, WITHLOCK)
1995-06-23 16:40:06 +02:00
msg = "Bumping major revision number (to %d)" % majorrev
1995-06-24 00:05:39 +02:00
dir.checkin((file, "%s.0" % majorrev), msg, "-f")