Sometimes, a file under the control of RCS gets modified while it is not locked (= checked out for modification by me).(In these cases, it was actually set read-only by RCS to prevent such modifications; but it might have been a configuration file under /etc/ which was modified because I was upgrading packages.)And then usually I want to nevertheless commit the new modifications, as if the last revision has been checked out before the modification.How is it best to proceed then?I usually use Emacs VC, and do C-x v v to check out and in. But if the file hasn't been checked out beforehand, this fails. Is there a way to proceed specifically from within Emacs? But answers with shell commands are also welcome.
How to commit a modified file if it wasn't locked by RCS beforehand (and I'm using Emacs VC mode)?
emacs
Actually it's much simpler.  You can just do rcs -l to lock it, then try check it back in again.I assume the situation when you asked the question was something like this:$ echo v1 >foo$ ci -u -t-Test file. foo$ chmod u+w foo$ echo v2 >fooAt this point, both ci and co will fail:$ co -l foofoo,v  -->  foorevision 1.1 (locked)writable foo exists; remove it? [ny](n): $ ci -u foofoo,v  <--  fooci: foo,v: no lock set by usernameThis is how you can lock the file and commit the changes:$ rcs -l fooRCS file: foo,v1.1 lockeddone$ ci -u -mSecond revision. foofoo,v  <--  foonew revision: 1.2; previous revision: 1.1done