]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | #!/usr/bin/env python\r |
2 | # -*- python -*-\r | |
3 | #\r | |
4 | # guido's version, from rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp\r | |
5 | #\r | |
6 | # Python script for bumping up an RCS major revision number.\r | |
7 | \r | |
8 | import sys\r | |
9 | import re\r | |
10 | import rcslib\r | |
11 | import string\r | |
12 | \r | |
13 | WITHLOCK = 1\r | |
14 | majorrev_re = re.compile('^[0-9]+')\r | |
15 | \r | |
16 | dir = rcslib.RCS()\r | |
17 | \r | |
18 | if sys.argv[1:]:\r | |
19 | files = sys.argv[1:]\r | |
20 | else:\r | |
21 | files = dir.listfiles()\r | |
22 | \r | |
23 | for file in files:\r | |
24 | # get the major revnumber of the file\r | |
25 | headbranch = dir.info(file)['head']\r | |
26 | majorrev_re.match(headbranch)\r | |
27 | majorrev = string.atoi(majorrev_re.group(0)) + 1\r | |
28 | \r | |
29 | if not dir.islocked(file):\r | |
30 | dir.checkout(file, WITHLOCK)\r | |
31 | \r | |
32 | msg = "Bumping major revision number (to %d)" % majorrev\r | |
33 | dir.checkin((file, "%s.0" % majorrev), msg, "-f")\r |