]> thyrsus.com Git - src.git/commitdiff
Further in an unlocked direction. All regression tests pass.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 11 Nov 2014 05:32:44 +0000 (00:32 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 11 Nov 2014 05:32:44 +0000 (00:32 -0500)
src

diff --git a/src b/src
index 38743d7c8cf3b858f08270e129322cfb4af3c3ca..f9214cffbb49b86552719018051f57fd6c4fe5b4 100755 (executable)
--- a/src
+++ b/src
@@ -940,8 +940,14 @@ class RCS:
         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
-        do_or_die("ci -l -m{1} {0}".format(arg, 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.
+        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."
         do_or_die("rm -f {0} && rcs -q -u {0},v && co -q -l{1} {0}".format(arg, revision))