A simple use of RCS:
RCS in the directory
in which you have saved the module file euler.f90.
module insert the following:
! $Id$ ! $Log$RCS will convert
$Id$ into an identification
string, and it will convert $Log$ into
a history of edits. The text generated automatically
by RCS will be commented out using F90 comment
character, !. RCS knows about F90 files.
contains insert the
following definition:
subroutine euler_version()
write(*,*) '$Id$'
end subroutine euler_version
$ ci euler.f90RCS will respond with something like:
RCS/euler.f90,v <-- euler.f90 new revision: 1.4; previous revision: 1.3 enter log message, terminated with single '.' or end of file: >>Enter a string that describes this version, e.g., ``Initial Revision'', go to the next line and terminate it with a single dot in the first column. Press return again.
euler.f90,v will appear in the RCS directory.
$ co euler.f90
$Id$ and $Log$.
I have gone through 4 revisions of euler.f90 and this is
what the top of my module source file looks like now:
! $Id: euler.f90,v 1.4 1998/09/28 22:55:49 gustav Exp $
! $Log: euler.f90,v $
! Revision 1.4 1998/09/28 22:55:49 gustav
! changed the name of subroutine "version" to "euler_version"
!
! Revision 1.3 1998/09/28 22:43:18 gustav
! Deleted the definition of rcsid and added a verbatim write in
! subroutine "version" instead.
!
! Revision 1.2 1998/09/28 22:40:16 gustav
! Added the definition of subroutine version
!
! Revision 1.1 1998/09/28 22:10:09 gustav
! Initial revision
!
module euler
integer, parameter :: long = selected_real_kind(9,99)
contains
subroutine euler_version()
write(*,*) '$Id: euler.f90,v 1.4 1998/09/28 22:55:49 gustav Exp $'
end subroutine euler_version
real(kind=long) function goodness(a, x)
real (kind=long), intent(in) :: a, x
...
chi:
gustav@blanc:../src 18:05:00 !939 $ make -f Makefile.chi clobber rm -f *.o *.M core rm -f chi gustav@blanc:../src 18:08:01 !940 $ make -f Makefile.chi f90 -g -c euler.f90 f90 -g -c chi.f90 f90 -g -o chi chi.o euler.o gustav@blanc:../src 18:08:15 !941 $
gustav@blanc:../src 18:08:15 !941 $ ident chi
chi:
$Id: euler.f90,v 1.4 1998/09/28 22:55:49 gustav Exp $
gustav@blanc:../src 18:08:54 !942 $ ident euler.o
euler.o:
$Id: euler.f90,v 1.4 1998/09/28 22:55:49 gustav Exp $
gustav@blanc:../src 18:08:57 !943 $
ident searches the binary,
this works both with the linked binary and with the
object file, and retrieves the Id string that is
explicitly embedded in the write
statement of subroutine euler_version.
euler that program chi has been
linked with.
gustav@blanc:../src 17:55:03 !927 $ co -l euler.f90
gustav@blanc:../src 17:55:27 !928 $ rcsdiff euler.f90
gustav@blanc:../src 17:55:44 !929 $ ci euler.f90 RCS/euler.f90,v <-- euler.f90 new revision: 1.4; previous revision: 1.3 enter log message, terminated with single '.' or end of file: >> changed the name of subroutine "version" to "euler_version" >> . done gustav@blanc:../src 17:56:04 !930 $
ci error: no lock set by gustavLocking ensures that while the file is out you're the only person that can make changes to it and check them back in.
.f90
files, i.e., versions that have been checked out without
locking you can clean them away with: gustav@blanc:../src 18:28:23 !945 $ ls -l euler.f90 -r--r--r-- 1 gustav ovpit 5626 Sep 28 17:56 euler.f90 gustav@blanc:../src 18:28:29 !946 $ rcsclean rm -f euler.f90 gustav@blanc:../src 18:28:35 !947 $ ls -l euler.f90 ls: euler.f90: No such file or directory gustav@blanc:../src 18:28:40 !948 $
make knows about RCS . If it does not find
file euler.f90 in its working directory, but
detects an RCS directory with euler.f90,v
in it, it will check that file out automatically:gustav@blanc:../src 18:28:40 !948 $ make -f Makefile.chi co RCS/euler.f90,v euler.f90 RCS/euler.f90,v --> euler.f90 revision 1.4 done f90 -g -c euler.f90 f90 -g -c chi.f90 f90 -g -o chi chi.o euler.o gustav@blanc:../src 18:29:03 !949 $
-r option when calling co and
specify the revision you want: gustav@blanc:../src 18:37:47 !952 $ co -r1.2 euler.f90 RCS/euler.f90,v --> euler.f90 revision 1.2 done gustav@blanc:../src 18:38:01 !953 $ head -5 euler.f90 ! $Id: euler.f90,v 1.2 1998/09/28 22:40:16 gustav Exp $ ! $Log: euler.f90,v $ ! Revision 1.2 1998/09/28 22:40:16 gustav ! Added the definition of subroutine version ! gustav@blanc:../src 18:39:25 !954 $Compare this with:
gustav@blanc:../src 18:39:25 !954 $ rcsclean gustav@blanc:../src 18:40:01 !955 $ co euler.f90 RCS/euler.f90,v --> euler.f90 revision 1.4 done gustav@blanc:../src 18:40:06 !956 $ head -5 euler.f90 ! $Id: euler.f90,v 1.4 1998/09/28 22:55:49 gustav Exp $ ! $Log: euler.f90,v $ ! Revision 1.4 1998/09/28 22:55:49 gustav ! changed the name of subroutine "version" to "euler_version" ! gustav@blanc:../src 18:40:10 !957 $
ci, co, ident,
rcsdiff, and
rcsclean are quite sufficient for every-day use.
man entries describing the whole RCS
system. See rcsintro(1), ci(1), co(1), ident(1), rcs(1),
rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), and rcsfile(5)
for more information.