summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/file.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* typojoris2007-01-201-2/+2
|
* more safety checks for file->file_rcsrev;joris2007-01-201-2/+2
| | | | 'cool' niallo@
* check return value of rcs_translate_tag(). prevents a segfault found by todd@. still need to fix tag translation though.niallo2007-01-201-4/+5
| | | | ok joris@
* When we hit a DT_UNKNOWN for dirent->d_type in our filelist functions,joris2007-01-191-14/+48
| | | | | | | | | | | | | stat() the filepath to get the correct type, and therefor add it to the appropriate list. This fixes opencvs with CVSROOTs on NFS and AFS, because they both return D_UNKNOWN for directories (afs even for files too) in dirent->d_type. problem found by thib@ and todd@ tested by thib@, todd@, ok niallo@
* move things around in rcs_rev_getbuf() and rcs_rev_write_fd()joris2007-01-141-4/+2
| | | | | | | | | | | so that we do keyword expansion on-the-fly if required instead of obtaining the revision in memory first, running over the revision lines while expanding keywords and only then writing them to the fd or memory buffer. this drasticly decreases cpu usage by opencvs on very large trees (like src). OK niallo@
* make a copy of cf->file_ent->ce_rev in cf->file_rcsrev when neededjoris2007-01-131-4/+5
| | | | | otherwise we might get a NULL dereference when free'ing the cf struct with cvs_file_free()
* major re-work of the RCS api. this results in 100x performance improvements in some places and muchniallo2007-01-121-2/+2
| | | | | | | | | reduced memory usage. note that only checkout has been fully converted to use the new high-performance functions. other codepaths (e.g. update) still use the old method which is provided for backwards compatibility. we can convert the remaining slow bits over to the new api piece-by-piece. "commit this, now" joris@ brad@ tested, too.
* do not leak memory from rcs_head_get()joris2007-01-121-1/+3
| | | | ok niallo@
* add a cvs_file_copy routine and use it for the edit command toxsa2007-01-101-1/+83
| | | | | copy the file in the current working directory to CVS/Base/ ok ray@ joris@.
* add cvs_base_handle() routine to handle the CVS/Baserev* files.xsa2007-01-061-4/+2
| | | | | first bits for the edit command for now. definitly still more work to do for optimization...
* - introduce file comparison routine, cvs_file_cmp().xsa2007-01-051-1/+65
| | | | | | - compare the <file> in working dir and the one in CVS/Base/<file> for the unedit command. hints otto@, input and ok ray@ niallo@.
* Check len to be > 0 before accessing buf[len-1] and check if themoritz2006-10-251-6/+6
| | | | | | | last character in the string returned by fgets(3) is '\n' before blindly overwriting it. OK and input from xsa@
* first part of opencvs remote, fairly useable on existing treesjoris2006-07-071-2/+2
| | | | | | | | | | | | | | although i advise against using it on real development trees for now. only a few commands work right so far: - commit - diff - status - log - update (partially working) if you feel like testing remote and run into bugs feel free to contact me, and please include a full trace (-t).
* kill local and remote callback and just have one called fileproc.joris2006-06-191-5/+5
| | | | | | we let the commands pass the correct function. all in preparation for remote.
* simplify cvs_hack_time() and the way it is called;joris2006-06-141-4/+1
|
* add cvs_buf_load_fd() which does the same as cvs_buf_load()joris2006-06-141-3/+2
| | | | | | | | | | except it takes a decriptor as argument instead of a path. modified cvs_buf_load() to open the descriptor then pass it to cvs_buf_load_fd(). change all the calls to cvs_buf_load() that have a descriptor open for the path to cvs_buf_load_fd() to prevent races.
* add support for update -A and update -r<rev>.joris2006-06-031-1/+3
| | | | | | | | hacking on the plane from toronto to barbados. i will probably hack some more since im stuck in barbados for 12 lovely hours over night cause the carribean airlines dont understand the meaning over 'more than one flight a day'.
* various spelling fixesdavid2006-06-021-2/+2
|
* major rewrite of some rcs parsing stuff:joris2006-06-011-2/+3
| | | | | | | | | | | | | | - rework rcs_getrev() to correctly support branches - rework rcs_translate_tag() to correctly translate given symbols or branches into their matching revisions - rework rcs_rev_add() to correctly update its 'next' pointers and insert the new revision in the correct place on the list. - rework rcs_head_get() to return the latest revision on the default branch if it has been set or the normal HEAD revision otherwise. - no longer access the rf_head member of the RCSFILE struct manually, use the rcs_head_get() function which correctly returns the HEAD revision, there might be a default branch that has to be used. - for now, when commiting a new revision reset the default branch.
* allow commit to ressurect added files that exist in Attic/joris2006-05-311-7/+5
|
* only look into the Attic for certain commandsjoris2006-05-301-3/+5
|
* fill in the correct revision number we will want in file_rcsrevjoris2006-05-301-7/+14
| | | | | for each cvs_file struct, this will help us with sticky tags, commiting to branches and importing into existing repositories.
* look inside the Attic if a specified RCS file cannot be foundjoris2006-05-301-4/+21
| | | | | | in the normal repository, and a way to identify an RCS file in the Attic in the RCSFILE struct. will come in handy later on.
* hello import, only works for non-existing repositories right now,joris2006-05-301-4/+7
| | | | but work is in progress for importing stuff into existing repositories.
* i was wrong adding ".*" to the default ignore patterns,joris2006-05-291-2/+1
| | | | so remove it from there again.
* if the timestamp of the file has changed andjoris2006-05-291-1/+21
| | | | | | | | | no longer matches the timestamp in the CVS/Entries file, be sure to compare the file contents to the revision contents to be positive the file actually changed. otherwise we would see a file as modified if somebody would for example open it in vi and simply :wq it.
* Fix engrish, okay joris@pedro2006-05-281-3/+3
|
* add basic 'cvs log' support.joris2006-05-281-2/+11
|
* several fixes to the file api:joris2006-05-281-5/+10
| | | | | | | | | | | | - default to CVS_FILE when something is totally unknown - cvs_get_repository_path() now returns the full repository path for the given argument. - cvs_get_repository_name() returns the contents of CVS/Repository to the caller. - allow command callbacks to specify if our recursion code needs to skip the directory or not. - when checking for a admin directory, make sure it is in fact a directory. if it is not we dont want to recurse inside.
* add rf_dead field to RCSFILE which can tell usjoris2006-05-281-1/+3
| | | | if an RCSFILE is dead, will come in usefull later in commands.
* if we run into a file that was suppose to be a directoryjoris2006-05-281-1/+15
| | | | | or a directory that is suppose to be a file, abort right away because something bad probably happened.
* allow commands to shut up the output from cvs_file_classifyjoris2006-05-281-16/+18
| | | | if the commands want to output certain stuff themselfs
* more standard ignore patternjoris2006-05-271-1/+2
|
* remove debug outputjoris2006-05-271-2/+1
|
* allow commands to respect the -l flag, if the -l flag isjoris2006-05-271-8/+23
| | | | | | | specified certain commands will not recurse into directories. at the same time introduce a method of specifying wether or not a command should look in the repository for files.
* use RCS_STATE_DEAD instead of plain old 'dead' when checkingjoris2006-05-271-2/+2
| | | | the RCS file its state.
* commit the new opencvs code, i have been hacking onjoris2006-05-271-1115/+501
| | | | | | | | | | | | this for the past 2 weeks now and it should go in at the start of the hackathon so others can help out. this code is a lot safer, smarter, faster and best of all it is actually doing what it is suppose to do! basic checkout, update, status, diff and commit are working in local mode only. there is no support for any remote setups now.
* remove a metric buttload of excessive ()deraadt2006-04-141-23/+23
| | | | no binary change; ok ray
* Use variable names for sizeof, remove casts in front of xmalloc,ray2006-04-051-9/+4
| | | | | | use xcalloc and xstrdup where appropriate, and other stuff. OK joris@
* spacing;joris2006-04-021-9/+1
|
* #include's cleanup; ok joris@ niallo@.xsa2006-01-021-15/+2
|
* only xfree() cf->cf_dir when it's not NULL;joris2005-12-121-2/+4
|
* switch to xmalloc stuff, me and xsa@ agreed on this a longjoris2005-12-101-97/+32
| | | | | | | | | time ago, but we were being held back by jfb. too bad for him. next step is to use fatal() through out the code for unrecoverable errors instead of trying to be all nice and fluffy and reach main() again. ok niallo@ and xsa@
* more code cleanup, remove useless flags and parts of codejoris2005-12-041-4/+1
| | | | that never got used in the first place;
* fix date handling in opencvs, this was broken since the very start.joris2005-12-031-1/+10
| | | | | | | now, when you checkout a tree with gnu cvs, opencvs no longer sees all the files as modified, and visa versa. this actually makes gnu cvs and opencvs dance together in working copies.
* remove unused and useless functions, they just get in the way;joris2005-12-031-17/+1
|
* add very basic support for the following stuff:joris2005-12-031-4/+68
| | | | | | | | | | | | | | | | | | | | | - checkout in local mode (example: /cvs) - update in local and server mode (example: /cvs and user@host:/cvs) - import in local and server mode (example: /cvs and user@host:/cvs) what remains to be done: - not all options are supported yet, and update cannot pick up newly added files yet. these things are pending and will be commited real soon. - checkout only works locally right now. - fix rcs parsing code so that we don't fucking hog 100% cpu on really BIG BIG BIG ass trees. mainly tested by pedro@ and myself, thanks a lot pedro! "go for it" niallo@
* - remove strtab stuff. serves no useful purpose.niallo2005-11-121-10/+9
| | | | | diff is from joris@, committing on his behalf because his net connection is very dodgy right now.
* if cvs_file_loadinfo fails, return failure to the caller insteadjoris2005-10-271-2/+2
| | | | | | | | | of acting like everything went fine. this fixes eternal loops in the client which waits for data from the server while the server waits for data from the client. problem found and fixed by Nuno Morgadinho, thanks!
* less 'pirates of the carribean' like error message;joris2005-10-161-2/+2
|