summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/rcsbump
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-06-23 14:40:06 (GMT)
committerGuido van Rossum <guido@python.org>1995-06-23 14:40:06 (GMT)
commit79ed32d553b97df0e3973f231bbf4691d6036483 (patch)
treee6b78e30da16aa363de932524a68be9626005d4b /Demo/pdist/rcsbump
parent92457b9f8d14fc86a9805ecd6d2b2b295941e9b8 (diff)
downloadcpython-79ed32d553b97df0e3973f231bbf4691d6036483.zip
cpython-79ed32d553b97df0e3973f231bbf4691d6036483.tar.gz
cpython-79ed32d553b97df0e3973f231bbf4691d6036483.tar.bz2
barry's contributions
Diffstat (limited to 'Demo/pdist/rcsbump')
-rwxr-xr-xDemo/pdist/rcsbump26
1 files changed, 26 insertions, 0 deletions
diff --git a/Demo/pdist/rcsbump b/Demo/pdist/rcsbump
new file mode 100755
index 0000000..b915b17
--- /dev/null
+++ b/Demo/pdist/rcsbump
@@ -0,0 +1,26 @@
+#!/usr/local/bin/python
+#
+# rcsbump,v 1.2 1995/06/22 21:27:27 bwarsaw Exp
+#
+# Python script for bumping up an RCS major revision number.
+
+import regex
+import rcslib
+import string
+
+WITHLOCK = 1
+majorrev_re = regex.compile('^[0-9]+')
+
+dir = rcslib.RCSDirectory()
+
+for file in dir.listfiles():
+ # 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)
+
+ msg = "Bumping major revision number (to %d)" % majorrev
+ dir.put((file, "%s.0" % majorrev), msg, "-f")