History log of /openbsd-current/usr.bin/cvs/repository.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.26 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 31-May-2017 joris

When unlocking a directory only unlock the given one rather then all repo_locks.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.24 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.23 23-Jul-2010 ray

Rename a bunch of variables and functions, removing the cvs_/rcs_
prefixes to reduce differences between cvs and rcs files.

"yes!" nicm


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.22 26-Mar-2009 joris

fix the way Attic is handled in our recursion code, so we
do not skip files or run over them twice.

also fixes -l and -r for checkout/update when a file in
Attic exists with that tag that in HEAD is a directory
in the normal repository like gnu/usr.bin/gcc/INSTALL.

as a bonus, we do not run fstat() twice per file or dir
anymore...

spotted by deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.21 21-Feb-2009 joris

use file_flags for 2 more reasons:
- mark a file as being inside the Attic/
- mark a file as existing in the working copy
(both in local and remote mode)

this way we no longer will need to check if cf->fd == -1 and
think about wether or not we are in local or remote mode.


Revision tags: OPENBSD_4_4_BASE
# 1.20 09-Mar-2008 joris

proper repository locking:
- all read operations now look for a lock, and wait if present but never
try to lock the tree themselfs anymore.
- all write operations lock the tree where needed.
- commit locks all relevant directories before even attempting to start.


Revision tags: OPENBSD_4_3_BASE
# 1.19 03-Feb-2008 joris

shuffle some stuff around so we dont end up doing the same things
twice in cvs_module_lookup() and checkout_check_directory();

allow single files to be ignored with ! as well;


# 1.18 03-Feb-2008 joris

more CVSROOT/module stuff:

- allow more then 1 module to be specified per definition
- respect the "!" sign which means: "hey ignore this dir when checking out"
- non alias definitions can now contain files

ok tobias@


# 1.17 31-Jan-2008 tobias

On repository-side, only parse files which end with ,v (RCS_FILE_EXT).
File name ",v" is ignored, too -- in opposite to weird GNU cvs that tries
to create a file without name.

OK joris@


# 1.16 10-Jan-2008 tobias

Don't ignore files and directories due to patterns on repository-side,
these patterns should only be applied on working directories.

This finally enables a fully working "cvs checkout src" (but don't expect
all checkout options to work, too).


# 1.15 22-Sep-2007 joris

better branching/sticky tag support, no branch commits yet though.


Revision tags: OPENBSD_4_2_BASE
# 1.14 03-Jul-2007 joris

Rework the way opencvs works in relation to files in the Attic/:

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!


# 1.13 01-Jun-2007 niallo

add support for local and remote branch checkout. for example,
cvs co -rOPENBSD_3_0 works now.
along the way, simplify and rationalise code and fix a few nits.

ok joris@ xsa@ ray@


Revision tags: OPENBSD_4_1_BASE
# 1.12 22-Feb-2007 otto

general includes cleanup sweep. ok joris@ niallo@


# 1.11 17-Feb-2007 xsa

cvs_path_cat() removal since we can now easily handle that
functionality w/ xsnprintf(); Initial diff started by thib@.
OK thib@ joris@.


# 1.10 07-Feb-2007 todd

fstat() -> lstat() in a few select cases,
this fixes a bug where opencvs update would abort if a link existed that
pointed to a non-existent file/dir
ok joris@


# 1.9 25-Jan-2007 otto

use more stack allocations for fixed size buffers. ok xsa@ joris@


# 1.8 19-Jan-2007 joris

When we hit a DT_UNKNOWN for dirent->d_type in our filelist functions,
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@


# 1.7 11-Dec-2006 xsa

Permit checkout from a read-only repository using the -R global option
or using the CVSREADONLYFS environment variable.
Request/test/ok todd@. Man page bits courtesy of jmc@.


# 1.6 28-Nov-2006 xsa

snprintf() -> cvs_path_cat()


# 1.5 10-Nov-2006 xsa

no magic, "Attic" -> CVS_PATH_ATTIC


Revision tags: OPENBSD_4_0_BASE
# 1.4 14-Jun-2006 joris

zap myuid variable, it is not used for anything usefull.


# 1.3 02-Jun-2006 david

various spelling fixes


# 1.2 27-May-2006 joris

allow commands to respect the -l flag, if the -l flag is
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.


# 1.1 27-May-2006 joris

commit the new opencvs code, i have been hacking on
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.


