summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcs.c
AgeCommit message (Collapse)Author
2007-09-13Added annotate support for local and remote repositories. Behaves likeTobias Stoeckmann
GNU cvs but is a little faster. OK joris@, ray@, xsa@
2007-09-07Sprinkle some magic so checkout/update -p worksJoris Vink
in both local and server mode. OK tobias@
2007-08-27typo in error msg; from Igor Zinovik.Xavier Santolaria
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-06-28Sync revisions and time buffers size to be consistent with each others.Xavier Santolaria
Simplifies further size tweaks if needed. OK niallo@ ray@.
2007-06-01add support for local and remote branch checkout. for example,Niall O'Higgins
cvs co -rOPENBSD_3_0 works now. along the way, simplify and rationalise code and fix a few nits. ok joris@ xsa@ ray@
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-26add support for Mdocdate rcs keyword in opencvs too.Niall O'Higgins
also add check for strftime return in date keyword parsing while here. requested by jmc@, 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-04Use the right HEADNAME. Sometimes compiler warnings should not beOtto Moerbeek
ignored. ok xsa@ joris@
2007-02-01When writing an rcs file, create the temp file next to the targetOtto Moerbeek
file and then rename. Avoids inter-filesystem copy and fixes a potential rcs file truncation when the target fileystem becomes full. While there, use fchmod instead of chmod. ok xsa@ joris@
2007-01-26more fixe size buffers on the stack. ok xsa@ joris@Otto Moerbeek
2007-01-26- support [-k mode] for the add commandXavier Santolaria
- do not let the file keyword expension options (-k) disappear from the Entries file when doing a commit/update/checkout - be sure the expension mode gets written to the RCS file when a file is added/committed in the first place problems raised by otto@; tests/ok otto@ and 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 leak if multiple expansions are done on a single line. okOtto Moerbeek
niallo@
2007-01-25plug a memleak in keyword expansion.Niall O'Higgins
ok joris@
2007-01-16sanitize what kind of symbols we can have in symbol names,Joris Vink
tested & found brad@
2007-01-14move things around in rcs_rev_getbuf() and rcs_rev_write_fd()Joris Vink
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@
2007-01-13nuke the the very evil rcs_getrev() stuffJoris Vink
discussed with niallo@
2007-01-13the memleak i thought i had fixed was in fact NOT a leak at allJoris Vink
and caused opencvs to crash so revert, oops?
2007-01-13- better error messagesJoris Vink
- correclty use cvs_tagname, so that the tag from $CVSROOT/config will actually be expanded as a keyword.
2007-01-12major re-work of the RCS api. this results in 100x performance improvements ↵Niall O'Higgins
in some places and much 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.
2007-01-12do not leak memory from rcs_head_get()Joris Vink
ok niallo@
2007-01-12complete binary support for opencvs,Joris Vink
adding/importing binary files now works too partially taken from openrcs
2007-01-11rework opencvs so that we can deal with binary files. previously we assumed ↵Niall O'Higgins
all files were ascii, which broke things in real-world usage. now a checkout of src should work, albeit using lots of memory and cpu. fixing this is the next step. testing by many. ok & some input joris@
2006-12-21- plug memory leak in rcs_parse_delta()Niall O'Higgins
ok joris@ ray@
2006-12-21- plug memory leak in rcs_translate_tag()Niall O'Higgins
ok joris@ ray@
2006-12-21- plug memory leak in rcs_patch_lines()Niall O'Higgins
ok joris@ ray@
2006-12-04- fix crash when doing keyword expansion of zero-length buffers.Niall O'Higgins
ok ray@
2006-08-23pull in latest change from openrcs:Joris Vink
Add missing checks for EOF when parsing rcs file sections. by millert@
2006-08-02Sync CVS's rcs_expand_keywords() and rcs_kwexp_buf() with RCS.Ray Lai
OK niallo@
2006-07-30Sync some whitespace changes from rcs. No binary change.Ray Lai
2006-07-08Remove file mode argument from {cvs|rcs}_buf_write_stmp(). WeRay Lai
always set the temporary file to mode 600, which is already done by mkstemp(). OK joris@ and xsa@ over a month ago.
2006-06-09handle `cvs tag -F'; input && OK joris@.Xavier Santolaria
2006-06-06add support for the -D option of update,Joris Vink
-D allows you to update a file to matching a specified date: opencvs up -D "1 hour ago" foobar will take the first matching revision that was commited 1 hour ago.
2006-06-04lets not stop looking for a branch if the first oneJoris Vink
on the branches list does not match the one we are looking for, it might be further down.
2006-06-04sprinkle -n voodoo over the add, commit and import commands.Joris Vink
2006-06-01major rewrite of some rcs parsing stuff:Joris Vink
- 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.
2006-05-31add support for the export command.Joris Vink
export does exactly the same as checkout except it does not create any administrative (CVS/) directories.
2006-05-31have rcs_translate_tag translate branches too, whichJoris Vink
allows us to completely use branches for diffing, logging, updating, etc.. more branches support coming up!
2006-05-30look inside the Attic if a specified RCS file cannot be foundJoris Vink
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.
2006-05-29add rcs_translate_tag which will translate a specifiedJoris Vink
revision or symbol given to us on the command line into the matching revision in the RCS file (if any);
2006-05-28add rf_dead field to RCSFILE which can tell usJoris Vink
if an RCSFILE is dead, will come in usefull later in commands.
2006-05-27basic support for CVSROOT/config - only supporting the 'tag' andJoris Vink
'umask' keyword right now.
2006-05-27correctly expand keywords when checking out filesJoris Vink
2006-05-27commit the new opencvs code, i have been hacking onJoris Vink
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.
2006-05-01- fix a case in rcs_getrev() handling of branches where variant was not beingNiall O'Higgins
increased and thus no progress could be made in the loop. bug noticed in rcsdiff(1) by sturm@ ok joris@
2006-04-25check rcs_head_set() return value.Xavier Santolaria
2006-04-14spacingTheo de Raadt