11/14/2006Christine Hennig1 Revision Control at W7-X CVS (Subversion) XDV: Christine Hennig

Embed Size (px)

DESCRIPTION

3/3/2016Christine Hennig3 Requirements on code control safeguarding code revisions archiving code be able to have the full history support for cooperative work system should help the way people work together also useful for short and small size code development, even for a single developer

Citation preview

11/14/2006Christine Hennig1 Revision Control at W7-X CVS (Subversion) XDV: Christine Hennig 11/14/2006Christine Hennig2 Motivation - Challenges development of applications at W7X large complex long living maintainers of codes are human-beings; they move forget make mistakes What were the methods we got these results from years ago? 3/3/2016Christine Hennig3 Requirements on code control safeguarding code revisions archiving code be able to have the full history support for cooperative work system should help the way people work together also useful for short and small size code development, even for a single developer 3/3/2016Christine Hennig4 Visions automatical extract documentation as website (e.g. viewcvs students work) access to the work of others access to the work of temporary employees publication rules of MPG: make everything reproducible over a long period of time all diagnostics software code available in one common repository 3/3/2016Christine Hennig5 Concept of versioning systems common space for sources (local or some service) accessible for everyoneinvolved standardized structure sources can be locked (prevent other from changing it) changes have to be saved together with description, author, date and time, versioning systems work together with the operating system (date and time, user, locking) versioning systems know nothing about the programming language, only ASCII text is interpreted 3/3/2016Christine Hennig6 Some systems free products SCCS Source Code Control System RCS Revision Control System CVS Concurrent Versioning System (successor of RCS) SVN Subversion (successor of CVS) commercial products exist 3/3/2016Christine Hennig7 CVS Client und Server w7xu-nfs your computer 3/3/2016Christine Hennig8 CVS repository and working directory w7xu-nfs your computer /usr2/cvsrep C:\Software\module1 CVSROOT module repository local working directory 3/3/2016Christine Hennig9 CVS versioning w7xu-nfs other computer /usr2/cvsrep C:\Software\module1 /afs/ipp/u/crh/module1 your computer entries revisions update commit 3/3/2016Christine Hennig10 CVS diffing 3/3/2016Christine Hennig11 CVS merging 3/3/2016Christine Hennig12 CVS branching 3/3/2016Christine Hennig13 CVS tagging 3/3/2016Christine Hennig14 Who at IPP uses revision control? (incomplete!) CVS (a lot of experience at IPP) diagnosticians (Werner, Turkin, Thomsen et. al.) XDV group (all development) W7X Control Group (all development) Stellarator Theory (common code pieces) subversion Werner SCCS AUG data aquisition group / data access routines (libdddw) 3/3/2016Christine Hennig15 CVS Tips and Tricks use CVS with an integrated development environment tool clarify complex project structures before defining the CVS structure check-in often, more often or very often ask other people you are working together with add at least one line of comment when checking in use automatic CVS keyword substitution inside your code comments CVS does not substitute discussion 3/3/2016Christine Hennig16 GUI-Integration and CVS frontends Screenshots; Thanks to A.Werner, Th. Bluhm and Y. Turkin eclipse jbuilder kde kdevelop cervisia wincvs tortoisecvs 3/3/2016Christine Hennig17 eclipse (1) 3/3/2016Christine Hennig18 eclipse (2) 3/3/2016Christine Hennig19 cervisia 3/3/2016Christine Hennig20 Jbuilder 3/3/2016Christine Hennig21 kde 3/3/2016Christine Hennig22 kdevelop 3/3/2016Christine Hennig23 wincvs 3/3/2016Christine Hennig24 winmerge 3/3/2016Christine Hennig25 tortoise cvs Icons do not work with local working dir in AFS 3/3/2016Christine Hennig26 Major Drawbacks of CVS CVS is file-based, therefore renaming files restructuring projects project interdependencies may become confusing No intuitive possibility for browsing of modules 3/3/2016Christine Hennig27 Status of CVS at IPP repository available at w7xu-nfs:/usr2/cvsrep to participate, contact G. Khner retyping password any time you do any cvs action external contributors yet not supported in progress: automatic documentation via web-browser still open: external cooperation (using pserver; open IP address for external contributors?) 3/3/2016Christine Hennig28 Recommendations If you still not use any code control, you should start immediately using cvs learn with a small project (eventually start with a local repository as sandbox) try to integrate cvs in your usual development environment (see screenshots) put everything under version control fortran, C, java, idl, matlab latex, XML, ps all ASCII worth saving (binary also possible) 3/3/2016Christine Hennig29 Conclusions (1) CVS is a powerful tool for software developers CVS is widely supported a lot of helpful tools, books and web- resources exist try it out, use it regularly additional hands-on session is possible All Wendelstein 7-X Software needs to be maintained in revision control system 3/3/2016Christine Hennig30 Conclusions (2) If you still not use any code control, you should 3/3/2016Christine Hennig31 Addendum resources terms of versioning systems CVS commands CVS keyword substitution 3/3/2016Christine Hennig32 Resources for CVS CVS Homepage of the CVS projectCVS manual for more tricky questionsEine kurze Einfhrung in CVSAusarbeitung Versionskontrollsysteme am Beispiel CVS/RCS (descriptive pictures)dresden.de/svortrag/ai98/Langner / 3/3/2016Christine Hennig33 Resources for Subversion Subversion homepageonline-Buch (descriptive pictures) 3/3/2016Christine Hennig34 Terms of versioning systems (1) repository common space for common data (local or server) local working directory where you work root the path to the repository revision numbers any change of the software release numbers a common status 3/3/2016Christine Hennig35 Terms of versioning systems (2) entries which files are under control commit put local changes into repository update get changes or all from repository merge putting concurrent changes together (automated/by hand) module a part of the system (customizable) 3/3/2016Christine Hennig36 Some CVS commands (1) specification of the cvs root (tcsh) setenv CVSROOT /afs/ipp/xdv/xdv_cvsroot or start every cvs command with cvs d:local:/afs/ipp/xdv/xdv_cvsroot command line short help cvs help / cvs -help topic migration of a source project into local CVS create a local directory and set the CVSROOT to it cvs init cvs import sourcedir version release caution! adds ALL files, evtl. cleanup dir from all non-sources 3/3/2016Christine Hennig37 Some CVS commands (2) creation of a new repository from scratch create a directory and set the CVSROOT to it cvs init add source files (only places the file under control) cvs add source.suffix commit changes (changes are written) cvs commit source.suffix look up the status of file(s) cvs status source.suffix cvs status * 3/3/2016Christine Hennig38 Some CVS commands (3) updating local working directory (getting changes since last check-in) cvs update source.suffix cvs update * cvs get * looking up changes since selected date or revision cvs diff D date1 D date2 source.suffix cvs diff r rev1 r rev2 source.suffix defining a release cvs tag [options] symbolic_tag [files] deleting source files (still available for history) delete the file(s), then cvs remove 3/3/2016Christine Hennig39 CVS keyword substitution Selection of CVS keywords $Author$ The login name of the user who checked in the revision. $Date$ The date and time (UTC) the revision was checked in. $Header$ A standard header containing the full pathname of the RCS file, the revision number, the date (UTC), the author, the state, and the locker (if locked). Files will normally never be locked when you use CVS. (the latter strongly recommended for lazy people ) 3/3/2016Christine Hennig40 How does it work? you put into code inside comment: /* $Header$ */ After the code was under cvs control you get: /* $Header: q:\\xdv_cvsroot/javaDAQ/xdv/MonitorClient. java,v /09/16 11:10:21 crh Exp $ */