⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sccs.me

📁 早期freebsd实现
💻 ME
📖 第 1 页 / 共 3 页
字号:
.\" Copyright (c) 1986, 1993.\"	The Regents of the University of California.  All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"	@(#)sccs.me	8.1 (Berkeley) 6/8/93.\".eh '\fRPSD:14-%\fP''\fRAn Introduction to the Source Code Control System\fP'.oh '\fRAn Introduction to the Source Code Control System\fP''\fRPSD:14-%\fP'.ds S \s-1SCCS\s0.ds I \s-1SID\s0.nr bi 8n.ev 1			\" only for keeps.ss 16.ev.\".he '\*S Introduction''%'.+c.(l C.sz 14.bAn Introduction to theSource Code Control System.sz.r.spEric Allman.i "Project Ingres".i "University of California at Berkeley".)l.sp 3.pp.(fThis is version 1.21 of this document.It was last modified on 12/5/80..)fThis document gives a quick introductionto using the Source Code Control System(\*S).The presentation is geared to programmerswho are more concerned withwhatto do to get a task donerather than how it works;for this reason some of the examplesare not well explained.For details of what the magic options do,see the section on.q "Further Information" ..(l FThis is a working document.Please send any comments or suggestionsto eric@Berkeley.Edu..)l.sh 1 "Introduction".pp\*S is a source management system.Such a system maintains a record of versions of a system;a record is kept with each set of changesof what the changes are,why they were made,and who made them and when.Old versions can be recovered,and different versions can be maintained simultaneously.In projects with more than one person,\*S will insure that two people are notediting the same file at the same time..ppAll versions of your program,plus the log and other information,is kept in a file called the.q "s-file" .There are three major operationsthat can be performed on the s-file:.npGet a file for compilation (not for editing).This operation retrieves a version of the filefrom the s-file.By default, the latest version is retrieved.This file is intended for compilation, printing, or whatever;it is specifically NOT intended to be editedor changed in any way;any changes made to a file retrievedin this way will probably be lost..npGet a file for editing.This operation also retrieves a version of the filefrom the s-file,but this file is intended to be edited and thenincorporated back into the s-file.Only one person may be editing a file at one time..npMerge a file back into the s-file.This is the companion operation to (2).A new version number is assigned,and comments are saved explaining why this change was made..sh 1 "Learning the Lingo".ppThere are a number of terms that are worth learningbefore we go any farther..sh 2 "S-file".ppThe s-fileis a single file that holds all the different versionsof your file.The s-file is stored indifferential format;.i i.e. ,only the differences between versions are stored,rather than the entire text of the new version.This saves disk spaceand allows selective changes to be removed later.Also included in the s-fileis some header information for each version,including the comments given by the person whocreated the version explaining why the changes were made..sh 2 "Deltas".ppEach set of changes to the s-file(which is approximately [but not exactly!] equivalentto a version of the file)is called a.i delta .Although technically a delta only includes the.i changesmade,in practiceit is usual foreach delta to be made with respect toall the deltas that have occurred before\**..(f\**This matches normal usage, where the previous changes are not savedat all,so all changes are automatically based on all other changesthat have happened through history..)fHowever,it is possible to get a version of the filethat has selected deltas removed out of the middleof the list of changes \*-equivalent to removing your changes later..sh 2 "\*I's (or, version numbers)".ppA \*I(\*S Id)is a number that represents a delta.This is normally a two-part numberconsisting of a.q releasenumber and a.q levelnumber.Normally the release number stays the same,however,it is possible to move into a new releaseif some major change is being made..ppSince all past deltas are normally applied,the \*I of the final delta appliedcan be used to represent a version number of the fileas a whole..sh 2 "Id keywords".ppWhen you get a version of a filewith intent to compile and install it(\c.i i.e. ,something other than edit it),some special keywords are expanded inlineby \*S.These.i "Id Keywords"can be used to include the current version numberor other information into the file.All id keywords are of the form.b % \c.i x \c.b % ,where.i xis an upper case letter.For example,.b %\&I\&%is the \*I of the latest delta applied,.b %\&W\&%includes the module name,\*I,and a mark that makes it findable by a program,and.b %\&G\&%is the date of the latest delta applied.There are many others,most of which are of dubious usefulness..ppWhen you get a file for editing,the id keywords are not expanded;this is so that after you put them back in to the s-file,they will be expanded automatically on each new version.But notice: if you were to get themexpanded accidently,then your file would appear to be the same versionforever more,which would of course defeat the purpose.Also,if you should install a version of the programwithout expanding the id keywords,it will be impossible to tell what version it is(since all it will have is.q %\&W\&%or whatever)..sh 1 "Creating \*S Files".ppTo put source filesinto\*Sformat, run the following shell script from csh:.(bmkdir SCCS saveforeach i (*.[ch])	sccs admin \-i$i $i	mv $i save/$iend.)bThis will put the named filesinto s-filesin the subdirectory.q SCCSThe files will be removed from the current directoryand hidden away in the directory.q save ,so the next thing you will probably want to dois to get all the files(described below).When you are convinced that\*S has correctly created the s-files,you should remove the directory.q save ..ppIf you want to have id keywords in the files,it is best to put them in before you create the s-files.If you do not,.i adminwill print.q "No Id Keywords (cm7)" ,which is a warning message only..sh 1 "Getting Files for Compilation".ppTo get a copy of the latest versionof a file,run.(bsccs get prog.c.)b\*S will respond:.(b1.187 lines.)bmeaning that version 1.1 was retrieved\**.(f\**Actually,the \*I of the final delta applied was 1.1..)fand that it has 87 lines.The file.i prog.cwill be createdin the current directory.The file will be read-onlyto remind you that you are notsupposed to change it..ppThis copy of the fileshould not be changed,since \*S is unableto merge the changesback into the s-file.If you do make changes,they will be lost the next timesomeone does a.i get ..sh 1 "Changing Files (or, Creating Deltas)".sh 2 "Getting a copy to edit".ppTo edit a source file,you must first get it,requesting permission to edit it\**:.(f\**The.q "edit"command is equivalent to using the \-eflag to.i "get" ,as:.(lsccs get \-e prog.c.)lKeep this in mind when reading other documentation..)f.(bsccs edit prog.c.)bThe response will be the same as with.i getexcept that it will also say:.(bNew delta 1.2.)bYou then edit it,using a standard text editor:.(bvi prog.c.)b.sh 2 "Merging the changes back into the s-file".ppWhen the desired changes are made,you can put your changes into the\*Sfile using the.i deltacommand:.(bsccs delta prog.c.)b.ppDelta will prompt you for.q "comments?"before it merges the changes in.At this prompt you should type a one-line descriptionof what the changes mean(more lines can be entered by ending each lineexcept the last with a backslash\**)..(f\**Yes, this is a stupid default..)f.i Deltawill then type:.(b1.25 inserted3 deleted84 unchanged.)bsaying that delta 1.2 was created,and it inserted five lines,removed three lines,and left 84 lines unchanged\**..(f\**Changes to a line are counted as a line deletedand a line inserted..)fThe.i prog.cfile will be removed;it can be retrievedusing.i get ..sh 2 "When to make deltas".ppIt is probably unwise to make a deltabefore every recompilation or test;otherwise,you tend to get a lot of deltas with comments like.q "fixed compilation problem in previous delta"or.q "fixed botch in 1.3" .However,it is very important to delta everythingbefore installing a module for general use.A good technique is to edit the files you need,make all necessary changes and tests,compiling and editing as often as necessarywithout making deltas.When you are satisfied that you have a working version,delta everything being edited,re-get them,and recompile everything..sh 2 "What's going on: the info command".ppTo find out what files where being edited,you can use:.(bsccs info.)bto print out all the files being editedand other information such as the name of the userwho did the edit.Also,the command:.(bsccs check.)bis nearly equivalent to the.i infocommand,except that it is silent if nothing is being edited,and returns non-zero exit status if anything is being edited;it can be used in an.q installentry in a makefileto abort the installif anything has not been properly deltaed..ppIf you know that everything being edited should be deltaed,you can use:.(bsccs delta \`sccs tell\`.)bThe.i tellcommand is similar to.i infoexcept that only the names of files being editedare output,one per line..ppAll of these commands take a.b \-bflagto ignore.q branches(alternate versions, described later)and the.b \-uflag to only give files being edited by you.The.b \-uflag takes an optional.i userargument,giving only files being edited by that user.For example,.(bsccs info \-ujohn.)bgives a listing of files being edited by john..sh 2 "ID keywords".ppId keywords can be inserted into your filethat will be expanded automatically by.i get .For example,a line such as:.(bstatic char SccsId[] = "%\&W\&%\et%\&G\&%";.)bwill be replaced with something like:.(bstatic char SccsId[] = "@\&(#)prog.c	1.2	08/29/80";.)bThis tells youthe name and versionof the source fileand the time the delta was created.The string.q "@\&(#)"is a special stringwhich signals the beginningof an\*SId keyword..sh 3 "The what command".ppTo find out what version of a programis being run,use:.(bsccs what prog.c /usr/bin/prog.)bwhich will print all stringsit finds thatbegin with.q "@\&(#)" .This works on all types of files,including binaries and libraries.For example, the above command will output something like:.(bprog.c:	prog.c	1.2	08/29/80/usr/bin/prog:	prog.c	1.1	02/05/79.)bFrom this I can seethat the source that I have in prog.cwill not compile into the same versionas the binary in /usr/bin/prog..sh 3 "Where to put id keywords".ppID keywords can be inserted anywhere,including in comments,butId Keywords that are compiled into the object moduleare especially useful,since it lets you find out what version ofthe object is being run,as well as the source.However,there is a cost:data space is used up to storethe keywords,and on small address space machinesthis may be prohibitive..ppWhen you put id keywords into header files,it is important that you assign them to different variables.For example, you might use:.(bstatic char AccessSid[] = "%\&W\&%	%\&G\&%";.)bin the file.i access.hand:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -