From: Eric S. Raymond Date: Sat, 8 Nov 2014 15:59:48 +0000 (-0500) Subject: Eliminate byte-stuffing. X-Git-Tag: 0.2~20 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=33a1e1a463dcf0454fc6e275ffd6101cbba28af4;p=src.git Eliminate byte-stuffing. --- diff --git a/src b/src index 808cd1e..f529d5c 100755 --- a/src +++ b/src @@ -123,6 +123,7 @@ class RCSLog: self.name = name self.revlist = [] self.symbols = {} + self.delimiter = None if not os.path.exists(master(self.name)): croak("%s is not registered" % self.name) with popen_or_die("cd %s >/dev/null; rlog %s 2>/dev/null; cd ..>/dev/null" % (repodir, name)) as fp: @@ -437,19 +438,22 @@ def commit_method(*args): elif not os.path.exists(master(arg)): croak("%s is not registered." % arg) else: + metadata = RCSLog(arg) + sys.stderr.write("Foo! %s\n" % arg) if not comment: editor = os.getenv("EDITOR") or "emacsclient" commentfile = "/tmp/src%dtmp" % os.getpid() do_or_die(editor + " " + commentfile, loud=True) comment = open(commentfile).read() + if metadata.delimiter in comment: + croak("malformed comment") if not comment.endswith("\n"): comment += "\n" - comment = "." + comment.replace("\n", "\n.")[:-1] comment = comment.replace("'", r"\'") with lifted(arg): do_or_die("ci -l -m'{1}' {0}".format(arg, comment)) if not quiet and len(args) > 1: - announce("%s -> %d" % (arg, len(RCSLog(arg)))) + announce("%s -> %d" % (arg, len(metadata))) def list_method(*args): "Generate a summary listing of commits, one line per commit."