"Class encapsulating RCS version-control operations."
historyfile = ".HISTORY"
def __init__(self):
- # Rev-to-branch map will go here
- if not os.path.exists("RCS"):
- try:
- os.makedirs("RCS")
- except OSError:
- raise FatalException("can't create RCS directory.")
- file(RCS.historyfile, "w").close()
+ if verbose:
+ if not os.path.exists("RCS"):
+ try:
+ os.makedirs("RCS")
+ except OSError:
+ raise FatalException("can't create RCS directory.")
+ file(RCS.historyfile, "w").close()
@staticmethod
def master(filename):
"Return the master file corresponding to a specified filename."
fp.write(path)
fp.write("\n")
def precommit(self, event):
- RCS.record("commit")
+ if verbose:
+ RCS.record("commit")
def modify(self, event, path, mode, copyfile, roundtrip):
"Perform RCS file checkins and modifications,"
if mode == "160000":
do_or_die("rcs -u %s" % (" ".join(RCS.rcsfiles()),))
if switch == '-u':
do_or_die("co -u %s" % (" ".join(RCS.rcsfiles()),))
- os.rename(RCS.historyfile, os.path.join("RCS", RCS.historyfile))
+ if verbose:
+ os.rename(RCS.historyfile, os.path.join("RCS", RCS.historyfile))
if __name__ == '__main__':
(options, arguments) = getopt.getopt(sys.argv[1:], "lnpuvV?")