@staticmethod
def master(filename):
"Return the master file corresponding to a specified filename."
- return "RCS/%s,v" % filename
- def modify(self, path, mode, copy):
+ parts = os.path.split(filename)
+ parts.insert(-1, "RCS")
+ return os.path.join(parts)
+ def modify(self, event, path, mode, copyfile):
"Perform RCS file checkins and modifications,"
rcsdir = os.path.join(os.path.dirname(path), "RCS")
if not os.path.exists(rcsdir):
try:
- os.mkdir(rcsdir)
+ os.makdirs(rcsdir)
except OSError:
raise FatalException("can't create %s." % rcsdir)
+ workdir = os.path.dirname(filename)
+ masterfile = RCS.master(filename)
+ exists = os.path.exists(path)
+ shutil.copy(copyfile, workdir)
+ exists = os.path.exists(path)
+ if exists:
+ fp = do_or_die("ci -m '%s'" % (event.comment))
def rename(self, source, target):
- "Preform RCS renames."
+ "Perform RCS renames."
# Dodgy, but since user is more likely to be
# interested in later versions this is better
# than doing nothing.
os.rename(RCS.master(op.source), RCS.master(op.target))
def copy(self, source, target):
- "Preform RCS copies."
+ "Perform RCS copies."
# The copy will get the original's history.
# There's a case that what we ought to do instead
# is check out the tip rev and use it to initialize
if verbose:
announce("%5d M %s" % (i+1, op.path))
if not dryrun:
- vcs.modify_file(op.path, op.mode, op.copyname)
+ vcs.modify_file(event,
+ op.path, op.mode, op.copyname)
elif op.op in ("D", "deleteall"):
# If we delete masters, we lose ability to
# retrieve old versions.