Revision tags: OPENBSD_6_2_BASE
# 1.25 31-May-2017 joris

When unlocking a directory only unlock the given one rather then all repo_locks.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.24 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.23 23-Jul-2010 ray

Rename a bunch of variables and functions, removing the cvs_/rcs_
prefixes to reduce differences between cvs and rcs files.

"yes!" nicm


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.22 26-Mar-2009 joris

fix the way Attic is handled in our recursion code, so we
do not skip files or run over them twice.

also fixes -l and -r for checkout/update when a file in
Attic exists with that tag that in HEAD is a directory
in the normal repository like gnu/usr.bin/gcc/INSTALL.

as a bonus, we do not run fstat() twice per file or dir
anymore...

spotted by deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.21 21-Feb-2009 joris

use file_flags for 2 more reasons:
- mark a file as being inside the Attic/
- mark a file as existing in the working copy
(both in local and remote mode)

this way we no longer will need to check if cf->fd == -1 and
think about wether or not we are in local or remote mode.


Revision tags: OPENBSD_4_4_BASE
# 1.20 09-Mar-2008 joris

proper repository locking:
- all read operations now look for a lock, and wait if present but never
try to lock the tree themselfs anymore.
- all write operations lock the tree where needed.
- commit locks all relevant directories before even attempting to start.


Revision tags: OPENBSD_4_3_BASE
# 1.19 03-Feb-2008 joris

shuffle some stuff around so we dont end up doing the same things
twice in cvs_module_lookup() and checkout_check_directory();

allow single files to be ignored with ! as well;


# 1.18 03-Feb-2008 joris

more CVSROOT/module stuff:

- allow more then 1 module to be specified per definition
- respect the "!" sign which means: "hey ignore this dir when checking out"
- non alias definitions can now contain files

ok tobias@


# 1.17 31-Jan-2008 tobias

On repository-side, only parse files which end with ,v (RCS_FILE_EXT).
File name ",v" is ignored, too -- in opposite to weird GNU cvs that tries
to create a file without name.

OK joris@


# 1.16 10-Jan-2008 tobias

Don't ignore files and directories due to patterns on repository-side,
these patterns should only be applied on working directories.

This finally enables a fully working "cvs checkout src" (but don't expect
all checkout options to work, too).


# 1.15 22-Sep-2007 joris

better branching/sticky tag support, no branch commits yet though.


Revision tags: OPENBSD_4_2_BASE
# 1.14 03-Jul-2007 joris

Rework the way opencvs works in relation to files in the Attic/:

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!


# 1.13 01-Jun-2007 niallo

add support for local and remote branch checkout. for example,
cvs co -rOPENBSD_3_0 works now.
along the way, simplify and rationalise code and fix a few nits.

ok joris@ xsa@ ray@


Revision tags: OPENBSD_4_1_BASE
# 1.12 22-Feb-2007 otto

general includes cleanup sweep. ok joris@ niallo@


# 1.11 17-Feb-2007 xsa

cvs_path_cat() removal since we can now easily handle that
functionality w/ xsnprintf(); Initial diff started by thib@.
OK thib@ joris@.


# 1.10 07-Feb-2007 todd

fstat() -> lstat() in a few select cases,
this fixes a bug where opencvs update would abort if a link existed that
pointed to a non-existent file/dir
ok joris@


# 1.9 25-Jan-2007 otto

use more stack allocations for fixed size buffers. ok xsa@ joris@


# 1.8 19-Jan-2007 joris

When we hit a DT_UNKNOWN for dirent->d_type in our filelist functions,
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@


# 1.7 11-Dec-2006 xsa

Permit checkout from a read-only repository using the -R global option
or using the CVSREADONLYFS environment variable.
Request/test/ok todd@. Man page bits courtesy of jmc@.


# 1.6 28-Nov-2006 xsa

snprintf() -> cvs_path_cat()


# 1.5 10-Nov-2006 xsa

no magic, "Attic" -> CVS_PATH_ATTIC


Revision tags: OPENBSD_4_0_BASE
# 1.4 14-Jun-2006 joris

zap myuid variable, it is not used for anything usefull.


# 1.3 02-Jun-2006 david

various spelling fixes


# 1.2 27-May-2006 joris

allow commands to respect the -l flag, if the -l flag is
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.


# 1.1 27-May-2006 joris

commit the new opencvs code, i have been hacking on
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.