summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/ci.c
AgeCommit message (Collapse)Author
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-10Remove (size_t) casts on integer constants.Ray Lai
We should not cover up lint's shortcomings, especially if they no longer exist. ``This is definately good.'' niallo@.
2006-05-09Remove /* NOTREACHED */ comments, now that lint is smart aboutRay Lai
__dead. I never should have put them there. OK xsa@.
2006-05-08check for rcs_diffreg() return value; OK ray@.Xavier Santolaria
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-05-04finish work wrt TMPDIR; use xasprintf() to simplify code while in there;Xavier Santolaria
"looks fine" ray@.
2006-04-29o Simplify ci by using strchr and strcspn instead of custom loops.Ray Lai
o Search for the ending `$' until the end of the line instead of the end of the string. OK niallo@ and xsa@, possibly joris@.
2006-04-29Check return values for all strlcpy, and strlcat calls.Ray Lai
OK xsa@ and probably others.
2006-04-29Clarify man pages to match -t behavior and pretty up usage strings.Ray Lai
OK xsa@ and jmc@.
2006-04-29Make ci store gmtime instead of localtime in RCS files, like GNU.Ray Lai
OK xsa@
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-25quote strings consistently.Xavier Santolaria
2006-04-25fatal() -> err()/errx() as we try to not depend on heavy cvs_log().Xavier Santolaria
OK joriski.
2006-04-25style;Xavier Santolaria
2006-04-24prevent a race by keeping an fd for the workfile around untilJoris Vink
we are finished with it. first one of many to come... okay ray@
2006-04-24o Better match GNU behavior (a bare -t does NOT read from stdin,Ray Lai
unlike rcs). o Share code with rcs by moving rcs_set_description() to rcsutil.c. o Change description prompt from #define to const char *. OK xsa@
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-19switch -q handling to bitwise flags; OK ray@ niallo@.Xavier Santolaria
2006-04-18Combine code to prompt user for input into a shared function,Ray Lai
reducing some complex fats from ci.c. OK joris@
2006-04-18/* FALLTHROUGH */ to share code between the -N and -n flags.Ray Lai
OK joris@
2006-04-18Removes memory leaks when flags are called multiple times. ThisRay Lai
is the easy way out. The code should be able to handle having pb.author, pb.description, and pb.symbol as const char * strings pointing to rcs_optarg values without using xstrdup at all. The code is a bit hairy so it's difficult to verify that it's done correctly, so that'll be a plan for another day. In the meantime, this works. OK joris@
2006-04-18Remove -h flag from rcs_getopt loop, which is not in GNU.Ray Lai
OK xsa@
2006-04-17Relieve checkin_update and checkin_init of the responsibility ofRay Lai
calling rcs_close() so we don't try to rcs_close() the same file twice if the working file does not exist, resulting in a core dump. The current code also returns the status of the last file, so if we do: $ touch file $ ci nonexistent file that will return 0. GNU returns 1. Fix that. Additionally, it returns -1 on error, which turns into 255. It should return 1. OK niallo@
2006-04-16- fix description handling.Niall O'Higgins
ok joris@ xsa@
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-14Fix a typo introduced in rev 1.135; ok ray@Patrick Latifi
2006-04-13Currently rcs_getopt spits out a generic error message if you doRay Lai
`ci -m file'. This changes it so if -m is given without an argument a customized error message is printed. While I was there I sorted the optstring according to style(9). ``Oh, I see it now.'' niallo@
2006-04-13clean up temporary files when we finish running.Joris Vink
"cool" niallo@
2006-04-13fix some typosNiall O'Higgins
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-10make sure we add the correct name mkstemp(3) creates for usJoris Vink
to the worklist of temporary files. this way we definatly don't leave any files behind in /tmp. tested & okay niallo@
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-04-05Use variable names for sizeof, remove casts in front of xmalloc,Ray Lai
use xcalloc and xstrdup where appropriate, and other stuff. OK joris@
2006-04-01- plug a possible memory leak in checkin_update() error path.Niall O'Higgins
ok joris@
2006-03-31spacing;Joris Vink
2006-03-30add temporary files to the worklist before creating them, this preventsJoris Vink
a race when the user would interrupt the program when it was returning from cvs_buf_write_stmp() and leave the temporary files behind.
2006-03-28check rcs_head_set() return value; OK niallo@.Xavier Santolaria
2006-03-28check rcs_sym_remove() return value; OK niallo@.Xavier Santolaria
2006-03-27- simplify checkin_init() and checkin_update() functions by movingNiall O'Higgins
rcs_close() to the checkin_main() loop. "Commitzki!!" ray@
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-27check rcs_lock_remove() return value; OK ray@ niallo@.Xavier Santolaria
2006-03-26- clean up error handling in checkin_init() and checkin_update()Niall O'Higgins
- plug a couple of memory leaks along the way ok ray@