📄 sccs.me
字号:
.(bstatic char OpsysSid[] = "%\&W\&% %\&G\&%";.)bin the file.i opsys.h .Otherwise,you will get compilation errors because.q SccsIdis redefined.The problem with this is that if the header fileis included by many modules that are loaded together,the version number of that header file is includedin the object module many times;you may find it more to your tasteto put id keywords in header filesin comments..sh 2 "Keeping \*I's consistent across files".ppWith some care,it is possible to keep the \*I's consistentin multi-file systems.The trick here is to always.i editall filesat once.The changes can then be madeto whatever files are necessaryand then all files(even those not changed)are redeltaed.This can be done fairly easilyby just specifying the name of the directorythat the \*S files are in:.(bsccs edit SCCS.)bwhich will.i editall files in that directory.To make the delta, use:.(bsccs delta SCCS.)bYou will be prompted for comments only once..sh 2 "Creating new releases".ppWhen you want to create a new releaseof a program,you can specify the release number you want to createon the.i editcommand.For example:.(bsccs edit \-r2 prog.c.)bwill cause the next delta to be in release two(that is,it will be numbered 2.1).Future deltas will automatically be in release two.To change the release numberof an entire system,use:.(bsccs edit \-r2 SCCS.)b.sh 1 "Restoring Old Versions".sh 2 "Reverting to old versions".ppSuppose that after delta 1.2was stableyou made and released a delta 1.3.But this introduced a bug,so you made a delta 1.4 to correct it.But 1.4 was still buggy,and you decided you wanted to go backto the old version.You couldrevert to delta 1.2by choosing the \*I in a get:.(bsccs get \-r1.2 prog.c.)bThis will produce a version of.i prog.cthat is delta 1.2that can be reinstalled so that work can proceed..ppIn some cases you don't knowwhat the \*I of the delta you want is.However,you can revert to the version of the programthat was running as of a certain dateby using the.b \-c(cutoff) flag.For example,.(bsccs get \-c800722120000 prog.c.)bwill retrieve whatever version was currentas of July 22, 1980at 12:00 noon.Trailing components can be stripped off(defaulting to their highest legal value),and punctuation can be inserted in the obviousplaces;for example,the above line could be equivalently stated:.(bsccs get \-c"80/07/22 12:00:00" prog.c.)b.sh 2 "Selectively deleting old deltas".ppSuppose that you later decidedthat you liked the changes in delta 1.4,but that delta 1.3 should be removed.You could do this by.i excludingdelta 1.3:.(bsccs edit \-x1.3 prog.c.)bWhen delta 1.5 is made,it will include the changes madein delta 1.4,but will exclude the changes madein delta 1.3.You can exclude a range of deltasusing a dash.For example,if you want to get rid of 1.3 and 1.4you can use:.(bsccs edit \-x1.3\-1.4 prog.c.)bwhich will exclude all deltas from 1.3 to 1.4.Alternatively,.(bsccs edit \-x1.3\-1 prog.c.)bwill exclude a range of deltasfrom 1.3 to the current highest delta in release 1..ppIn certain cases when using.b \-x(or.b \-i ;see below)there will be conflictsbetween versions;for example, it may be necessaryto both include and deletea particular line.If this happens,\*S always prints out a messagetelling the range of lines effected;these lines should then be examined very carefullyto see if the version \*S gotis ok..ppSince each delta(in the sense of.q "a set of changes" )can be excluded at will,that this makes it most usefulto put each semantically distinct changeinto its own delta..sh 1 "Auditing Changes".sh 2 "The prt command".ppWhen you created a delta,you presumably gave a reason for the deltato the.q "comments?"prompt.To print out these comments later,use:.(bsccs prt prog.c.)bThis will producea reportfor each deltaof the \*I,time and date of creation,user who created the delta,number of lines inserted, deleted, and unchanged,and the comments associated with the delta.For example, the output of the above command might be:.(bD 1.2 80/08/29 12:35:31 bill 2 1 00005/00003/00084removed "-q" option.sp \n(psuD 1.1 79/02/05 00:19:31 eric 1 0 00087/00000/00000date and time created 80/06/10 00:19:31 by eric.)b.sh 2 "Finding why lines were inserted".ppTo find outwhy you inserted lines,you can get a copy of the filewith each linepreceded by the \*I that created it:.(bsccs get \-m prog.c.)bYou can then find outwhat this delta didby printing the comments using.i prt ..ppTo find out what lines are associated with a particular delta(\c.i e.g. ,1.3),use:.(bsccs get \-m \-p prog.c \(bv grep \'^1.3\'.)bThe.b \-pflag causes \*S to output the generated sourceto the standard output rather than to a file..sh 2 "Finding what changes you have made".ppWhen you are editing a file,you can find out what changes you have made using:.(bsccs diffs prog.c.)bMost of the ``diff'' flags can be used.To pass the.b \-cflag,use.b \-C ..ppTo compare two versions that are in deltas,use:.(bsccs sccsdiff -r1.3 -r1.6 prog.c.)bto see the differences between delta 1.3 and delta 1.6..sh 1 "Shorthand Notations".ppThere are several sequences of commands that getexecuted frequently..i Sccstries to make it easy to do these..sh 2 "Delget".ppA frequent requirement is to make a delta of some fileand then get that file.This can be done by using:.(bsccs delget prog.c.)bwhich is entirely equivalent to using:.(bsccs delta prog.csccs get prog.c.)bThe.q deleditcommand is equivalent to.q delgetexcept that the.q editcommand is usedinstead of the.q getcommand..sh 2 "Fix".ppFrequently, there are small bugsin deltas,e.g., compilation errors,for which there is no reason to maintain an audit trail.To.i replacea delta, use:.(bsccs fix \-r1.4 prog.c.)bThis will get a copy of delta 1.4 of prog.c for you to editand then delete delta 1.4 from the \*S file.When you do a delta of prog.c,it will be delta 1.4 again.The \-r flag must be specified,and the delta that is specified must be a leaf delta,i.e., no other deltas may have been made subsequentto the creation of that delta..sh 2 "Unedit".ppIf you found you edited a filethat you did not want to edit,you can back out by using:.(bsccs unedit prog.c.)b.sh 2 "The \-d flag".ppIf you are working on a projectwhere the \*S code is in a directory somewhere,you may be able to simplify thingsby using a shell alias.For example,the alias:.(balias syssccs sccs \-d/usr/src.)bwill allow you to issue commands such as:.(bsyssccs edit cmd/who.c.)bwhich will look for the file.q "/usr/src/cmd/SCCS/who.c" .The file.q who.cwill always be created in your current directoryregardless of the value of the \-d flag..sh 1 "Using \*S on a Project".ppWorking on a project with several peoplehas its own set of special problems.The main problem occurs when two peoplemodify a file at the same time.\*S prevents this by locking an s-filewhile it is being edited..ppAs a result,files should not be reserved for editingunless they are actually being edited at the time,since this will prevent other people on the projectfrom making necessary changes.For example,a good scenario for working might be:.(bsccs edit a.c g.c t.cvi a.c g.c t.c# do testing of the (experimental) versionsccs delget a.c g.c t.csccs info# should respond "Nothing being edited"make install.)b.ppAs a general rule,all source files should be deltaedbefore installing the program for general use.This will insure that it is possibleto restore any version in use at any time..sh 1 "Saving Yourself".sh 2 "Recovering a munged edit file".ppSometimes you may findthat you have destroyed or trasheda file that you were trying to edit\**..(f\**Or given up and decided to start over..)fUnfortunately,you can't just remove itand re-\c.i editit;\*S keeps trackof the factthat someone is trying to edit it,so it won't let you do it again.Neither can you just get it using.i get ,since that would expand the Id keywords.Instead,you can say:.(bsccs get \-k prog.c.)bThis will not expand the Id keywords,so it is safe to do a deltawith it..ppAlternately,you can.i uneditand.i editthe file..sh 2 "Restoring the s-file".ppIn particularly bad circumstances,the \*S file itselfmay get munged.The most common way this happensis that it gets edited.Since \*S keeps a checksum,you will get errors every time you read the file.To fix this checksum, use:.(bsccs admin \-z prog.c.)b.sh 1 "Using the Admin Command".ppThere are a number of parameters that can be setusing the.i admincommand.The most interesting of these are flags.Flags can be added by using the.b \-fflag.For example:.(bsccs admin \-fd1 prog.c.)bsets the.q dflag to the value.q 1 .This flag can be deleted by using:.(bsccs admin \-dd prog.c.)bThe most useful flags are:.nr ii 7n.ip "b"Allow branches to be made using the\-bflag to.i edit ..ip "d\fISID\fP"Default \*I to be used on a.i getor.i edit .If this is just a release numberit constrains theversionto a particular release only..ip "i"Give a fatal errorif there are no Id Keywords in a file.This is useful to guarantee that a version of thefile does not get merged into the s-filethat has the Id Keywords inserted as constantsinstead of internal forms..ip "y"The.q typeof the module.Actually,the value of this flag is unused by \*Sexcept that it replaces the.b %\&Y\&%keyword..ppThe.b \-t\fIfile\fRflag can be usedto store descriptive textfrom.i file .This descriptive text might be the documentationor a design and implementation document.Using the.b \-tflag insures that if the \*S file is sent,the documentation will be sent also.If.i fileis omitted,the descriptive text is deleted.To see the descriptive text,use.q "prt \-t" ..ppThe.i admincommand can be used safelyany number of times on files.A file need not be gottenfor.i adminto work..sh 1 "Maintaining Different Versions (Branches)".ppSometimes it is convenientto maintain an experimental version of a programfor an extended periodwhile normal maintenance continueson the version in production.This can be done using a.q branch.Normally deltas continue in a straight line,each depending on the delta before.Creating a branch.q "forks off"a version of the program..ppThe ability to create branchesmust be enabled in advance using:.(bsccs admin \-fb prog.c.)bThe.b \-fbflag can be specified when the\*S file is first created..sh 2 "Creating a branch".ppTo create a branch, use:.(bsccs edit \-b prog.c.)bThis will create a branchwith (for example) \*I 1.5.1.1.The deltas for this versionwill be numbered1.5.1.\c.i n ..sh 2 "Getting from a branch".ppDeltas in a branch are normally not includedwhen you do a get.To get these versions,you will have to say:.(bsccs get \-r1.5.1 prog.c.)b.sh 2 "Merging a branch back into the main trunk".ppAt some point you will have finished the experiment,and if it was successfulyou will want to incorporate it into the release version.But in the meantimesomeone may have created a delta 1.6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -