summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/co.c
AgeCommit message (Collapse)Author
2007-02-27As done in OpenCVS, general includes cleanup sweep. OK otto@.Xavier Santolaria
2007-02-22If a ,suffix file is given as an arg to ci and co, strip it. AvoidsOtto Moerbeek
potential disasters. Initial diff from niallo@, ok niallo@ joris@
2007-02-21make sure checkout_rev() sets correct file permissions via file->rf_modeNiall O'Higgins
in case where fstat() of file->rf_fd won't give us right mode. fixes PR #5383 ok xsa@
2007-02-18keep correct permissions on the RCS file when locking/unlocking the fileXavier Santolaria
with ci and co. fixes PR 5379. OK millert@ joris@.
2007-02-01When checking to see if a checked-out copy of the file is the sameTodd C. Miller
as what is in the repo, expand keywords before doing the diff. OK xsa@
2006-11-10Unlike GNU rcs, our co will not overwrite an existing file, evenTodd C. Miller
if the existing file is not writable. While safer, this can be annoying. I've changed things to compare the version of the file being checked out with its current contents and, if they are the same, to allow the checkout without user intervention. The behavior when there is a writable version of the file is unchanged. OK xsa@
2006-11-09Simplify stripping of write bits from file mode.Todd C. Miller
Add support for reusing the checkin message for multiple files, ala GNU Fix the message when you abort a checkout and the file was not writable. OK joris@ niallo@
2006-10-12- convert some warnx() to warn(), which fixes a few stupidly un-informative ↵Niall O'Higgins
error messages (found by tom@) - make rcs_choosefile() save wrt errno, input from ray@ ok joris@ xsa@
2006-08-07More strlcpy/strlcat -> snprintf/xasprintf cleanup.Ray Lai
OK joris@
2006-08-01Reduce rcs_buf_release() usage, improving binary support.Ray Lai
OK niallo@
2006-06-03- correctly handle binary files; say bye bye to using c strings for deltatexts.Niall O'Higgins
"slap it in" joris@
2006-05-28Remove a lot of xstrdup() calls in getopt() loops, which are usuallyRay Lai
unnecessary. These xstrdup() calls don't call xfree() before anyway, so if a flag is given multiple times memory leaks would have resulted. OK joris@
2006-05-27Rename RCSFILE.fd to RCSFILE.rf_fd, plus minor spacing nits. NoRay Lai
binary change. OK xsa@
2006-05-27Remove rcs_statfile(). It was just a wrapper for rcs_choosefile(),Ray Lai
handling exceptions oddly. OK joris@
2006-05-17fix printf'sXavier Santolaria
2006-05-11fix informative msg's wrt to -q and stderr. now matches gnu/usr.bin/rcs.Xavier Santolaria
2006-05-09Remove /* NOTREACHED */ comments, now that lint is smart aboutRay Lai
__dead. I never should have put them there. OK xsa@.
2006-05-05o GNU ci returns 0 when a file is reverted (co -l file; ci file).Ray Lai
o Don't unlock file after revert. o Fix spelling. Passes extra tests in GNU rcstest. OK niallo@.
2006-04-29Check return values for all strlcpy, and strlcat calls.Ray Lai
OK xsa@ and probably others.
2006-04-26prevent file races by obtaining an fd for the RCS file andJoris Vink
do our operations on that, this is safe and guarantees we can operate on the file until we close(2) it. a fix is coming for the remaining races in our diff code. okay niallo@ and ray@
2006-04-26fork our code we shared between openrcs/cvs into the openrcs dir.Joris Vink
this was starting to become inhuman to maintain without ugly ugly hacks in the shared code, and it will be easier to make specific changes for openrcs without touching the soon-to-be-replaced opencvs code.
2006-04-25fatal() -> err()/errx() as we try to not depend on heavy cvs_log().Xavier Santolaria
OK joriski.
2006-04-24be consistent in error messages for wrongly specified keyword substitutionXavier Santolaria
mode for `-k'.
2006-04-21move shared functions into rcsutil.[ch]; this makes rcsprog.c cleaner;Xavier Santolaria
"the voices in my head say OK!" joris@.
2006-04-21remove overkill cvs_log() and rather use warn()/warnx().Xavier Santolaria
OK ray@ and discussed with joris@.
2006-04-21switch -p handling to bitwise flags; OK ray@.Xavier Santolaria
2006-04-19switch -q handling to bitwise flags; OK ray@ niallo@.Xavier Santolaria
2006-04-15Plug some memory leaks; ok niallo@Patrick Latifi
2006-04-14excessive addition to brackets is a mental disease. you will goTheo de Raadt
blind, too. seek help. no binary change, ok joris
2006-04-13correctly handle RCS files without any revisions;Joris Vink
original diff from ray@, crafted into shape by myself. okay ray@
2006-04-13*** empty log message ***Ray Lai
2006-04-12spacesTheo de Raadt
2006-04-12Clean up <rev> handling. Whenever a revision is specified after aRay Lai
flag, it calls one of two new functions: rcs_setrevstr() or rcs_setrevstr2(). rcs_setrevstr() sets a string to another string, and complains if it was set more than once. rcs_setrevstr2() takes two strings, sets one after the other, and fatal()s if more than two strings were given. All <rev> handling is now done in the loop that goes through each argv. This is necessary for parsing symbols, which will be much easier after this. Along the way a lot of memory leaks were cleaned up. There is one area where rcs_set_rev() is called, which allocates a RCSNUM and stores it in pb.newrev, but it segfaults whenever I try to rcsnum_free() it. I put an /* XXX */ comment there for now. Passes regression tests and the code is less complicated in some ways (to me). Suggestions and OK xsa@
2006-04-10change rcs_kwexp_set() return type to void and simplify its use. OK niallo@.Xavier Santolaria
2006-04-09- don't print out warnings about locking when they are actually wrong andNiall O'Higgins
just confuse the user. ok and input joris@
2006-04-06-z can take no argument.Xavier Santolaria
2006-03-30first part of supporting branches in openrcs. right now we can onlyJoris Vink
check them out. commit is not working yet, but will be soon. tested by myself and ray@ okay ray@
2006-03-29More closely matches GNU behavior, passes more GNU rcstest tests.Ray Lai
OK niallo@
2006-03-27- properly implement GNU file modes. basically, checkout will inheritNiall O'Higgins
permissions from rcs file and initial checkin will inherit permissions from working file. problem spotted by uwe@ ok ray@ xsa@
2006-03-24Allow the -x flag to be used without an extension.Ray Lai
``that makes sense'' xsa@
2006-03-17- co usage() says we support -I, so set the flags and revision.Niall O'Higgins
ok xsa@
2006-03-16- checkout_rev() can fail, in which case we want a non-zero exit code.Niall O'Higgins
ok joris@
2006-03-16error message fix; respect -q too. Ok ray@.Xavier Santolaria
2006-03-16Follow exit() with /* NOTREACHED*/ for lint.Ray Lai
``OK niallo@'' niallo@
2006-03-16Currently co(1) overwrites files that the current user doesn't haveRay Lai
write permissions for. If you own the directory, that means your existing file, mode 000, is blown away without prompting you. GNU RCS does this as well. This fixes changes co(1) to always prompt if a file exists. This breaks GNU compatibility but I think it's more important that we prevent co(1) from overwriting files with strict permissions without even prompting. ``makes sense'' xsa to an earlier diff
2006-03-15- use shared cvs_yesno() for yesno prompt, fixing an issue spotted byNiall O'Higgins
deraadt@ - while here, remove unecessary cast also spotted by deraadt@ ok ray@ xsa@
2006-03-07-z support for RCS;Joris Vink
2006-03-06missing informative message after call to checkout_rev().Xavier Santolaria
2006-03-06should also have removed those newlines in previous commit.Xavier Santolaria
2006-03-06missing newline in checkout_rev(); spotted by joris@.Xavier Santolaria