summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/file.c
AgeCommit message (Collapse)Author
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-26add support for cvs rlog.Niall O'Higgins
from Mickey. ok joris@ ray@
2007-06-04remove a fatal i committed by accident.Niall O'Higgins
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-02-22general includes cleanup sweep. ok joris@ niallo@Otto Moerbeek
2007-02-21Simplify cvs_buf_differ(). Also cvs_buf_differ(), a comparisonRay Lai
function, should not do any resource freeing. OK joris@.
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-09correctly skip invalid entries when usingJoris Vink
getdirentries(2). ok otto@
2007-02-09remove the cvs_file_classify() `loud' argument, it was usedJoris Vink
in the old school days and serves no purpose what so ever now. otto@ mentioned this to me a while ago
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-31snprintf() -> xsnprintf()Xavier Santolaria
2007-01-29no longer spit out that you can add new files using 'cvs add',Joris Vink
it is pretty obvious on itself. ok niallo@ xsa@
2007-01-28remove debug printfs that sneaked in.Joris Vink
2007-01-28add merging support in both local and remote sides.Joris Vink
tested by many, thanks.
2007-01-27missed a case for CVS_CMD_ADD from last commitJoris Vink
2007-01-27by default let cvs_file_classify complain about certain casesJoris Vink
and fix some warnings that should not come up for certain commands. ok niallo@ otto@
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-25use more stack allocations for fixed size buffers. ok xsa@ joris@Otto Moerbeek
2007-01-23Don't fatal() when unexpected files are encountered in the workingRay Lai
copy. Allows obj/ directories to exist (which are typically symlinks.) OK joris@
2007-01-20typoJoris Vink
2007-01-20more safety checks for file->file_rcsrev;Joris Vink
'cool' niallo@
2007-01-20check return value of rcs_translate_tag(). prevents a segfault found by ↵Niall O'Higgins
todd@. still need to fix tag translation though. ok joris@
2007-01-19When we hit a DT_UNKNOWN for dirent->d_type in our filelist functions,Joris Vink
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@
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-13make a copy of cf->file_ent->ce_rev in cf->file_rcsrev when neededJoris Vink
otherwise we might get a NULL dereference when free'ing the cf struct with cvs_file_free()
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-10add a cvs_file_copy routine and use it for the edit command toXavier Santolaria
copy the file in the current working directory to CVS/Base/ ok ray@ joris@.
2007-01-06add cvs_base_handle() routine to handle the CVS/Baserev* files.Xavier Santolaria
first bits for the edit command for now. definitly still more work to do for optimization...
2007-01-05- introduce file comparison routine, cvs_file_cmp().Xavier Santolaria
- compare the <file> in working dir and the one in CVS/Base/<file> for the unedit command. hints otto@, input and ok ray@ niallo@.
2006-10-25Check len to be > 0 before accessing buf[len-1] and check if theMoritz Jodeit
last character in the string returned by fgets(3) is '\n' before blindly overwriting it. OK and input from xsa@
2006-07-07first part of opencvs remote, fairly useable on existing treesJoris Vink
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).
2006-06-19kill local and remote callback and just have one called fileproc.Joris Vink
we let the commands pass the correct function. all in preparation for remote.
2006-06-14simplify cvs_hack_time() and the way it is called;Joris Vink
2006-06-14add cvs_buf_load_fd() which does the same as cvs_buf_load()Joris Vink
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.
2006-06-03add support for update -A and update -r<rev>.Joris Vink
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'.
2006-06-02various spelling fixesDavid Krause
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-31allow commit to ressurect added files that exist in Attic/Joris Vink
2006-05-30only look into the Attic for certain commandsJoris Vink
2006-05-30fill in the correct revision number we will want in file_rcsrevJoris Vink
for each cvs_file struct, this will help us with sticky tags, commiting to branches and importing into existing repositories.
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-30hello import, only works for non-existing repositories right now,Joris Vink
but work is in progress for importing stuff into existing repositories.
2006-05-29i was wrong adding ".*" to the default ignore patterns,Joris Vink
so remove it from there again.
2006-05-29if the timestamp of the file has changed andJoris Vink
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.
2006-05-28Fix engrish, okay joris@Pedro Martelletto
2006-05-28add basic 'cvs log' support.Joris Vink
2006-05-28several fixes to the file api:Joris Vink
- 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.
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.