croak("malformed comment")
if not self.comment.endswith("\n"):
self.comment += "\n"
- # Because it's going to be handed back as a shell argument
- self.comment = "'" + self.comment.replace("'", r"'\''") + "'"
def content(self):
"Reurn the edited comment."
return self.comment
do_or_die("rcs -q -U -kb -i {0} </dev/null && mv {0},v {1}".format(arg, repodir))
def checkin(self, arg, comment):
"Check in a commit, with comment."
- # Relies on caller to escape comment string. By unlocking the
- # file before checkin we invoke the following property
- # described on the rcs(1) manual page: "If rev is omitted and
- # the caller has no lock, but owns the file and locking is not
- # set to strict, then the revision is appended to the default
- # branch (normally the trunk; see the -b option of rcs(1))."
- # This is the behavior we want and why locking is set to non-strict.
+ comment = "'" + comment.replace("'", r"'\''") + "'"
+ # By unlocking the file before checkin we invoke the following
+ # property described on the rcs(1) manual page: "If rev is
+ # omitted and the caller has no lock, but owns the file and
+ # locking is not set to strict, then the revision is appended
+ # to the default branch (normally the trunk; see the -b option
+ # of rcs(1))." This is the behavior we want and why locking
+ # is set to non-strict.
do_or_die("rcs -q -U -u {0},v && ci -l -m{1} {0}".format(arg, comment))
def checkout(self, arg, revision):
"Check out a revision. Leaves it writeable."
def amend(self, arg, rev, comment):
"Amend a commit comment."
# Relies on caller to escape comment string
+ comment = "'" + comment.replace("'", r"'\''") + "'"
do_or_die("rcs -m{0}:{1} {2}".format(rev, comment, arg))
def cat(self, arg, revision, fn=""):
"Ship the contents of a revision to stdout or a named file."