summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/util.c
AgeCommit message (Collapse)Author
2009-03-24use size_t for size, since atomicio() both accepts and returns itJoris Vink
2009-02-23unused varJoris Vink
2009-02-23we no longer push out Set-sticky to the client when writingJoris Vink
our Tag file on the server or in cvs_mkpath(), this caused problems for the "fast checkout" mechanism when a tag was supplied. instead, write out any directory sticky tag when we are checking out a file in that directory, this way we can use our "fast checkout" mechanism (no /tmp required) even for -r and -d without breaking working copies because they were missing CVS/Tag files. "looks good" tobias@
2009-02-21in cvs_mkpath() always look for an existing CVS/Repository fileJoris Vink
unless we're running checkout or export. otherwise we'll end up accidently overwriting it in certain cases on the client side of things.
2008-06-21add a hash table mechanism based upon hcreate(3) but one that allowsJoris Vink
us to maintain multiple hash tables concurrently. immediatly start using it to keep track of what directories we have already created and what CVS dirs we already created so we do not recreate them when we do not need to. we will be switching more internals to use this soon. rejoice for cheaper lookups. ok tobias@
2008-06-14don't always re-open the same CVS/Entries file, instead keep theJoris Vink
last opened CVS/Entries around to operate on and close it whenever we switch directory. gives us a small performance boost, obviously. while doing this, switch the way we write revisions to disk by using fwrite(3) so stuff can get written to disk in chunks instead of writing everything line by line, another win. with help from otto@ ok tobias@
2008-06-12completely kill the need for TMP_DIR when running checkout,Joris Vink
which gives us better performance among other things. this is however disabled in a few cases: 1) whenever you run checkout over an existing tree (which acts as update) 2) whenever you specify -d or a module alias we're planning on enabling this behaviour for case 2 in the future. anoncvs sysadmins now love us even more. ok tobias@
2008-06-10New trigger framework that allows us to run the required scriptsJoris Vink
defined in CVSROOT/commitinfo and CVSROOT/loginfo and so on. This enables the use of log_accum2 and all that other nice stuff we like. This was mostly written by Jonathan Armani with help from tobias@ and myself. ok tobias@
2008-03-09be sure to build CVS/Root when updating and building directories (-d)Joris Vink
2008-03-09be sure to create CVS/Root if we added a new directory to the repository.Joris Vink
2008-03-08CVS/Entries file must be created in cvs_mkadmin, because they have to beTobias Stoeckmann
available in empty directories too (containing only "D" then). ok joris
2008-03-01do not overwrite CVS/Root in an existing tree whenever somebodyJoris Vink
specified a CVSROOT using alternate ways (-d or CVSROOT environ variable)
2008-02-10use cvs_validate_directory() in cvs_get_repository_path() as well,Joris Vink
since we want to make sure we have valid CVS/Repository content ok tobias@
2008-02-10introduce cvs_validate_directory(), which is used to checkJoris Vink
directory path to make sure they do not fall outside the CVSROOT or the working copy directory in a remote setup
2008-02-10Respond with "Updated" instead of "Checked-in" on server-side if a clientTobias Stoeckmann
committed files, so keywords are expanded properly. On client-side, we have to be careful about Directory ./ when it comes to commits, so add a test for CVS_OP_COMMIT. OK and help from joris@
2008-02-10- cvs_write_tagfile() is not responsible to remove CVS/Tag itselfJoris Vink
- construct right CVS/Repository paths in cvs_mkpath() fixes remote Issues;
2008-02-09Introduce cvs_ent_line_str() - formats CVS/Entries lines.Xavier Santolaria
OK tobias@.
2008-02-09unused var police, biatsh!Joris Vink
2008-02-09if the CVS/ directory already exists when we reach cvs_mkadmin()Joris Vink
we will definatly need to recreate it with the correct information. otherwise sucessive checkouts of the same module with other arguments (like -rOPENBSD_X_X or -D "3 years ago") will not store the correct information.
2008-02-04more CVSROOT/modules stuff:Joris Vink
- support for -i flag: Run "prog" on "cvs commit" from top-level of module. - fix some memory leaks in modules.c - pass the line number from cvs_read_config() towards the callbacks so its easier to print out where it's going wrong, if it ever does. OK tobias@
2008-02-04Stripped off 'nb', which was (or was supposed to be) used to distinguishTobias Stoeckmann
between a named branch and a revision number supplied by -r. This can be done easier in cvs_write_tagfile directly. OK joris@
2008-02-03better CVSROOT/module support, includes remote support and modulesJoris Vink
that are not aliases (-a); OK tobias@
2008-01-31free RCSNUM's when we are done with them;Joris Vink
ok tobias@
2008-01-31Zap trailing whitespaces.Xavier Santolaria
2008-01-31Rework of cvs_get_repository_name.Tobias Stoeckmann
checkout is allowed to continue if CVS/Repository does not exist. export and import are not supposed to open CVS/Repository. All other commands -- if CVS_USE_WDIR is set -- must fatal if it does not exist. OK joris@
2008-01-31Our directory entries in CVS/Entries had one slash too much -- zapped.Tobias Stoeckmann
OK xsa@
2008-01-21Fixed export to be fully functional and compliant to GNU cvs in local andTobias Stoeckmann
remote setups. OK xsa@
2008-01-10xmalloc + memset -> xcallocTobias Stoeckmann
2008-01-10another strcspn() roundTobias Stoeckmann
2008-01-10cvs_mkpath missed to add all "yet to be added" directories into CVS/Entries,Tobias Stoeckmann
thus making further access to these subdirectories rather difficult.
2007-10-09cvs import must not parse files in local CVS directory.Tobias Stoeckmann
OK niallo@
2007-10-05strcspn() changeGilles Chehade
was okay'd by pyr@ and ok by millert@
2007-09-22better branching/sticky tag support, no branch commits yet though.Joris Vink
2007-09-19Do not parse quoted strings because GNU cvs won't do so.Tobias Stoeckmann
OK joris@
2007-09-19Usage of fgetln() instead of fgets() in .cvsrc parsing handles lineTobias Stoeckmann
numbers better and allows longer command arguments. OK joris@
2007-09-09Added support for checkout -p with local repository.Tobias Stoeckmann
OK joris@
2007-09-04Removed dead code.Tobias Stoeckmann
OK joris@, ray@
2007-09-02Handle quotation marks in .cvsrc correctly.Tobias Stoeckmann
OK joris@
2007-07-19xcalloc is unneeded here since i is always 0 and we always use theRay Lai
memory after initializing it. Initial diff from Igor Zinovik. OK niallo and xsa.
2007-07-03Rework the way opencvs works in relation to files in the Attic/:Joris Vink
Previously, files in the 'Attic/' were linked into our filelist as being 'Attic/filename,v' this caused unneeded stress on certain functions like cvs_file_classify() who had to do pointer voodoo to split out the 'Attic/' part and do other very weird stuff to normalize the pathname of these files. Instead, we handle these files early in the start when we build the fileslist in cvs_repository_getdir(). When encountering the 'Attic/' directory, we recurse in it if required but instead of using the 'Attic/' directory component as our base directory we stick with the directory name where 'Attic/' resides in, resulting in the correct filename while maintaining the correct RCSpath for the file. This made the following things a lot easier: (and in most cases actually fixed the below points) - status with files in Attic/. - checking out HEAD repositories with files in Attic/. - checking out repositories with -rTAG. - updating with -rTAG. and as an added bonus the following now also works: - correctly creating CVS/Tag in both local and remote mode thus allowing update/status/and more to work correctly with the tagged tree. (thanks to the correct handling of -rTAG cases). - resetting tags with opencvs -A properly works too now. This is a major step forward into the usability of OpenCVS when it comes to maintaining multiple tagged trees, the next logical step would be to fix commiting to branches. enjoy you -stable cowards. tested by myself, xsa, niallo and ckuethe thanks guys!
2007-05-29Since xrealloc dies on failure it is safe to directly assign to theRay Lai
original pointer. Theo agrees, and so does the rest of the tree (ssh, etc. all do this already). Saves a bunch of variables and assignments. OK niallo@
2007-05-27Fix off-by-one, from Tobias Stoeckmann.Ray Lai
OK niallo@
2007-05-09cvs_splitpath() isn't used anymore; from Tobias Stoeckmann.Xavier Santolaria
2007-04-20- correct signal handling and process waiting for the EDITOR support codeXavier Santolaria
(From ray's code in sendbug(1)) - nuke cvs_exec() as it is not used anymore Prompted by deraadt@ a few weeks ago. OK ray@.
2007-02-22general includes cleanup sweep. ok joris@ niallo@Otto Moerbeek
2007-02-19Fix const inconsistencies, void pointer artithmetic and a few otherOtto Moerbeek
things. now gcc -Wall and lint are more happy. ok joris@ xsa@
2007-02-17cvs_path_cat() removal since we can now easily handle thatXavier Santolaria
functionality w/ xsnprintf(); Initial diff started by thib@. OK thib@ joris@.
2007-02-07fstat() -> lstat() in a few select cases,Todd T. Fries
this fixes a bug where opencvs update would abort if a link existed that pointed to a non-existent file/dir ok joris@
2007-01-26Handle CVS/Entries and file timestamp correctly so we doJoris Vink
not mistakenly see a file as Modified while it is not. As a result, we can remove the very hackish cvs_hack_time() and GNU cvs and opencvs should almost get along now. lotsa help and okay The otto@
2007-01-25plug a memleak in keyword expansion.Niall O'Higgins
ok joris@