cvs.texi 514 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778
  1. \input texinfo @c -*-texinfo-*-
  2. @comment Documentation for CVS.
  3. @setfilename cvs.info
  4. @macro copyleftnotice
  5. @noindent
  6. Copyright @copyright{} 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
  7. 2001, 2002, 2003 Free Software Foundation, Inc.
  8. @multitable @columnfractions .12 .88
  9. @item Portions
  10. @item @tab Copyright @copyright{} 1999, 2000, 2001, 2002, 2003 Derek R. Price,
  11. @item @tab Copyright @copyright{} 2002, 2003 Ximbiot <http://ximbiot.com>,
  12. @item @tab Copyright @copyright{} 1992, 1993, 1999 Signum Support AB,
  13. @item @tab and Copyright @copyright{} others.
  14. @end multitable
  15. @ignore
  16. Permission is granted to process this file through Tex and print the
  17. results, provided the printed document carries copying permission
  18. notice identical to this one except for the removal of this paragraph
  19. (this paragraph not being relevant to the printed manual).
  20. @end ignore
  21. Permission is granted to make and distribute verbatim copies of
  22. this manual provided the copyright notice and this permission notice
  23. are preserved on all copies.
  24. Permission is granted to copy and distribute modified versions of this
  25. manual under the conditions for verbatim copying, provided also that the
  26. entire resulting derived work is distributed under the terms of a
  27. permission notice identical to this one.
  28. Permission is granted to copy and distribute translations of this manual
  29. into another language, under the above conditions for modified versions,
  30. except that this permission notice may be stated in a translation
  31. approved by the Free Software Foundation.
  32. @end macro
  33. @comment This file is part of the CVS distribution.
  34. @comment CVS is free software; you can redistribute it and/or modify
  35. @comment it under the terms of the GNU General Public License as published by
  36. @comment the Free Software Foundation; either version 2, or (at your option)
  37. @comment any later version.
  38. @comment CVS is distributed in the hope that it will be useful,
  39. @comment but WITHOUT ANY WARRANTY; without even the implied warranty of
  40. @comment MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  41. @comment GNU General Public License for more details.
  42. @c See ../README for A4 vs. US letter size.
  43. @c When we provided A4 postscript, and people tried to
  44. @c print it on US letter, the usual complaint was that the
  45. @c page numbers would get cut off.
  46. @c If one prints US letter on A4, reportedly there is
  47. @c some extra space at the top and/or bottom, and the side
  48. @c margins are a bit narrow, but no text is lost.
  49. @c
  50. @c See
  51. @c http://www.ft.uni-erlangen.de/~mskuhn/iso-paper.html
  52. @c for more on paper sizes. Insuring that margins are
  53. @c big enough to print on either A4 or US letter does
  54. @c indeed seem to be the usual approach (RFC2346).
  55. @c This document seems to get overfull hboxes with some
  56. @c frequency (probably because the tendency is to
  57. @c sanity-check it with "make info" and run TeX less
  58. @c often). The big ugly boxes just seem to add insult
  59. @c to injury, and I'm not aware of them helping to fix
  60. @c the overfull hboxes at all.
  61. @finalout
  62. @include version.texi
  63. @settitle CVS---Concurrent Versions System v@value{VERSION}
  64. @setchapternewpage odd
  65. @c -- TODO list:
  66. @c -- Fix all lines that match "^@c -- "
  67. @c -- Also places marked with FIXME should be manual
  68. @c problems (as opposed to FIXCVS for CVS problems).
  69. @c @splitrcskeyword{} is used to avoid keyword expansion. It is replaced by
  70. @c @asis when generating info and dvi, and by <i></i> in the generated html,
  71. @c such that keywords are not expanded in the generated html.
  72. @macro splitrcskeyword {arg}
  73. \arg\
  74. @end macro
  75. @iftex
  76. @macro splitrcskeyword {arg}
  77. @asis{}\arg\
  78. @end macro
  79. @end iftex
  80. @ifhtml
  81. @macro splitrcskeyword {arg}
  82. @i{}\arg\
  83. @end macro
  84. @end ifhtml
  85. @ifinfo
  86. @macro splitrcskeyword {arg}
  87. \arg\
  88. @end macro
  89. @end ifinfo
  90. @dircategory GNU Packages
  91. @direntry
  92. * CVS: (cvs). Concurrent Versions System
  93. @end direntry
  94. @dircategory Individual utilities
  95. @direntry
  96. * cvs: (cvs)CVS commands. Concurrent Versions System
  97. @end direntry
  98. @comment The titlepage section does not appear in the Info file.
  99. @titlepage
  100. @sp 4
  101. @comment The title is printed in a large font.
  102. @center @titlefont{Version Management}
  103. @sp
  104. @center @titlefont{with}
  105. @sp
  106. @center @titlefont{CVS}
  107. @sp 2
  108. @center for @sc{cvs} @value{VERSION}
  109. @comment -release-
  110. @sp 3
  111. @center Per Cederqvist et al
  112. @comment The following two commands start the copyright page
  113. @comment for the printed manual. This will not appear in the Info file.
  114. @page
  115. @vskip 0pt plus 1filll
  116. @copyleftnotice
  117. @end titlepage
  118. @comment ================================================================
  119. @comment The real text starts here
  120. @comment ================================================================
  121. @ifnottex
  122. @c ---------------------------------------------------------------------
  123. @node Top
  124. @top
  125. This info manual describes how to use and administer
  126. @sc{cvs} version @value{VERSION}.
  127. @end ifnottex
  128. @ifinfo
  129. @copyleftnotice
  130. @end ifinfo
  131. @c This menu is pretty long. Not sure how easily that
  132. @c can be fixed (no brilliant ideas right away)...
  133. @menu
  134. * Overview:: An introduction to CVS
  135. * Repository:: Where all your sources are stored
  136. * Starting a new project:: Starting a project with CVS
  137. * Revisions:: Numeric and symbolic names for revisions
  138. * Branching and merging:: Diverging/rejoining branches of development
  139. * Recursive behavior:: CVS descends directories
  140. * Adding and removing:: Adding/removing/renaming files/directories
  141. * History browsing:: Viewing the history of files in various ways
  142. CVS and the Real World.
  143. -----------------------
  144. * Binary files:: CVS can handle binary files
  145. * Multiple developers:: How CVS helps a group of developers
  146. * Revision management:: Policy questions for revision management
  147. * Keyword substitution:: CVS can include the revision inside the file
  148. * Tracking sources:: Tracking third-party sources
  149. * Builds:: Issues related to CVS and builds
  150. * Special Files:: Devices, links and other non-regular files
  151. References.
  152. -----------
  153. * CVS commands:: CVS commands share some things
  154. * Invoking CVS:: Quick reference to CVS commands
  155. * Administrative files:: Reference manual for the Administrative files
  156. * Environment variables:: All environment variables which affect CVS
  157. * Compatibility:: Upgrading CVS versions
  158. * Troubleshooting:: Some tips when nothing works
  159. * Credits:: Some of the contributors to this manual
  160. * BUGS:: Dealing with bugs in CVS or this manual
  161. * Index:: Index
  162. @end menu
  163. @c ---------------------------------------------------------------------
  164. @node Overview
  165. @chapter Overview
  166. @cindex Overview
  167. This chapter is for people who have never used
  168. @sc{cvs}, and perhaps have never used version control
  169. software before.
  170. If you are already familiar with @sc{cvs} and are just
  171. trying to learn a particular feature or remember a
  172. certain command, you can probably skip everything here.
  173. @menu
  174. * What is CVS?:: What you can do with @sc{cvs}
  175. * What is CVS not?:: Problems @sc{cvs} doesn't try to solve
  176. * A sample session:: A tour of basic @sc{cvs} usage
  177. @end menu
  178. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  179. @node What is CVS?
  180. @section What is CVS?
  181. @cindex What is CVS?
  182. @cindex Introduction to CVS
  183. @cindex CVS, introduction to
  184. @sc{cvs} is a version control system. Using it, you can
  185. record the history of your source files.
  186. @c -- ///
  187. @c -- ///Those who cannot remember the past are condemned to repeat it.
  188. @c -- /// -- George Santayana
  189. @c -- //////
  190. @c -- Insert history quote here!
  191. For example, bugs sometimes creep in when
  192. software is modified, and you might not detect the bug
  193. until a long time after you make the modification.
  194. With @sc{cvs}, you can easily retrieve old versions to see
  195. exactly which change caused the bug. This can
  196. sometimes be a big help.
  197. You could of course save every version of every file
  198. you have ever created. This would
  199. however waste an enormous amount of disk space. @sc{cvs}
  200. stores all the versions of a file in a single file in a
  201. clever way that only stores the differences between
  202. versions.
  203. @sc{cvs} also helps you if you are part of a group of people working
  204. on the same project. It is all too easy to overwrite
  205. each others' changes unless you are extremely careful.
  206. Some editors, like @sc{gnu} Emacs, try to make sure that
  207. the same file is never modified by two people at the
  208. same time. Unfortunately, if someone is using another
  209. editor, that safeguard will not work. @sc{cvs} solves this problem
  210. by insulating the different developers from each other. Every
  211. developer works in his own directory, and @sc{cvs} merges
  212. the work when each developer is done.
  213. @cindex History of CVS
  214. @cindex CVS, history of
  215. @cindex Credits (CVS program)
  216. @cindex Contributors (CVS program)
  217. @sc{cvs} started out as a bunch of shell scripts written by
  218. Dick Grune, posted to the newsgroup
  219. @code{comp.sources.unix} in the volume 6
  220. release of July, 1986. While no actual code from
  221. these shell scripts is present in the current version
  222. of @sc{cvs} much of the @sc{cvs} conflict resolution algorithms
  223. come from them.
  224. In April, 1989, Brian Berliner designed and coded @sc{cvs}.
  225. Jeff Polk later helped Brian with the design of the @sc{cvs}
  226. module and vendor branch support.
  227. @cindex Source, getting CVS source
  228. You can get @sc{cvs} in a variety of ways, including
  229. free download from the internet. For more information
  230. on downloading @sc{cvs} and other @sc{cvs} topics, see:
  231. @example
  232. http://www.cvshome.org/
  233. http://www.loria.fr/~molli/cvs-index.html
  234. @end example
  235. @cindex Mailing list
  236. @cindex List, mailing list
  237. @cindex Newsgroups
  238. There is a mailing list, known as @w{@code{info-cvs}},
  239. devoted to @sc{cvs}. To subscribe or
  240. unsubscribe
  241. write to
  242. @w{@code{info-cvs-request@@gnu.org}}.
  243. If you prefer a usenet group, the right
  244. group is @code{comp.software.config-mgmt} which is for
  245. @sc{cvs} discussions (along with other configuration
  246. management systems). In the future, it might be
  247. possible to create a
  248. @code{comp.software.config-mgmt.cvs}, but probably only
  249. if there is sufficient @sc{cvs} traffic on
  250. @code{comp.software.config-mgmt}.
  251. @c Other random data is that past attempts to create a
  252. @c gnu.* group have failed (the relevant authorities
  253. @c say they'll do it, but don't), and that tale was very
  254. @c skeptical of comp.software.config-mgmt.cvs when the
  255. @c subject came up around 1995 or so (for one
  256. @c thing, because creating it would be a "reorg" which
  257. @c would need to take a more comprehensive look at the
  258. @c whole comp.software.config-mgmt.* hierarchy).
  259. You can also subscribe to the @code{bug-cvs} mailing list,
  260. described in more detail in @ref{BUGS}. To subscribe
  261. send mail to @code{bug-cvs-request@@gnu.org}.
  262. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  263. @node What is CVS not?
  264. @section What is CVS not?
  265. @cindex What is CVS not?
  266. @sc{cvs} can do a lot of things for you, but it does
  267. not try to be everything for everyone.
  268. @table @asis
  269. @item @sc{cvs} is not a build system.
  270. Though the structure of your repository and modules
  271. file interact with your build system
  272. (e.g. @file{Makefile}s), they are essentially
  273. independent.
  274. @sc{cvs} does not dictate how you build anything. It
  275. merely stores files for retrieval in a tree structure
  276. you devise.
  277. @sc{cvs} does not dictate how to use disk space in the
  278. checked out working directories. If you write your
  279. @file{Makefile}s or scripts in every directory so they
  280. have to know the relative positions of everything else,
  281. you wind up requiring the entire repository to be
  282. checked out.
  283. If you modularize your work, and construct a build
  284. system that will share files (via links, mounts,
  285. @code{VPATH} in @file{Makefile}s, etc.), you can
  286. arrange your disk usage however you like.
  287. But you have to remember that @emph{any} such system is
  288. a lot of work to construct and maintain. @sc{cvs} does
  289. not address the issues involved.
  290. Of course, you should place the tools created to
  291. support such a build system (scripts, @file{Makefile}s,
  292. etc) under @sc{cvs}.
  293. Figuring out what files need to be rebuilt when
  294. something changes is, again, something to be handled
  295. outside the scope of @sc{cvs}. One traditional
  296. approach is to use @code{make} for building, and use
  297. some automated tool for generating the dependencies which
  298. @code{make} uses.
  299. See @ref{Builds}, for more information on doing builds
  300. in conjunction with @sc{cvs}.
  301. @item @sc{cvs} is not a substitute for management.
  302. Your managers and project leaders are expected to talk
  303. to you frequently enough to make certain you are aware
  304. of schedules, merge points, branch names and release
  305. dates. If they don't, @sc{cvs} can't help.
  306. @sc{cvs} is an instrument for making sources dance to
  307. your tune. But you are the piper and the composer. No
  308. instrument plays itself or writes its own music.
  309. @item @sc{cvs} is not a substitute for developer communication.
  310. When faced with conflicts within a single file, most
  311. developers manage to resolve them without too much
  312. effort. But a more general definition of ``conflict''
  313. includes problems too difficult to solve without
  314. communication between developers.
  315. @sc{cvs} cannot determine when simultaneous changes
  316. within a single file, or across a whole collection of
  317. files, will logically conflict with one another. Its
  318. concept of a @dfn{conflict} is purely textual, arising
  319. when two changes to the same base file are near enough
  320. to spook the merge (i.e. @code{diff3}) command.
  321. @sc{cvs} does not claim to help at all in figuring out
  322. non-textual or distributed conflicts in program logic.
  323. For example: Say you change the arguments to function
  324. @code{X} defined in file @file{A}. At the same time,
  325. someone edits file @file{B}, adding new calls to
  326. function @code{X} using the old arguments. You are
  327. outside the realm of @sc{cvs}'s competence.
  328. Acquire the habit of reading specs and talking to your
  329. peers.
  330. @item @sc{cvs} does not have change control
  331. Change control refers to a number of things. First of
  332. all it can mean @dfn{bug-tracking}, that is being able
  333. to keep a database of reported bugs and the status of
  334. each one (is it fixed? in what release? has the bug
  335. submitter agreed that it is fixed?). For interfacing
  336. @sc{cvs} to an external bug-tracking system, see the
  337. @file{rcsinfo} and @file{verifymsg} files
  338. (@pxref{Administrative files}).
  339. Another aspect of change control is keeping track of
  340. the fact that changes to several files were in fact
  341. changed together as one logical change. If you check
  342. in several files in a single @code{cvs commit}
  343. operation, @sc{cvs} then forgets that those files were
  344. checked in together, and the fact that they have the
  345. same log message is the only thing tying them
  346. together. Keeping a @sc{gnu} style @file{ChangeLog}
  347. can help somewhat.
  348. @c FIXME: should have an xref to a section which talks
  349. @c more about keeping ChangeLog's with CVS, but that
  350. @c section hasn't been written yet.
  351. Another aspect of change control, in some systems, is
  352. the ability to keep track of the status of each
  353. change. Some changes have been written by a developer,
  354. others have been reviewed by a second developer, and so
  355. on. Generally, the way to do this with @sc{cvs} is to
  356. generate a diff (using @code{cvs diff} or @code{diff})
  357. and email it to someone who can then apply it using the
  358. @code{patch} utility. This is very flexible, but
  359. depends on mechanisms outside @sc{cvs} to make sure
  360. nothing falls through the cracks.
  361. @item @sc{cvs} is not an automated testing program
  362. It should be possible to enforce mandatory use of a
  363. testsuite using the @code{commitinfo} file. I haven't
  364. heard a lot about projects trying to do that or whether
  365. there are subtle gotchas, however.
  366. @item @sc{cvs} does not have a builtin process model
  367. Some systems provide ways to ensure that changes or
  368. releases go through various steps, with various
  369. approvals as needed. Generally, one can accomplish
  370. this with @sc{cvs} but it might be a little more work.
  371. In some cases you'll want to use the @file{commitinfo},
  372. @file{loginfo}, @file{rcsinfo}, or @file{verifymsg}
  373. files, to require that certain steps be performed
  374. before cvs will allow a checkin. Also consider whether
  375. features such as branches and tags can be used to
  376. perform tasks such as doing work in a development tree
  377. and then merging certain changes over to a stable tree
  378. only once they have been proven.
  379. @end table
  380. @c ---------------------------------------------------------------------
  381. @node A sample session
  382. @section A sample session
  383. @cindex Example of a work-session
  384. @cindex Getting started
  385. @cindex Work-session, example of
  386. @cindex tc, Trivial Compiler (example)
  387. @cindex Trivial Compiler (example)
  388. @c I think an example is a pretty good way to start. But
  389. @c somewhere in here, maybe after the sample session,
  390. @c we need something which is kind of
  391. @c a "roadmap" which is more directed at sketching out
  392. @c the functionality of CVS and pointing people to
  393. @c various other parts of the manual. As it stands now
  394. @c people who read in order get dumped right into all
  395. @c manner of hair regarding remote repositories,
  396. @c creating a repository, etc.
  397. @c
  398. @c The following was in the old Basic concepts node. I don't
  399. @c know how good a job it does at introducing modules,
  400. @c or whether they need to be introduced so soon, but
  401. @c something of this sort might go into some
  402. @c introductory material somewhere.
  403. @ignore
  404. @cindex Modules (intro)
  405. The repository contains directories and files, in an
  406. arbitrary tree. The @dfn{modules} feature can be used
  407. to group together a set of directories or files into a
  408. single entity (@pxref{modules}). A typical usage is to
  409. define one module per project.
  410. @end ignore
  411. As a way of introducing @sc{cvs}, we'll go through a
  412. typical work-session using @sc{cvs}. The first thing
  413. to understand is that @sc{cvs} stores all files in a
  414. centralized @dfn{repository} (@pxref{Repository}); this
  415. section assumes that a repository is set up.
  416. @c I'm not sure that the sentence concerning the
  417. @c repository quite tells the user what they need to
  418. @c know at this point. Might need to expand on "centralized"
  419. @c slightly (maybe not here, maybe further down in the example?)
  420. Suppose you are working on a simple compiler. The source
  421. consists of a handful of C files and a @file{Makefile}.
  422. The compiler is called @samp{tc} (Trivial Compiler),
  423. and the repository is set up so that there is a module
  424. called @samp{tc}.
  425. @menu
  426. * Getting the source:: Creating a workspace
  427. * Committing your changes:: Making your work available to others
  428. * Cleaning up:: Cleaning up
  429. * Viewing differences:: Viewing differences
  430. @end menu
  431. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  432. @node Getting the source
  433. @subsection Getting the source
  434. @cindex Getting the source
  435. @cindex Checking out source
  436. @cindex Fetching source
  437. @cindex Source, getting from CVS
  438. @cindex Checkout, example
  439. The first thing you must do is to get your own working copy of the
  440. source for @samp{tc}. For this, you use the @code{checkout} command:
  441. @example
  442. $ cvs checkout tc
  443. @end example
  444. @noindent
  445. This will create a new directory called @file{tc} and populate it with
  446. the source files.
  447. @example
  448. $ cd tc
  449. $ ls
  450. CVS Makefile backend.c driver.c frontend.c parser.c
  451. @end example
  452. The @file{CVS} directory is used internally by
  453. @sc{cvs}. Normally, you should not modify or remove
  454. any of the files in it.
  455. You start your favorite editor, hack away at @file{backend.c}, and a couple
  456. of hours later you have added an optimization pass to the compiler.
  457. A note to @sc{rcs} and @sc{sccs} users: There is no need to lock the files that
  458. you want to edit. @xref{Multiple developers}, for an explanation.
  459. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  460. @node Committing your changes
  461. @subsection Committing your changes
  462. @cindex Committing changes to files
  463. @cindex Log message entry
  464. When you have checked that the compiler is still compilable you decide
  465. to make a new version of @file{backend.c}. This will
  466. store your new @file{backend.c} in the repository and
  467. make it available to anyone else who is using that same
  468. repository.
  469. @example
  470. $ cvs commit backend.c
  471. @end example
  472. @noindent
  473. @sc{cvs} starts an editor, to allow you to enter a log
  474. message. You type in ``Added an optimization pass.'',
  475. save the temporary file, and exit the editor.
  476. @cindex CVSEDITOR, environment variable
  477. @cindex EDITOR, environment variable
  478. The environment variable @code{$CVSEDITOR} determines
  479. which editor is started. If @code{$CVSEDITOR} is not
  480. set, then if the environment variable @code{$EDITOR} is
  481. set, it will be used. If both @code{$CVSEDITOR} and
  482. @code{$EDITOR} are not set then there is a default
  483. which will vary with your operating system, for example
  484. @code{vi} for unix or @code{notepad} for Windows
  485. NT/95.
  486. @cindex VISUAL, environment variable
  487. In addition, @sc{cvs} checks the @code{$VISUAL} environment
  488. variable. Opinions vary on whether this behavior is desirable and
  489. whether future releases of @sc{cvs} should check @code{$VISUAL} or
  490. ignore it. You will be OK either way if you make sure that
  491. @code{$VISUAL} is either unset or set to the same thing as
  492. @code{$EDITOR}.
  493. @c This probably should go into some new node
  494. @c containing detailed info on the editor, rather than
  495. @c the intro. In fact, perhaps some of the stuff with
  496. @c CVSEDITOR and -m and so on should too.
  497. When @sc{cvs} starts the editor, it includes a list of
  498. files which are modified. For the @sc{cvs} client,
  499. this list is based on comparing the modification time
  500. of the file against the modification time that the file
  501. had when it was last gotten or updated. Therefore, if
  502. a file's modification time has changed but its contents
  503. have not, it will show up as modified. The simplest
  504. way to handle this is simply not to worry about it---if
  505. you proceed with the commit @sc{cvs} will detect that
  506. the contents are not modified and treat it as an
  507. unmodified file. The next @code{update} will clue
  508. @sc{cvs} in to the fact that the file is unmodified,
  509. and it will reset its stored timestamp so that the file
  510. will not show up in future editor sessions.
  511. @c FIXCVS: Might be nice if "commit" and other commands
  512. @c would reset that timestamp too, but currently commit
  513. @c doesn't.
  514. @c FIXME: Need to talk more about the process of
  515. @c prompting for the log message. Like show an example
  516. @c of what it pops up in the editor, for example. Also
  517. @c a discussion of how to get the "a)bort, c)ontinue,
  518. @c e)dit" prompt and what to do with it. Might also
  519. @c work in the suggestion that if you want a diff, you
  520. @c should make it before running commit (someone
  521. @c suggested that the diff pop up in the editor. I'm
  522. @c not sure that is better than telling people to run
  523. @c "cvs diff" first if that is what they want, but if
  524. @c we want to tell people that, the manual possibly
  525. @c should say it).
  526. If you want to avoid
  527. starting an editor you can specify the log message on
  528. the command line using the @samp{-m} flag instead, like
  529. this:
  530. @example
  531. $ cvs commit -m "Added an optimization pass" backend.c
  532. @end example
  533. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  534. @node Cleaning up
  535. @subsection Cleaning up
  536. @cindex Cleaning up
  537. @cindex Working copy, removing
  538. @cindex Removing your working copy
  539. @cindex Releasing your working copy
  540. Before you turn to other tasks you decide to remove your working copy of
  541. tc. One acceptable way to do that is of course
  542. @example
  543. $ cd ..
  544. $ rm -r tc
  545. @end example
  546. @noindent
  547. but a better way is to use the @code{release} command (@pxref{release}):
  548. @example
  549. $ cd ..
  550. $ cvs release -d tc
  551. M driver.c
  552. ? tc
  553. You have [1] altered files in this repository.
  554. Are you sure you want to release (and delete) directory `tc': n
  555. ** `release' aborted by user choice.
  556. @end example
  557. The @code{release} command checks that all your modifications have been
  558. committed. If history logging is enabled it also makes a note in the
  559. history file. @xref{history file}.
  560. When you use the @samp{-d} flag with @code{release}, it
  561. also removes your working copy.
  562. In the example above, the @code{release} command wrote a couple of lines
  563. of output. @samp{? tc} means that the file @file{tc} is unknown to @sc{cvs}.
  564. That is nothing to worry about: @file{tc} is the executable compiler,
  565. and it should not be stored in the repository. @xref{cvsignore},
  566. for information about how to make that warning go away.
  567. @xref{release output}, for a complete explanation of
  568. all possible output from @code{release}.
  569. @samp{M driver.c} is more serious. It means that the
  570. file @file{driver.c} has been modified since it was
  571. checked out.
  572. The @code{release} command always finishes by telling
  573. you how many modified files you have in your working
  574. copy of the sources, and then asks you for confirmation
  575. before deleting any files or making any note in the
  576. history file.
  577. You decide to play it safe and answer @kbd{n @key{RET}}
  578. when @code{release} asks for confirmation.
  579. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  580. @node Viewing differences
  581. @subsection Viewing differences
  582. @cindex Viewing differences
  583. @cindex Diff
  584. You do not remember modifying @file{driver.c}, so you want to see what
  585. has happened to that file.
  586. @example
  587. $ cd tc
  588. $ cvs diff driver.c
  589. @end example
  590. This command runs @code{diff} to compare the version of @file{driver.c}
  591. that you checked out with your working copy. When you see the output
  592. you remember that you added a command line option that enabled the
  593. optimization pass. You check it in, and release the module.
  594. @c FIXME: we haven't yet defined the term "check in".
  595. @example
  596. $ cvs commit -m "Added an optimization pass" driver.c
  597. Checking in driver.c;
  598. /usr/local/cvsroot/tc/driver.c,v <-- driver.c
  599. new revision: 1.2; previous revision: 1.1
  600. done
  601. $ cd ..
  602. $ cvs release -d tc
  603. ? tc
  604. You have [0] altered files in this repository.
  605. Are you sure you want to release (and delete) directory `tc': y
  606. @end example
  607. @c ---------------------------------------------------------------------
  608. @node Repository
  609. @chapter The Repository
  610. @cindex Repository (intro)
  611. @cindex Repository, example
  612. @cindex Layout of repository
  613. @cindex Typical repository
  614. @cindex /usr/local/cvsroot, as example repository
  615. @cindex cvsroot
  616. The @sc{cvs} @dfn{repository} stores a complete copy of
  617. all the files and directories which are under version
  618. control.
  619. Normally, you never access any of the files in the
  620. repository directly. Instead, you use @sc{cvs}
  621. commands to get your own copy of the files into a
  622. @dfn{working directory}, and then
  623. work on that copy. When you've finished a set of
  624. changes, you check (or @dfn{commit}) them back into the
  625. repository. The repository then contains the changes
  626. which you have made, as well as recording exactly what
  627. you changed, when you changed it, and other such
  628. information. Note that the repository is not a
  629. subdirectory of the working directory, or vice versa;
  630. they should be in separate locations.
  631. @c Need some example, e.g. repository
  632. @c /usr/local/cvsroot; working directory
  633. @c /home/joe/sources. But this node is too long
  634. @c as it is; need a little reorganization...
  635. @cindex :local:, setting up
  636. @sc{cvs} can access a repository by a variety of
  637. means. It might be on the local computer, or it might
  638. be on a computer across the room or across the world.
  639. To distinguish various ways to access a repository, the
  640. repository name can start with an @dfn{access method}.
  641. For example, the access method @code{:local:} means to
  642. access a repository directory, so the repository
  643. @code{:local:/usr/local/cvsroot} means that the
  644. repository is in @file{/usr/local/cvsroot} on the
  645. computer running @sc{cvs}. For information on other
  646. access methods, see @ref{Remote repositories}.
  647. @c Can se say this more concisely? Like by passing
  648. @c more of the buck to the Remote repositories node?
  649. If the access method is omitted, then if the repository
  650. starts with @samp{/}, then @code{:local:} is
  651. assumed. If it does not start with @samp{/} then either
  652. @code{:ext:} or @code{:server:} is assumed. For
  653. example, if you have a local repository in
  654. @file{/usr/local/cvsroot}, you can use
  655. @code{/usr/local/cvsroot} instead of
  656. @code{:local:/usr/local/cvsroot}. But if (under
  657. Windows NT, for example) your local repository is
  658. @file{c:\src\cvsroot}, then you must specify the access
  659. method, as in @code{:local:c:/src/cvsroot}.
  660. @c This might appear to go in Repository storage, but
  661. @c actually it is describing something which is quite
  662. @c user-visible, when you do a "cvs co CVSROOT". This
  663. @c isn't necessary the perfect place for that, though.
  664. The repository is split in two parts. @file{$CVSROOT/CVSROOT} contains
  665. administrative files for @sc{cvs}. The other directories contain the actual
  666. user-defined modules.
  667. @menu
  668. * Specifying a repository:: Telling CVS where your repository is
  669. * Repository storage:: The structure of the repository
  670. * Working directory storage:: The structure of working directories
  671. * Intro administrative files:: Defining modules
  672. * Multiple repositories:: Multiple repositories
  673. * Creating a repository:: Creating a repository
  674. * Backing up:: Backing up a repository
  675. * Moving a repository:: Moving a repository
  676. * Remote repositories:: Accessing repositories on remote machines
  677. * Read-only access:: Granting read-only access to the repository
  678. * Server temporary directory:: The server creates temporary directories
  679. @end menu
  680. @node Specifying a repository
  681. @section Telling CVS where your repository is
  682. There are several ways to tell @sc{cvs}
  683. where to find the repository. You can name the
  684. repository on the command line explicitly, with the
  685. @code{-d} (for "directory") option:
  686. @example
  687. cvs -d /usr/local/cvsroot checkout yoyodyne/tc
  688. @end example
  689. @cindex .profile, setting CVSROOT in
  690. @cindex .cshrc, setting CVSROOT in
  691. @cindex .tcshrc, setting CVSROOT in
  692. @cindex .bashrc, setting CVSROOT in
  693. @cindex CVSROOT, environment variable
  694. Or you can set the @code{$CVSROOT} environment
  695. variable to an absolute path to the root of the
  696. repository, @file{/usr/local/cvsroot} in this example.
  697. To set @code{$CVSROOT}, @code{csh} and @code{tcsh}
  698. users should have this line in their @file{.cshrc} or
  699. @file{.tcshrc} files:
  700. @example
  701. setenv CVSROOT /usr/local/cvsroot
  702. @end example
  703. @noindent
  704. @code{sh} and @code{bash} users should instead have these lines in their
  705. @file{.profile} or @file{.bashrc}:
  706. @example
  707. CVSROOT=/usr/local/cvsroot
  708. export CVSROOT
  709. @end example
  710. @cindex Root file, in CVS directory
  711. @cindex CVS/Root file
  712. A repository specified with @code{-d} will
  713. override the @code{$CVSROOT} environment variable.
  714. Once you've checked a working copy out from the
  715. repository, it will remember where its repository is
  716. (the information is recorded in the
  717. @file{CVS/Root} file in the working copy).
  718. The @code{-d} option and the @file{CVS/Root} file both
  719. override the @code{$CVSROOT} environment variable. If
  720. @code{-d} option differs from @file{CVS/Root}, the
  721. former is used. Of course, for proper operation they
  722. should be two ways of referring to the same repository.
  723. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  724. @node Repository storage
  725. @section How data is stored in the repository
  726. @cindex Repository, how data is stored
  727. For most purposes it isn't important @emph{how}
  728. @sc{cvs} stores information in the repository. In
  729. fact, the format has changed in the past, and is likely
  730. to change in the future. Since in almost all cases one
  731. accesses the repository via @sc{cvs} commands, such
  732. changes need not be disruptive.
  733. However, in some cases it may be necessary to
  734. understand how @sc{cvs} stores data in the repository,
  735. for example you might need to track down @sc{cvs} locks
  736. (@pxref{Concurrency}) or you might need to deal with
  737. the file permissions appropriate for the repository.
  738. @menu
  739. * Repository files:: What files are stored in the repository
  740. * File permissions:: File permissions
  741. * Windows permissions:: Issues specific to Windows
  742. * Attic:: Some files are stored in the Attic
  743. * CVS in repository:: Additional information in CVS directory
  744. * Locks:: CVS locks control concurrent accesses
  745. * CVSROOT storage:: A few things about CVSROOT are different
  746. @end menu
  747. @node Repository files
  748. @subsection Where files are stored within the repository
  749. @c @cindex Filenames, legal
  750. @c @cindex Legal filenames
  751. @c Somewhere we need to say something about legitimate
  752. @c characters in filenames in working directory and
  753. @c repository. Not "/" (not even on non-unix). And
  754. @c here is a specific set of issues:
  755. @c Files starting with a - are handled inconsistently. They can not
  756. @c be added to a repository with an add command, because it they are
  757. @c interpreted as a switch. They can appear in a repository if they are
  758. @c part of a tree that is imported. They can not be removed from the tree
  759. @c once they are there.
  760. @c Note that "--" *is* supported (as a
  761. @c consequence of using GNU getopt). Should document
  762. @c this somewhere ("Common options"?). The other usual technique,
  763. @c "./-foo", isn't as effective, at least for "cvs add"
  764. @c which doesn't support pathnames containing "/".
  765. The overall structure of the repository is a directory
  766. tree corresponding to the directories in the working
  767. directory. For example, supposing the repository is in
  768. @example
  769. /usr/local/cvsroot
  770. @end example
  771. @noindent
  772. here is a possible directory tree (showing only the
  773. directories):
  774. @example
  775. @t{/usr}
  776. |
  777. +--@t{local}
  778. | |
  779. | +--@t{cvsroot}
  780. | | |
  781. | | +--@t{CVSROOT}
  782. | (administrative files)
  783. |
  784. +--@t{gnu}
  785. | |
  786. | +--@t{diff}
  787. | | (source code to @sc{gnu} diff)
  788. | |
  789. | +--@t{rcs}
  790. | | (source code to @sc{rcs})
  791. | |
  792. | +--@t{cvs}
  793. | (source code to @sc{cvs})
  794. |
  795. +--@t{yoyodyne}
  796. |
  797. +--@t{tc}
  798. | |
  799. | +--@t{man}
  800. | |
  801. | +--@t{testing}
  802. |
  803. +--(other Yoyodyne software)
  804. @end example
  805. With the directories are @dfn{history files} for each file
  806. under version control. The name of the history file is
  807. the name of the corresponding file with @samp{,v}
  808. appended to the end. Here is what the repository for
  809. the @file{yoyodyne/tc} directory might look like:
  810. @c FIXME: Should also mention CVS (CVSREP)
  811. @c FIXME? Should we introduce Attic with an xref to
  812. @c Attic? Not sure whether that is a good idea or not.
  813. @example
  814. @code{$CVSROOT}
  815. |
  816. +--@t{yoyodyne}
  817. | |
  818. | +--@t{tc}
  819. | | |
  820. +--@t{Makefile,v}
  821. +--@t{backend.c,v}
  822. +--@t{driver.c,v}
  823. +--@t{frontend.c,v}
  824. +--@t{parser.c,v}
  825. +--@t{man}
  826. | |
  827. | +--@t{tc.1,v}
  828. |
  829. +--@t{testing}
  830. |
  831. +--@t{testpgm.t,v}
  832. +--@t{test2.t,v}
  833. @end example
  834. @cindex History files
  835. @cindex RCS history files
  836. @c The first sentence, about what history files
  837. @c contain, is kind of redundant with our intro to what the
  838. @c repository does in node Repository....
  839. The history files contain, among other things, enough
  840. information to recreate any revision of the file, a log
  841. of all commit messages and the user-name of the person
  842. who committed the revision. The history files are
  843. known as @dfn{RCS files}, because the first program to
  844. store files in that format was a version control system
  845. known as @sc{rcs}. For a full
  846. description of the file format, see the @code{man} page
  847. @cite{rcsfile(5)}, distributed with @sc{rcs}, or the
  848. file @file{doc/RCSFILES} in the @sc{cvs} source
  849. distribution. This
  850. file format has become very common---many systems other
  851. than @sc{cvs} or @sc{rcs} can at least import history
  852. files in this format.
  853. @c FIXME: Think about including documentation for this
  854. @c rather than citing it? In the long run, getting
  855. @c this to be a standard (not sure if we can cope with
  856. @c a standards process as formal as IEEE/ANSI/ISO/etc,
  857. @c though...) is the way to go, so maybe citing is
  858. @c better.
  859. The @sc{rcs} files used in @sc{cvs} differ in a few
  860. ways from the standard format. The biggest difference
  861. is magic branches; for more information see @ref{Magic
  862. branch numbers}. Also in @sc{cvs} the valid tag names
  863. are a subset of what @sc{rcs} accepts; for @sc{cvs}'s
  864. rules see @ref{Tags}.
  865. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  866. @node File permissions
  867. @subsection File permissions
  868. @c -- Move this to @node Creating a repository or similar
  869. @cindex Security, file permissions in repository
  870. @cindex File permissions, general
  871. @cindex Permissions, general
  872. @c FIXME: we need to somehow reflect "permissions in
  873. @c repository" versus "permissions in working
  874. @c directory" in the index entries.
  875. @cindex Group
  876. @cindex Read-only files, in repository
  877. All @samp{,v} files are created read-only, and you
  878. should not change the permission of those files. The
  879. directories inside the repository should be writable by
  880. the persons that have permission to modify the files in
  881. each directory. This normally means that you must
  882. create a UNIX group (see group(5)) consisting of the
  883. persons that are to edit the files in a project, and
  884. set up the repository so that it is that group that
  885. owns the directory.
  886. (On some systems, you also need to set the set-group-ID-on-execution bit
  887. on the repository directories (see chmod(1)) so that newly-created files
  888. and directories get the group-ID of the parent directory rather than
  889. that of the current process.)
  890. @c See also comment in commitinfo node regarding cases
  891. @c which are really awkward with unix groups.
  892. This means that you can only control access to files on
  893. a per-directory basis.
  894. Note that users must also have write access to check
  895. out files, because @sc{cvs} needs to create lock files
  896. (@pxref{Concurrency}). You can use LockDir in CVSROOT/config
  897. to put the lock files somewhere other than in the repository
  898. if you want to allow read-only access to some directories
  899. (@pxref{config}).
  900. @c CVS seems to use CVSUMASK in picking permissions for
  901. @c val-tags, but maybe we should say more about this.
  902. @c Like val-tags gets created by someone who doesn't
  903. @c have CVSUMASK set right?
  904. Also note that users must have write access to the
  905. @file{CVSROOT/val-tags} file. @sc{cvs} uses it to keep
  906. track of what tags are valid tag names (it is sometimes
  907. updated when tags are used, as well as when they are
  908. created).
  909. Each @sc{rcs} file will be owned by the user who last
  910. checked it in. This has little significance; what
  911. really matters is who owns the directories.
  912. @cindex CVSUMASK, environment variable
  913. @cindex Umask, for repository files
  914. @sc{cvs} tries to set up reasonable file permissions
  915. for new directories that are added inside the tree, but
  916. you must fix the permissions manually when a new
  917. directory should have different permissions than its
  918. parent directory. If you set the @code{CVSUMASK}
  919. environment variable that will control the file
  920. permissions which @sc{cvs} uses in creating directories
  921. and/or files in the repository. @code{CVSUMASK} does
  922. not affect the file permissions in the working
  923. directory; such files have the permissions which are
  924. typical for newly created files, except that sometimes
  925. @sc{cvs} creates them read-only (see the sections on
  926. watches, @ref{Setting a watch}; -r, @ref{Global
  927. options}; or @code{CVSREAD}, @ref{Environment variables}).
  928. @c FIXME: Need more discussion of which
  929. @c group should own the file in the repository.
  930. @c Include a somewhat detailed example of the usual
  931. @c case where CVSUMASK is 007, the developers are all
  932. @c in a group, and that group owns stuff in the
  933. @c repository. Need to talk about group ownership of
  934. @c newly-created directories/files (on some unices,
  935. @c such as SunOS4, setting the setgid bit on the
  936. @c directories will make files inherit the directory's
  937. @c group. On other unices, your mileage may vary. I
  938. @c can't remember what POSIX says about this, if
  939. @c anything).
  940. Note that using the client/server @sc{cvs}
  941. (@pxref{Remote repositories}), there is no good way to
  942. set @code{CVSUMASK}; the setting on the client machine
  943. has no effect. If you are connecting with @code{rsh}, you
  944. can set @code{CVSUMASK} in @file{.bashrc} or @file{.cshrc}, as
  945. described in the documentation for your operating
  946. system. This behavior might change in future versions
  947. of @sc{cvs}; do not rely on the setting of
  948. @code{CVSUMASK} on the client having no effect.
  949. @c FIXME: need to explain what a umask is or cite
  950. @c someplace which does.
  951. @c
  952. @c There is also a larger (largely separate) issue
  953. @c about the meaning of CVSUMASK in a non-unix context.
  954. @c For example, whether there is
  955. @c an equivalent which fits better into other
  956. @c protection schemes like POSIX.6, VMS, &c.
  957. @c
  958. @c FIXME: Need one place which discusses this
  959. @c read-only files thing. Why would one use -r or
  960. @c CVSREAD? Why would one use watches? How do they
  961. @c interact?
  962. @c
  963. @c FIXME: We need to state
  964. @c whether using CVSUMASK removes the need for manually
  965. @c fixing permissions (in fact, if we are going to mention
  966. @c manually fixing permission, we better document a lot
  967. @c better just what we mean by "fix").
  968. Using pserver, you will generally need stricter
  969. permissions on the @sc{cvsroot} directory and
  970. directories above it in the tree; see @ref{Password
  971. authentication security}.
  972. @cindex Setuid
  973. @cindex Setgid
  974. @cindex Security, setuid
  975. @cindex Installed images (VMS)
  976. Some operating systems have features which allow a
  977. particular program to run with the ability to perform
  978. operations which the caller of the program could not.
  979. For example, the set user ID (setuid) or set group ID
  980. (setgid) features of unix or the installed image
  981. feature of VMS. @sc{cvs} was not written to use such
  982. features and therefore attempting to install @sc{cvs} in
  983. this fashion will provide protection against only
  984. accidental lapses; anyone who is trying to circumvent
  985. the measure will be able to do so, and depending on how
  986. you have set it up may gain access to more than just
  987. @sc{cvs}. You may wish to instead consider pserver. It
  988. shares some of the same attributes, in terms of
  989. possibly providing a false sense of security or opening
  990. security holes wider than the ones you are trying to
  991. fix, so read the documentation on pserver security
  992. carefully if you are considering this option
  993. (@ref{Password authentication security}).
  994. @node Windows permissions
  995. @subsection File Permission issues specific to Windows
  996. @cindex Windows, and permissions
  997. @cindex File permissions, Windows-specific
  998. @cindex Permissions, Windows-specific
  999. Some file permission issues are specific to Windows
  1000. operating systems (Windows 95, Windows NT, and
  1001. presumably future operating systems in this family.
  1002. Some of the following might apply to OS/2 but I'm not
  1003. sure).
  1004. If you are using local @sc{cvs} and the repository is on a
  1005. networked file system which is served by the Samba SMB
  1006. server, some people have reported problems with
  1007. permissions. Enabling WRITE=YES in the samba
  1008. configuration is said to fix/workaround it.
  1009. Disclaimer: I haven't investigated enough to know the
  1010. implications of enabling that option, nor do I know
  1011. whether there is something which @sc{cvs} could be doing
  1012. differently in order to avoid the problem. If you find
  1013. something out, please let us know as described in
  1014. @ref{BUGS}.
  1015. @node Attic
  1016. @subsection The attic
  1017. @cindex Attic
  1018. You will notice that sometimes @sc{cvs} stores an
  1019. @sc{rcs} file in the @code{Attic}. For example, if the
  1020. @sc{cvsroot} is @file{/usr/local/cvsroot} and we are
  1021. talking about the file @file{backend.c} in the
  1022. directory @file{yoyodyne/tc}, then the file normally
  1023. would be in
  1024. @example
  1025. /usr/local/cvsroot/yoyodyne/tc/backend.c,v
  1026. @end example
  1027. @noindent
  1028. but if it goes in the attic, it would be in
  1029. @example
  1030. /usr/local/cvsroot/yoyodyne/tc/Attic/backend.c,v
  1031. @end example
  1032. @noindent
  1033. @cindex Dead state
  1034. instead. It should not matter from a user point of
  1035. view whether a file is in the attic; @sc{cvs} keeps
  1036. track of this and looks in the attic when it needs to.
  1037. But in case you want to know, the rule is that the RCS
  1038. file is stored in the attic if and only if the head
  1039. revision on the trunk has state @code{dead}. A
  1040. @code{dead} state means that file has been removed, or
  1041. never added, for that revision. For example, if you
  1042. add a file on a branch, it will have a trunk revision
  1043. in @code{dead} state, and a branch revision in a
  1044. non-@code{dead} state.
  1045. @c Probably should have some more concrete examples
  1046. @c here, or somewhere (not sure exactly how we should
  1047. @c arrange the discussion of the dead state, versus
  1048. @c discussion of the attic).
  1049. @node CVS in repository
  1050. @subsection The CVS directory in the repository
  1051. @cindex CVS directory, in repository
  1052. The @file{CVS} directory in each repository directory
  1053. contains information such as file attributes (in a file
  1054. called @file{CVS/fileattr}. In the
  1055. future additional files may be added to this directory,
  1056. so implementations should silently ignore additional
  1057. files.
  1058. This behavior is implemented only by @sc{cvs} 1.7 and
  1059. later; for details see @ref{Watches Compatibility}.
  1060. The format of the fileattr file is a series of entries
  1061. of the following form (where @samp{@{} and @samp{@}}
  1062. means the text between the braces can be repeated zero
  1063. or more times):
  1064. @var{ent-type} @var{filename} <tab> @var{attrname} = @var{attrval}
  1065. @{; @var{attrname} = @var{attrval}@} <linefeed>
  1066. @var{ent-type} is @samp{F} for a file, in which case the entry specifies the
  1067. attributes for that file.
  1068. @var{ent-type} is @samp{D},
  1069. and @var{filename} empty, to specify default attributes
  1070. to be used for newly added files.
  1071. Other @var{ent-type} are reserved for future expansion. @sc{cvs} 1.9 and older
  1072. will delete them any time it writes file attributes.
  1073. @sc{cvs} 1.10 and later will preserve them.
  1074. Note that the order of the lines is not significant;
  1075. a program writing the fileattr file may
  1076. rearrange them at its convenience.
  1077. There is currently no way of quoting tabs or linefeeds in the
  1078. filename, @samp{=} in @var{attrname},
  1079. @samp{;} in @var{attrval}, etc. Note: some implementations also
  1080. don't handle a NUL character in any of the fields, but
  1081. implementations are encouraged to allow it.
  1082. By convention, @var{attrname} starting with @samp{_} is for an attribute given
  1083. special meaning by @sc{cvs}; other @var{attrname}s are for user-defined attributes
  1084. (or will be, once implementations start supporting user-defined attributes).
  1085. Builtin attributes:
  1086. @table @code
  1087. @item _watched
  1088. Present means the file is watched and should be checked out
  1089. read-only.
  1090. @item _watchers
  1091. Users with watches for this file. Value is
  1092. @var{watcher} > @var{type} @{ , @var{watcher} > @var{type} @}
  1093. where @var{watcher} is a username, and @var{type}
  1094. is zero or more of edit,unedit,commit separated by
  1095. @samp{+} (that is, nothing if none; there is no "none" or "all" keyword).
  1096. @item _editors
  1097. Users editing this file. Value is
  1098. @var{editor} > @var{val} @{ , @var{editor} > @var{val} @}
  1099. where @var{editor} is a username, and @var{val} is
  1100. @var{time}+@var{hostname}+@var{pathname}, where
  1101. @var{time} is when the @code{cvs edit} command (or
  1102. equivalent) happened,
  1103. and @var{hostname} and @var{pathname} are for the working directory.
  1104. @end table
  1105. Example:
  1106. @c FIXME: sanity.sh should contain a similar test case
  1107. @c so we can compare this example from something from
  1108. @c Real Life(TM). See cvsclient.texi (under Notify) for more
  1109. @c discussion of the date format of _editors.
  1110. @example
  1111. Ffile1 _watched=;_watchers=joe>edit,mary>commit
  1112. Ffile2 _watched=;_editors=sue>8 Jan 1975+workstn1+/home/sue/cvs
  1113. D _watched=
  1114. @end example
  1115. @noindent
  1116. means that the file @file{file1} should be checked out
  1117. read-only. Furthermore, joe is watching for edits and
  1118. mary is watching for commits. The file @file{file2}
  1119. should be checked out read-only; sue started editing it
  1120. on 8 Jan 1975 in the directory @file{/home/sue/cvs} on
  1121. the machine @code{workstn1}. Future files which are
  1122. added should be checked out read-only. To represent
  1123. this example here, we have shown a space after
  1124. @samp{D}, @samp{Ffile1}, and @samp{Ffile2}, but in fact
  1125. there must be a single tab character there and no spaces.
  1126. @node Locks
  1127. @subsection CVS locks in the repository
  1128. @cindex #cvs.rfl, technical details
  1129. @cindex #cvs.wfl, technical details
  1130. @cindex #cvs.lock, technical details
  1131. @cindex Locks, cvs, technical details
  1132. For an introduction to @sc{cvs} locks focusing on
  1133. user-visible behavior, see @ref{Concurrency}. The
  1134. following section is aimed at people who are writing
  1135. tools which want to access a @sc{cvs} repository without
  1136. interfering with other tools accessing the same
  1137. repository. If you find yourself confused by concepts
  1138. described here, like @dfn{read lock}, @dfn{write lock},
  1139. and @dfn{deadlock}, you might consult the literature on
  1140. operating systems or databases.
  1141. @cindex #cvs.tfl
  1142. Any file in the repository with a name starting
  1143. with @file{#cvs.rfl.} is a read lock. Any file in
  1144. the repository with a name starting with
  1145. @file{#cvs.wfl} is a write lock. Old versions of @sc{cvs}
  1146. (before @sc{cvs} 1.5) also created files with names starting
  1147. with @file{#cvs.tfl}, but they are not discussed here.
  1148. The directory @file{#cvs.lock} serves as a master
  1149. lock. That is, one must obtain this lock first before
  1150. creating any of the other locks.
  1151. To obtain a readlock, first create the @file{#cvs.lock}
  1152. directory. This operation must be atomic (which should
  1153. be true for creating a directory under most operating
  1154. systems). If it fails because the directory already
  1155. existed, wait for a while and try again. After
  1156. obtaining the @file{#cvs.lock} lock, create a file
  1157. whose name is @file{#cvs.rfl.} followed by information
  1158. of your choice (for example, hostname and process
  1159. identification number). Then remove the
  1160. @file{#cvs.lock} directory to release the master lock.
  1161. Then proceed with reading the repository. When you are
  1162. done, remove the @file{#cvs.rfl} file to release the
  1163. read lock.
  1164. To obtain a writelock, first create the
  1165. @file{#cvs.lock} directory, as with a readlock. Then
  1166. check that there are no files whose names start with
  1167. @file{#cvs.rfl.}. If there are, remove
  1168. @file{#cvs.lock}, wait for a while, and try again. If
  1169. there are no readers, then create a file whose name is
  1170. @file{#cvs.wfl} followed by information of your choice
  1171. (for example, hostname and process identification
  1172. number). Hang on to the @file{#cvs.lock} lock. Proceed
  1173. with writing the repository. When you are done, first
  1174. remove the @file{#cvs.wfl} file and then the
  1175. @file{#cvs.lock} directory. Note that unlike the
  1176. @file{#cvs.rfl} file, the @file{#cvs.wfl} file is just
  1177. informational; it has no effect on the locking operation
  1178. beyond what is provided by holding on to the
  1179. @file{#cvs.lock} lock itself.
  1180. Note that each lock (writelock or readlock) only locks
  1181. a single directory in the repository, including
  1182. @file{Attic} and @file{CVS} but not including
  1183. subdirectories which represent other directories under
  1184. version control. To lock an entire tree, you need to
  1185. lock each directory (note that if you fail to obtain
  1186. any lock you need, you must release the whole tree
  1187. before waiting and trying again, to avoid deadlocks).
  1188. Note also that @sc{cvs} expects writelocks to control
  1189. access to individual @file{foo,v} files. @sc{rcs} has
  1190. a scheme where the @file{,foo,} file serves as a lock,
  1191. but @sc{cvs} does not implement it and so taking out a
  1192. @sc{cvs} writelock is recommended. See the comments at
  1193. rcs_internal_lockfile in the @sc{cvs} source code for
  1194. further discussion/rationale.
  1195. @node CVSROOT storage
  1196. @subsection How files are stored in the CVSROOT directory
  1197. @cindex CVSROOT, storage of files
  1198. The @file{$CVSROOT/CVSROOT} directory contains the
  1199. various administrative files. In some ways this
  1200. directory is just like any other directory in the
  1201. repository; it contains @sc{rcs} files whose names end
  1202. in @samp{,v}, and many of the @sc{cvs} commands operate
  1203. on it the same way. However, there are a few
  1204. differences.
  1205. For each administrative file, in addition to the
  1206. @sc{rcs} file, there is also a checked out copy of the
  1207. file. For example, there is an @sc{rcs} file
  1208. @file{loginfo,v} and a file @file{loginfo} which
  1209. contains the latest revision contained in
  1210. @file{loginfo,v}. When you check in an administrative
  1211. file, @sc{cvs} should print
  1212. @example
  1213. cvs commit: Rebuilding administrative file database
  1214. @end example
  1215. @noindent
  1216. and update the checked out copy in
  1217. @file{$CVSROOT/CVSROOT}. If it does not, there is
  1218. something wrong (@pxref{BUGS}). To add your own files
  1219. to the files to be updated in this fashion, you can add
  1220. them to the @file{checkoutlist} administrative file
  1221. (@pxref{checkoutlist}).
  1222. @cindex modules.db
  1223. @cindex modules.pag
  1224. @cindex modules.dir
  1225. By default, the @file{modules} file behaves as
  1226. described above. If the modules file is very large,
  1227. storing it as a flat text file may make looking up
  1228. modules slow (I'm not sure whether this is as much of a
  1229. concern now as when @sc{cvs} first evolved this
  1230. feature; I haven't seen benchmarks). Therefore, by
  1231. making appropriate edits to the @sc{cvs} source code
  1232. one can store the modules file in a database which
  1233. implements the @code{ndbm} interface, such as Berkeley
  1234. db or GDBM. If this option is in use, then the modules
  1235. database will be stored in the files @file{modules.db},
  1236. @file{modules.pag}, and/or @file{modules.dir}.
  1237. @c I think fileattr also will use the database stuff.
  1238. @c Anything else?
  1239. For information on the meaning of the various
  1240. administrative files, see @ref{Administrative files}.
  1241. @node Working directory storage
  1242. @section How data is stored in the working directory
  1243. @c FIXME: Somewhere we should discuss timestamps (test
  1244. @c case "stamps" in sanity.sh). But not here. Maybe
  1245. @c in some kind of "working directory" chapter which
  1246. @c would encompass the "Builds" one? But I'm not sure
  1247. @c whether that is a good organization (is it based on
  1248. @c what the user wants to do?).
  1249. @cindex CVS directory, in working directory
  1250. While we are discussing @sc{cvs} internals which may
  1251. become visible from time to time, we might as well talk
  1252. about what @sc{cvs} puts in the @file{CVS} directories
  1253. in the working directories. As with the repository,
  1254. @sc{cvs} handles this information and one can usually
  1255. access it via @sc{cvs} commands. But in some cases it
  1256. may be useful to look at it, and other programs, such
  1257. as the @code{jCVS} graphical user interface or the
  1258. @code{VC} package for emacs, may need to look at it.
  1259. Such programs should follow the recommendations in this
  1260. section if they hope to be able to work with other
  1261. programs which use those files, including future
  1262. versions of the programs just mentioned and the
  1263. command-line @sc{cvs} client.
  1264. The @file{CVS} directory contains several files.
  1265. Programs which are reading this directory should
  1266. silently ignore files which are in the directory but
  1267. which are not documented here, to allow for future
  1268. expansion.
  1269. The files are stored according to the text file
  1270. convention for the system in question. This means that
  1271. working directories are not portable between systems
  1272. with differing conventions for storing text files.
  1273. This is intentional, on the theory that the files being
  1274. managed by @sc{cvs} probably will not be portable between
  1275. such systems either.
  1276. @table @file
  1277. @item Root
  1278. This file contains the current @sc{cvs} root, as
  1279. described in @ref{Specifying a repository}.
  1280. @cindex Repository file, in CVS directory
  1281. @cindex CVS/Repository file
  1282. @item Repository
  1283. This file contains the directory within the repository
  1284. which the current directory corresponds with. It can
  1285. be either an absolute pathname or a relative pathname;
  1286. @sc{cvs} has had the ability to read either format
  1287. since at least version 1.3 or so. The relative
  1288. pathname is relative to the root, and is the more
  1289. sensible approach, but the absolute pathname is quite
  1290. common and implementations should accept either. For
  1291. example, after the command
  1292. @example
  1293. cvs -d :local:/usr/local/cvsroot checkout yoyodyne/tc
  1294. @end example
  1295. @noindent
  1296. @file{Root} will contain
  1297. @example
  1298. :local:/usr/local/cvsroot
  1299. @end example
  1300. @noindent
  1301. and @file{Repository} will contain either
  1302. @example
  1303. /usr/local/cvsroot/yoyodyne/tc
  1304. @end example
  1305. @noindent
  1306. or
  1307. @example
  1308. yoyodyne/tc
  1309. @end example
  1310. If the particular working directory does not correspond
  1311. to a directory in the repository, then @file{Repository}
  1312. should contain @file{CVSROOT/Emptydir}.
  1313. @cindex Emptydir, in CVSROOT directory
  1314. @cindex CVSROOT/Emptydir directory
  1315. @cindex Entries file, in CVS directory
  1316. @cindex CVS/Entries file
  1317. @item Entries
  1318. This file lists the files and directories in the
  1319. working directory.
  1320. The first character of each line indicates what sort of
  1321. line it is. If the character is unrecognized, programs
  1322. reading the file should silently skip that line, to
  1323. allow for future expansion.
  1324. If the first character is @samp{/}, then the format is:
  1325. @example
  1326. /@var{name}/@var{revision}/@var{timestamp}[+@var{conflict}]/@var{options}/@var{tagdate}
  1327. @end example
  1328. @noindent
  1329. where @samp{[} and @samp{]} are not part of the entry,
  1330. but instead indicate that the @samp{+} and conflict
  1331. marker are optional. @var{name} is the name of the
  1332. file within the directory. @var{revision} is the
  1333. revision that the file in the working derives from, or
  1334. @samp{0} for an added file, or @samp{-} followed by a
  1335. revision for a removed file. @var{timestamp} is the
  1336. timestamp of the file at the time that @sc{cvs} created
  1337. it; if the timestamp differs with the actual
  1338. modification time of the file it means the file has
  1339. been modified. It is stored in
  1340. the format used by the ISO C asctime() function (for
  1341. example, @samp{Sun Apr 7 01:29:26 1996}). One may
  1342. write a string which is not in that format, for
  1343. example, @samp{Result of merge}, to indicate that the
  1344. file should always be considered to be modified. This
  1345. is not a special case; to see whether a file is
  1346. modified a program should take the timestamp of the file
  1347. and simply do a string compare with @var{timestamp}.
  1348. If there was a conflict, @var{conflict} can be set to
  1349. the modification time of the file after the file has been
  1350. written with conflict markers (@pxref{Conflicts example}).
  1351. Thus if @var{conflict} is subsequently the same as the actual
  1352. modification time of the file it means that the user
  1353. has obviously not resolved the conflict. @var{options}
  1354. contains sticky options (for example @samp{-kb} for a
  1355. binary file). @var{tagdate} contains @samp{T} followed
  1356. by a tag name, or @samp{D} for a date, followed by a
  1357. sticky tag or date. Note that if @var{timestamp}
  1358. contains a pair of timestamps separated by a space,
  1359. rather than a single timestamp, you are dealing with a
  1360. version of @sc{cvs} earlier than @sc{cvs} 1.5 (not
  1361. documented here).
  1362. The timezone on the timestamp in CVS/Entries (local or
  1363. universal) should be the same as the operating system
  1364. stores for the timestamp of the file itself. For
  1365. example, on Unix the file's timestamp is in universal
  1366. time (UT), so the timestamp in CVS/Entries should be
  1367. too. On @sc{vms}, the file's timestamp is in local
  1368. time, so @sc{cvs} on @sc{vms} should use local time.
  1369. This rule is so that files do not appear to be modified
  1370. merely because the timezone changed (for example, to or
  1371. from summer time).
  1372. @c See comments and calls to gmtime() and friends in
  1373. @c src/vers_ts.c (function time_stamp).
  1374. If the first character of a line in @file{Entries} is
  1375. @samp{D}, then it indicates a subdirectory. @samp{D}
  1376. on a line all by itself indicates that the program
  1377. which wrote the @file{Entries} file does record
  1378. subdirectories (therefore, if there is such a line and
  1379. no other lines beginning with @samp{D}, one knows there
  1380. are no subdirectories). Otherwise, the line looks
  1381. like:
  1382. @example
  1383. D/@var{name}/@var{filler1}/@var{filler2}/@var{filler3}/@var{filler4}
  1384. @end example
  1385. @noindent
  1386. where @var{name} is the name of the subdirectory, and
  1387. all the @var{filler} fields should be silently ignored,
  1388. for future expansion. Programs which modify
  1389. @code{Entries} files should preserve these fields.
  1390. The lines in the @file{Entries} file can be in any order.
  1391. @cindex Entries.Log file, in CVS directory
  1392. @cindex CVS/Entries.Log file
  1393. @item Entries.Log
  1394. This file does not record any information beyond that
  1395. in @file{Entries}, but it does provide a way to update
  1396. the information without having to rewrite the entire
  1397. @file{Entries} file, including the ability to preserve
  1398. the information even if the program writing
  1399. @file{Entries} and @file{Entries.Log} abruptly aborts.
  1400. Programs which are reading the @file{Entries} file
  1401. should also check for @file{Entries.Log}. If the latter
  1402. exists, they should read @file{Entries} and then apply
  1403. the changes mentioned in @file{Entries.Log}. After
  1404. applying the changes, the recommended practice is to
  1405. rewrite @file{Entries} and then delete @file{Entries.Log}.
  1406. The format of a line in @file{Entries.Log} is a single
  1407. character command followed by a space followed by a
  1408. line in the format specified for a line in
  1409. @file{Entries}. The single character command is
  1410. @samp{A} to indicate that the entry is being added,
  1411. @samp{R} to indicate that the entry is being removed,
  1412. or any other character to indicate that the entire line
  1413. in @file{Entries.Log} should be silently ignored (for
  1414. future expansion). If the second character of the line
  1415. in @file{Entries.Log} is not a space, then it was
  1416. written by an older version of @sc{cvs} (not documented
  1417. here).
  1418. Programs which are writing rather than reading can
  1419. safely ignore @file{Entries.Log} if they so choose.
  1420. @cindex Entries.Backup file, in CVS directory
  1421. @cindex CVS/Entries.Backup file
  1422. @item Entries.Backup
  1423. This is a temporary file. Recommended usage is to
  1424. write a new entries file to @file{Entries.Backup}, and
  1425. then to rename it (atomically, where possible) to @file{Entries}.
  1426. @cindex Entries.Static file, in CVS directory
  1427. @cindex CVS/Entries.Static file
  1428. @item Entries.Static
  1429. The only relevant thing about this file is whether it
  1430. exists or not. If it exists, then it means that only
  1431. part of a directory was gotten and @sc{cvs} will
  1432. not create additional files in that directory. To
  1433. clear it, use the @code{update} command with the
  1434. @samp{-d} option, which will get the additional files
  1435. and remove @file{Entries.Static}.
  1436. @c FIXME: This needs to be better documented, in places
  1437. @c other than Working Directory Storage.
  1438. @c FIXCVS: The fact that this setting exists needs to
  1439. @c be more visible to the user. For example "cvs
  1440. @c status foo", in the case where the file would be
  1441. @c gotten except for Entries.Static, might say
  1442. @c something to distinguish this from other cases.
  1443. @c One thing that periodically gets suggested is to
  1444. @c have "cvs update" print something when it skips
  1445. @c files due to Entries.Static, but IMHO that kind of
  1446. @c noise pretty much makes the Entries.Static feature
  1447. @c useless.
  1448. @cindex Tag file, in CVS directory
  1449. @cindex CVS/Tag file
  1450. @cindex Sticky tags/dates, per-directory
  1451. @cindex Per-directory sticky tags/dates
  1452. @item Tag
  1453. This file contains per-directory sticky tags or dates.
  1454. The first character is @samp{T} for a branch tag,
  1455. @samp{N} for a non-branch tag, or @samp{D} for a date,
  1456. or another character to mean the file should be
  1457. silently ignored, for future expansion. This character
  1458. is followed by the tag or date. Note that
  1459. per-directory sticky tags or dates are used for things
  1460. like applying to files which are newly added; they
  1461. might not be the same as the sticky tags or dates on
  1462. individual files. For general information on sticky
  1463. tags and dates, see @ref{Sticky tags}.
  1464. @c FIXME: This needs to be much better documented,
  1465. @c preferably not in the context of "working directory
  1466. @c storage".
  1467. @c FIXME: The Sticky tags node needs to discuss, or xref to
  1468. @c someplace which discusses, per-directory sticky
  1469. @c tags and the distinction with per-file sticky tags.
  1470. @cindex Notify file, in CVS directory
  1471. @cindex CVS/Notify file
  1472. @item Notify
  1473. This file stores notifications (for example, for
  1474. @code{edit} or @code{unedit}) which have not yet been
  1475. sent to the server. Its format is not yet documented
  1476. here.
  1477. @cindex Notify.tmp file, in CVS directory
  1478. @cindex CVS/Notify.tmp file
  1479. @item Notify.tmp
  1480. This file is to @file{Notify} as @file{Entries.Backup}
  1481. is to @file{Entries}. That is, to write @file{Notify},
  1482. first write the new contents to @file{Notify.tmp} and
  1483. then (atomically where possible), rename it to
  1484. @file{Notify}.
  1485. @cindex Base directory, in CVS directory
  1486. @cindex CVS/Base directory
  1487. @item Base
  1488. If watches are in use, then an @code{edit} command
  1489. stores the original copy of the file in the @file{Base}
  1490. directory. This allows the @code{unedit} command to
  1491. operate even if it is unable to communicate with the
  1492. server.
  1493. @cindex Baserev file, in CVS directory
  1494. @cindex CVS/Baserev file
  1495. @item Baserev
  1496. The file lists the revision for each of the files in
  1497. the @file{Base} directory. The format is:
  1498. @example
  1499. B@var{name}/@var{rev}/@var{expansion}
  1500. @end example
  1501. @noindent
  1502. where @var{expansion} should be ignored, to allow for
  1503. future expansion.
  1504. @cindex Baserev.tmp file, in CVS directory
  1505. @cindex CVS/Baserev.tmp file
  1506. @item Baserev.tmp
  1507. This file is to @file{Baserev} as @file{Entries.Backup}
  1508. is to @file{Entries}. That is, to write @file{Baserev},
  1509. first write the new contents to @file{Baserev.tmp} and
  1510. then (atomically where possible), rename it to
  1511. @file{Baserev}.
  1512. @cindex Template file, in CVS directory
  1513. @cindex CVS/Template file
  1514. @item Template
  1515. This file contains the template specified by the
  1516. @file{rcsinfo} file (@pxref{rcsinfo}). It is only used
  1517. by the client; the non-client/server @sc{cvs} consults
  1518. @file{rcsinfo} directly.
  1519. @end table
  1520. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1521. @node Intro administrative files
  1522. @section The administrative files
  1523. @cindex Administrative files (intro)
  1524. @cindex Modules file
  1525. @cindex CVSROOT, module name
  1526. @cindex Defining modules (intro)
  1527. @c FIXME: this node should be reorganized into "general
  1528. @c information about admin files" and put the "editing
  1529. @c admin files" stuff up front rather than jumping into
  1530. @c the details of modules right away. Then the
  1531. @c Administrative files node can go away, the information
  1532. @c on each admin file distributed to a place appropriate
  1533. @c to its function, and this node can contain a table
  1534. @c listing each file and a @ref to its detailed description.
  1535. The directory @file{$CVSROOT/CVSROOT} contains some @dfn{administrative
  1536. files}. @xref{Administrative files}, for a complete description.
  1537. You can use @sc{cvs} without any of these files, but
  1538. some commands work better when at least the
  1539. @file{modules} file is properly set up.
  1540. The most important of these files is the @file{modules}
  1541. file. It defines all modules in the repository. This
  1542. is a sample @file{modules} file.
  1543. @c FIXME: The CVSROOT line is a goofy example now that
  1544. @c mkmodules doesn't exist.
  1545. @example
  1546. CVSROOT CVSROOT
  1547. modules CVSROOT modules
  1548. cvs gnu/cvs
  1549. rcs gnu/rcs
  1550. diff gnu/diff
  1551. tc yoyodyne/tc
  1552. @end example
  1553. The @file{modules} file is line oriented. In its
  1554. simplest form each line contains the name of the
  1555. module, whitespace, and the directory where the module
  1556. resides. The directory is a path relative to
  1557. @code{$CVSROOT}. The last four lines in the example
  1558. above are examples of such lines.
  1559. @c FIXME: might want to introduce the concept of options in modules file
  1560. @c (the old example which was here, -i mkmodules, is obsolete).
  1561. The line that defines the module called @samp{modules}
  1562. uses features that are not explained here.
  1563. @xref{modules}, for a full explanation of all the
  1564. available features.
  1565. @c FIXME: subsection without node is bogus
  1566. @subsection Editing administrative files
  1567. @cindex Editing administrative files
  1568. @cindex Administrative files, editing them
  1569. You edit the administrative files in the same way that you would edit
  1570. any other module. Use @samp{cvs checkout CVSROOT} to get a working
  1571. copy, edit it, and commit your changes in the normal way.
  1572. It is possible to commit an erroneous administrative
  1573. file. You can often fix the error and check in a new
  1574. revision, but sometimes a particularly bad error in the
  1575. administrative file makes it impossible to commit new
  1576. revisions.
  1577. @c @xref{Bad administrative files} for a hint
  1578. @c about how to solve such situations.
  1579. @c -- administrative file checking--
  1580. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1581. @node Multiple repositories
  1582. @section Multiple repositories
  1583. @cindex Multiple repositories
  1584. @cindex Repositories, multiple
  1585. @cindex Many repositories
  1586. @cindex Parallel repositories
  1587. @cindex Disjoint repositories
  1588. @cindex CVSROOT, multiple repositories
  1589. In some situations it is a good idea to have more than
  1590. one repository, for instance if you have two
  1591. development groups that work on separate projects
  1592. without sharing any code. All you have to do to have
  1593. several repositories is to specify the appropriate
  1594. repository, using the @code{CVSROOT} environment
  1595. variable, the @samp{-d} option to @sc{cvs}, or (once
  1596. you have checked out a working directory) by simply
  1597. allowing @sc{cvs} to use the repository that was used
  1598. to check out the working directory
  1599. (@pxref{Specifying a repository}).
  1600. The big advantage of having multiple repositories is
  1601. that they can reside on different servers. With @sc{cvs}
  1602. version 1.10, a single command cannot recurse into
  1603. directories from different repositories. With development
  1604. versions of @sc{cvs}, you can check out code from multiple
  1605. servers into your working directory. @sc{cvs} will
  1606. recurse and handle all the details of making
  1607. connections to as many server machines as necessary to
  1608. perform the requested command. Here is an example of
  1609. how to set up a working directory:
  1610. @example
  1611. cvs -d server1:/cvs co dir1
  1612. cd dir1
  1613. cvs -d server2:/root co sdir
  1614. cvs update
  1615. @end example
  1616. The @code{cvs co} commands set up the working
  1617. directory, and then the @code{cvs update} command will
  1618. contact server2, to update the dir1/sdir subdirectory,
  1619. and server1, to update everything else.
  1620. @c FIXME: Does the FAQ have more about this? I have a
  1621. @c dim recollection, but I'm too lazy to check right now.
  1622. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1623. @node Creating a repository
  1624. @section Creating a repository
  1625. @cindex Repository, setting up
  1626. @cindex Creating a repository
  1627. @cindex Setting up a repository
  1628. To set up a @sc{cvs} repository, first choose the
  1629. machine and disk on which you want to store the
  1630. revision history of the source files. CPU and memory
  1631. requirements are modest, so most machines should be
  1632. adequate. For details see @ref{Server requirements}.
  1633. @c Possible that we should be providing a quick rule of
  1634. @c thumb, like the 32M memory for the server. That
  1635. @c might increase the number of people who are happy
  1636. @c with the answer, without following the xref.
  1637. To estimate disk space
  1638. requirements, if you are importing RCS files from
  1639. another system, the size of those files is the
  1640. approximate initial size of your repository, or if you
  1641. are starting without any version history, a rule of
  1642. thumb is to allow for the server approximately three
  1643. times the size of the code to be under @sc{cvs} for the
  1644. repository (you will eventually outgrow this, but not
  1645. for a while). On the machines on which the developers
  1646. will be working, you'll want disk space for
  1647. approximately one working directory for each developer
  1648. (either the entire tree or a portion of it, depending
  1649. on what each developer uses).
  1650. The repository should be accessible
  1651. (directly or via a networked file system) from all
  1652. machines which want to use @sc{cvs} in server or local
  1653. mode; the client machines need not have any access to
  1654. it other than via the @sc{cvs} protocol. It is not
  1655. possible to use @sc{cvs} to read from a repository
  1656. which one only has read access to; @sc{cvs} needs to be
  1657. able to create lock files (@pxref{Concurrency}).
  1658. @cindex init (subcommand)
  1659. To create a repository, run the @code{cvs init}
  1660. command. It will set up an empty repository in the
  1661. @sc{cvs} root specified in the usual way
  1662. (@pxref{Repository}). For example,
  1663. @example
  1664. cvs -d /usr/local/cvsroot init
  1665. @end example
  1666. @code{cvs init} is careful to never overwrite any
  1667. existing files in the repository, so no harm is done if
  1668. you run @code{cvs init} on an already set-up
  1669. repository.
  1670. @code{cvs init} will enable history logging; if you
  1671. don't want that, remove the history file after running
  1672. @code{cvs init}. @xref{history file}.
  1673. @node Backing up
  1674. @section Backing up a repository
  1675. @cindex Repository, backing up
  1676. @cindex Backing up, repository
  1677. There is nothing particularly magical about the files
  1678. in the repository; for the most part it is possible to
  1679. back them up just like any other files. However, there
  1680. are a few issues to consider.
  1681. @cindex Locks, cvs, and backups
  1682. @cindex #cvs.rfl, and backups
  1683. The first is that to be paranoid, one should either not
  1684. use @sc{cvs} during the backup, or have the backup
  1685. program lock @sc{cvs} while doing the backup. To not
  1686. use @sc{cvs}, you might forbid logins to machines which
  1687. can access the repository, turn off your @sc{cvs}
  1688. server, or similar mechanisms. The details would
  1689. depend on your operating system and how you have
  1690. @sc{cvs} set up. To lock @sc{cvs}, you would create
  1691. @file{#cvs.rfl} locks in each repository directory.
  1692. See @ref{Concurrency}, for more on @sc{cvs} locks.
  1693. Having said all this, if you just back up without any
  1694. of these precautions, the results are unlikely to be
  1695. particularly dire. Restoring from backup, the
  1696. repository might be in an inconsistent state, but this
  1697. would not be particularly hard to fix manually.
  1698. When you restore a repository from backup, assuming
  1699. that changes in the repository were made after the time
  1700. of the backup, working directories which were not
  1701. affected by the failure may refer to revisions which no
  1702. longer exist in the repository. Trying to run @sc{cvs}
  1703. in such directories will typically produce an error
  1704. message. One way to get those changes back into the
  1705. repository is as follows:
  1706. @itemize @bullet
  1707. @item
  1708. Get a new working directory.
  1709. @item
  1710. Copy the files from the working directory from before
  1711. the failure over to the new working directory (do not
  1712. copy the contents of the @file{CVS} directories, of
  1713. course).
  1714. @item
  1715. Working in the new working directory, use commands such
  1716. as @code{cvs update} and @code{cvs diff} to figure out
  1717. what has changed, and then when you are ready, commit
  1718. the changes into the repository.
  1719. @end itemize
  1720. @node Moving a repository
  1721. @section Moving a repository
  1722. @cindex Repository, moving
  1723. @cindex Moving a repository
  1724. @cindex Copying a repository
  1725. Just as backing up the files in the repository is
  1726. pretty much like backing up any other files, if you
  1727. need to move a repository from one place to another it
  1728. is also pretty much like just moving any other
  1729. collection of files.
  1730. The main thing to consider is that working directories
  1731. point to the repository. The simplest way to deal with
  1732. a moved repository is to just get a fresh working
  1733. directory after the move. Of course, you'll want to
  1734. make sure that the old working directory had been
  1735. checked in before the move, or you figured out some
  1736. other way to make sure that you don't lose any
  1737. changes. If you really do want to reuse the existing
  1738. working directory, it should be possible with manual
  1739. surgery on the @file{CVS/Repository} files. You can
  1740. see @ref{Working directory storage}, for information on
  1741. the @file{CVS/Repository} and @file{CVS/Root} files, but
  1742. unless you are sure you want to bother, it probably
  1743. isn't worth it.
  1744. @c FIXME: Surgery on CVS/Repository should be avoided
  1745. @c by making RELATIVE_REPOS the default.
  1746. @c FIXME-maybe: might want some documented way to
  1747. @c change the CVS/Root files in some particular tree.
  1748. @c But then again, I don't know, maybe just having
  1749. @c people do this in perl/shell/&c isn't so bad...
  1750. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1751. @node Remote repositories
  1752. @section Remote repositories
  1753. @cindex Repositories, remote
  1754. @cindex Remote repositories
  1755. @cindex Client/Server Operation
  1756. @cindex Server, CVS
  1757. @cindex Remote repositories, port specification
  1758. @cindex Repositories, remote, port specification
  1759. @cindex Client/Server Operation, port specification
  1760. @cindex pserver (client/server connection method), port specification
  1761. @cindex kserver (client/server connection method), port specification
  1762. @cindex gserver (client/server connection method), port specification
  1763. @cindex port, specifying for remote repositories
  1764. Your working copy of the sources can be on a
  1765. different machine than the repository. Using @sc{cvs}
  1766. in this manner is known as @dfn{client/server}
  1767. operation. You run @sc{cvs} on a machine which can
  1768. mount your working directory, known as the
  1769. @dfn{client}, and tell it to communicate to a machine
  1770. which can mount the repository, known as the
  1771. @dfn{server}. Generally, using a remote
  1772. repository is just like using a local one, except that
  1773. the format of the repository name is:
  1774. @example
  1775. [:@var{method}:][[@var{user}][:@var{password}]@@]@var{hostname}[:[@var{port}]]/path/to/repository
  1776. @end example
  1777. Specifying a password in the repository name is not recommended during
  1778. checkout, since this will cause @sc{cvs} to store a cleartext copy of the
  1779. password in each created directory. @code{cvs login} first instead
  1780. (@pxref{Password authentication client}).
  1781. The details of exactly what needs to be set up depend
  1782. on how you are connecting to the server.
  1783. If @var{method} is not specified, and the repository
  1784. name contains @samp{:}, then the default is @code{ext}
  1785. or @code{server}, depending on your platform; both are
  1786. described in @ref{Connecting via rsh}.
  1787. @c Should we try to explain which platforms are which?
  1788. @c Platforms like unix and VMS, which only allow
  1789. @c privileged programs to bind to sockets <1024 lose on
  1790. @c :server:
  1791. @c Platforms like Mac and VMS, whose rsh program is
  1792. @c unusable or nonexistent, lose on :ext:
  1793. @c Platforms like OS/2 and NT probably could plausibly
  1794. @c default either way (modulo -b troubles).
  1795. @c FIXME: We need to have a better way of explaining
  1796. @c what method to use. This presentation totally
  1797. @c obscures the fact that :ext: and CVS_RSH is the way to
  1798. @c use SSH, for example. Plus it incorrectly implies
  1799. @c that you need an @code{rsh} binary on the client to use
  1800. @c :server:.
  1801. @c Also note that rsh not pserver is the right choice if you want
  1802. @c users to be able to create their own repositories
  1803. @c (because of the --allow-root related issues).
  1804. @menu
  1805. * Server requirements:: Memory and other resources for servers
  1806. * Connecting via rsh:: Using the @code{rsh} program to connect
  1807. * Password authenticated:: Direct connections using passwords
  1808. * GSSAPI authenticated:: Direct connections using GSSAPI
  1809. * Kerberos authenticated:: Direct connections with kerberos
  1810. * Connecting via fork:: Using a forked @code{cvs server} to connect
  1811. @end menu
  1812. @node Server requirements
  1813. @subsection Server requirements
  1814. The quick answer to what sort of machine is suitable as
  1815. a server is that requirements are modest---a server
  1816. with 32M of memory or even less can handle a fairly
  1817. large source tree with a fair amount of activity.
  1818. @c Say something about CPU speed too? I'm even less sure
  1819. @c what to say on that subject...
  1820. The real answer, of course, is more complicated.
  1821. Estimating the known areas of large memory consumption
  1822. should be sufficient to estimate memory requirements.
  1823. There are two such areas documented here; other memory
  1824. consumption should be small by comparison (if you find
  1825. that is not the case, let us know, as described in
  1826. @ref{BUGS}, so we can update this documentation).
  1827. The first area of big memory consumption is large
  1828. checkouts, when using the @sc{cvs} server. The server
  1829. consists of two processes for each client that it is
  1830. serving. Memory consumption on the child process
  1831. should remain fairly small. Memory consumption on the
  1832. parent process, particularly if the network connection
  1833. to the client is slow, can be expected to grow to
  1834. slightly more than the size of the sources in a single
  1835. directory, or two megabytes, whichever is larger.
  1836. @c "two megabytes" of course is SERVER_HI_WATER. But
  1837. @c we don't mention that here because we are
  1838. @c documenting the default configuration of CVS. If it
  1839. @c is a "standard" thing to change that value, it
  1840. @c should be some kind of run-time configuration.
  1841. @c
  1842. @c See cvsclient.texi for more on the design decision
  1843. @c to not have locks in place while waiting for the
  1844. @c client, which is what results in memory consumption
  1845. @c as high as this.
  1846. Multiplying the size of each @sc{cvs} server by the
  1847. number of servers which you expect to have active at
  1848. one time should give an idea of memory requirements for
  1849. the server. For the most part, the memory consumed by
  1850. the parent process probably can be swap space rather
  1851. than physical memory.
  1852. @c Has anyone verified that notion about swap space?
  1853. @c I say it based pretty much on guessing that the
  1854. @c ->text of the struct buffer_data only gets accessed
  1855. @c in a first in, first out fashion, but I haven't
  1856. @c looked very closely.
  1857. @c What about disk usage in /tmp on the server? I think that
  1858. @c it can be substantial, but I haven't looked at this
  1859. @c again and tried to figure it out ("cvs import" is
  1860. @c probably the worst case...).
  1861. The second area of large memory consumption is
  1862. @code{diff}, when checking in large files. This is
  1863. required even for binary files. The rule of thumb is
  1864. to allow about ten times the size of the largest file
  1865. you will want to check in, although five times may be
  1866. adequate. For example, if you want to check in a file
  1867. which is 10 megabytes, you should have 100 megabytes of
  1868. memory on the machine doing the checkin (the server
  1869. machine for client/server, or the machine running
  1870. @sc{cvs} for non-client/server). This can be swap
  1871. space rather than physical memory. Because the memory
  1872. is only required briefly, there is no particular need
  1873. to allow memory for more than one such checkin at a
  1874. time.
  1875. @c The 5-10 times rule of thumb is from Paul Eggert for
  1876. @c GNU diff. I don't think it is in the GNU diff
  1877. @c manual or anyplace like that.
  1878. @c
  1879. @c Probably we could be saying more about
  1880. @c non-client/server CVS.
  1881. @c I would guess for non-client/server CVS in an NFS
  1882. @c environment the biggest issues are the network and
  1883. @c the NFS server.
  1884. Resource consumption for the client is even more
  1885. modest---any machine with enough capacity to run the
  1886. operating system in question should have little
  1887. trouble.
  1888. @c Is that true? I think the client still wants to
  1889. @c (bogusly) store entire files in memory at times.
  1890. For information on disk space requirements, see
  1891. @ref{Creating a repository}.
  1892. @node Connecting via rsh
  1893. @subsection Connecting with rsh
  1894. @cindex rsh
  1895. @sc{cvs} uses the @samp{rsh} protocol to perform these
  1896. operations, so the remote user host needs to have a
  1897. @file{.rhosts} file which grants access to the local
  1898. user. Note that the program that @sc{cvs} uses for this
  1899. purpose may be specified using the @file{--with-rsh}
  1900. flag to configure.
  1901. For example, suppose you are the user @samp{mozart} on
  1902. the local machine @samp{toe.example.com}, and the
  1903. server machine is @samp{faun.example.org}. On
  1904. faun, put the following line into the file
  1905. @file{.rhosts} in @samp{bach}'s home directory:
  1906. @example
  1907. toe.example.com mozart
  1908. @end example
  1909. @noindent
  1910. Then test that @samp{rsh} is working with
  1911. @example
  1912. rsh -l bach faun.example.org 'echo $PATH'
  1913. @end example
  1914. @cindex CVS_SERVER, environment variable
  1915. Next you have to make sure that @code{rsh} will be able
  1916. to find the server. Make sure that the path which
  1917. @code{rsh} printed in the above example includes the
  1918. directory containing a program named @code{cvs} which
  1919. is the server. You need to set the path in
  1920. @file{.bashrc}, @file{.cshrc}, etc., not @file{.login}
  1921. or @file{.profile}. Alternately, you can set the
  1922. environment variable @code{CVS_SERVER} on the client
  1923. machine to the filename of the server you want to use,
  1924. for example @file{/usr/local/bin/cvs-1.6}.
  1925. @c FIXME: there should be a way to specify the
  1926. @c program in CVSROOT, not CVS_SERVER, so that one can use
  1927. @c different ones for different roots. e.g. ":server;cvs=cvs-1.6:"
  1928. @c instead of ":server:".
  1929. There is no need to edit @file{inetd.conf} or start a
  1930. @sc{cvs} server daemon.
  1931. @cindex :server:, setting up
  1932. @cindex :ext:, setting up
  1933. @cindex Kerberos, using kerberized rsh
  1934. @cindex SSH (rsh replacement)
  1935. @cindex rsh replacements (Kerberized, SSH, &c)
  1936. There are two access methods that you use in @code{CVSROOT}
  1937. for rsh. @code{:server:} specifies an internal rsh
  1938. client, which is supported only by some @sc{cvs} ports.
  1939. @code{:ext:} specifies an external rsh program. By
  1940. default this is @code{rsh} (unless otherwise specified
  1941. by the @file{--with-rsh} flag to configure) but you may set the
  1942. @code{CVS_RSH} environment variable to invoke another
  1943. program which can access the remote server (for
  1944. example, @code{remsh} on HP-UX 9 because @code{rsh} is
  1945. something different). It must be a program which can
  1946. transmit data to and from the server without modifying
  1947. it; for example the Windows NT @code{rsh} is not
  1948. suitable since it by default translates between CRLF
  1949. and LF. The OS/2 @sc{cvs} port has a hack to pass @samp{-b}
  1950. to @code{rsh} to get around this, but since this could
  1951. potentially cause problems for programs other than the
  1952. standard @code{rsh}, it may change in the future. If
  1953. you set @code{CVS_RSH} to @code{SSH} or some other rsh
  1954. replacement, the instructions in the rest of this
  1955. section concerning @file{.rhosts} and so on are likely
  1956. to be inapplicable; consult the documentation for your rsh
  1957. replacement.
  1958. @c FIXME: there should be a way to specify the
  1959. @c program in CVSROOT, not CVS_RSH, so that one can use
  1960. @c different ones for different roots. e.g. ":ext;rsh=remsh:"
  1961. @c instead of ":ext:".
  1962. @c See also the comment in src/client.c for rationale
  1963. @c concerning "rsh" being the default and never
  1964. @c "remsh".
  1965. Continuing our example, supposing you want to access
  1966. the module @file{foo} in the repository
  1967. @file{/usr/local/cvsroot/}, on machine
  1968. @file{faun.example.org}, you are ready to go:
  1969. @example
  1970. cvs -d :ext:bach@@faun.example.org:/usr/local/cvsroot checkout foo
  1971. @end example
  1972. @noindent
  1973. (The @file{bach@@} can be omitted if the username is
  1974. the same on both the local and remote hosts.)
  1975. @c Should we mention "rsh host echo hi" and "rsh host
  1976. @c cat" (the latter followed by typing text and ^D)
  1977. @c as troubleshooting techniques? Probably yes
  1978. @c (people tend to have trouble setting this up),
  1979. @c but this kind of thing can be hard to spell out.
  1980. @node Password authenticated
  1981. @subsection Direct connection with password authentication
  1982. The @sc{cvs} client can also connect to the server
  1983. using a password protocol. This is particularly useful
  1984. if using @code{rsh} is not feasible (for example,
  1985. the server is behind a firewall), and Kerberos also is
  1986. not available.
  1987. To use this method, it is necessary to make
  1988. some adjustments on both the server and client sides.
  1989. @menu
  1990. * Password authentication server:: Setting up the server
  1991. * Password authentication client:: Using the client
  1992. * Password authentication security:: What this method does and does not do
  1993. @end menu
  1994. @node Password authentication server
  1995. @subsubsection Setting up the server for password authentication
  1996. First of all, you probably want to tighten the
  1997. permissions on the @file{$CVSROOT} and
  1998. @file{$CVSROOT/CVSROOT} directories. See @ref{Password
  1999. authentication security}, for more details.
  2000. @cindex pserver (subcommand)
  2001. @cindex Remote repositories, port specification
  2002. @cindex Repositories, remote, port specification
  2003. @cindex Client/Server Operation, port specification
  2004. @cindex pserver (client/server connection method), port specification
  2005. @cindex kserver (client/server connection method), port specification
  2006. @cindex gserver (client/server connection method), port specification
  2007. @cindex port, specifying for remote repositories
  2008. @cindex Password server, setting up
  2009. @cindex Authenticating server, setting up
  2010. @cindex inetd, configuring for pserver
  2011. @cindex xinetd, configuring for pserver
  2012. @c FIXME: this isn't quite right regarding port
  2013. @c numbers; CVS looks up "cvspserver" in
  2014. @c /etc/services (on unix, but what about non-unix?).
  2015. On the server side, the file @file{/etc/inetd.conf}
  2016. needs to be edited so @code{inetd} knows to run the
  2017. command @code{cvs pserver} when it receives a
  2018. connection on the right port. By default, the port
  2019. number is 2401; it would be different if your client
  2020. were compiled with @code{CVS_AUTH_PORT} defined to
  2021. something else, though. This can also be specified in the CVSROOT variable
  2022. (@pxref{Remote repositories}) or overridden with the CVS_CLIENT_PORT
  2023. environment variable (@pxref{Environment variables}).
  2024. If your @code{inetd} allows raw port numbers in
  2025. @file{/etc/inetd.conf}, then the following (all on a
  2026. single line in @file{inetd.conf}) should be sufficient:
  2027. @example
  2028. 2401 stream tcp nowait root /usr/local/bin/cvs
  2029. cvs -f --allow-root=/usr/cvsroot pserver
  2030. @end example
  2031. @noindent
  2032. (You could also use the
  2033. @samp{-T} option to specify a temporary directory.)
  2034. The @samp{--allow-root} option specifies the allowable
  2035. @sc{cvsroot} directory. Clients which attempt to use a
  2036. different @sc{cvsroot} directory will not be allowed to
  2037. connect. If there is more than one @sc{cvsroot}
  2038. directory which you want to allow, repeat the option.
  2039. (Unfortunately, many versions of @code{inetd} have very small
  2040. limits on the number of arguments and/or the total length
  2041. of the command. The usual solution to this problem is
  2042. to have @code{inetd} run a shell script which then invokes
  2043. @sc{cvs} with the necessary arguments.)
  2044. If your @code{inetd} wants a symbolic service
  2045. name instead of a raw port number, then put this in
  2046. @file{/etc/services}:
  2047. @example
  2048. cvspserver 2401/tcp
  2049. @end example
  2050. @noindent
  2051. and put @code{cvspserver} instead of @code{2401} in @file{inetd.conf}.
  2052. If your system uses @code{xinetd} instead of @code{inetd},
  2053. the procedure is slightly different.
  2054. Create a file called @file{/etc/xinetd.d/cvspserver} containing the following:
  2055. @example
  2056. service cvspserver
  2057. @{
  2058. port = 2401
  2059. socket_type = stream
  2060. protocol = tcp
  2061. wait = no
  2062. user = root
  2063. passenv = PATH
  2064. server = /usr/local/bin/cvs
  2065. server_args = -f --allow-root=/usr/cvsroot pserver
  2066. @}
  2067. @end example
  2068. @noindent
  2069. (If @code{cvspserver} is defined in @file{/etc/services}, you can omit
  2070. the @code{port} line.)
  2071. Once the above is taken care of, restart your
  2072. @code{inetd}, or do whatever is necessary to force it
  2073. to reread its initialization files.
  2074. If you are having trouble setting this up, see
  2075. @ref{Connection}.
  2076. @cindex CVS passwd file
  2077. @cindex passwd (admin file)
  2078. Because the client stores and transmits passwords in
  2079. cleartext (almost---see @ref{Password authentication
  2080. security}, for details), a separate @sc{cvs} password
  2081. file is generally used, so people don't compromise
  2082. their regular passwords when they access the
  2083. repository. This file is
  2084. @file{$CVSROOT/CVSROOT/passwd} (@pxref{Intro
  2085. administrative files}). It uses a colon-separated
  2086. format, similar to @file{/etc/passwd} on Unix systems,
  2087. except that it has fewer fields: @sc{cvs} username,
  2088. optional password, and an optional system username for
  2089. @sc{cvs} to run as if authentication succeeds. Here is
  2090. an example @file{passwd} file with five entries:
  2091. @example
  2092. anonymous:
  2093. bach:ULtgRLXo7NRxs
  2094. spwang:1sOp854gDF3DY
  2095. melissa:tGX1fS8sun6rY:pubcvs
  2096. qproj:XR4EZcEs0szik:pubcvs
  2097. @end example
  2098. @noindent
  2099. (The passwords are encrypted according to the standard
  2100. Unix @code{crypt()} function, so it is possible to
  2101. paste in passwords directly from regular Unix
  2102. @file{/etc/passwd} files.)
  2103. The first line in the example will grant access to any
  2104. @sc{cvs} client attempting to authenticate as user
  2105. @code{anonymous}, no matter what password they use,
  2106. including an empty password. (This is typical for
  2107. sites granting anonymous read-only access; for
  2108. information on how to do the "read-only" part, see
  2109. @ref{Read-only access}.)
  2110. The second and third lines will grant access to
  2111. @code{bach} and @code{spwang} if they supply their
  2112. respective plaintext passwords.
  2113. @cindex User aliases
  2114. The fourth line will grant access to @code{melissa}, if
  2115. she supplies the correct password, but her @sc{cvs}
  2116. operations will actually run on the server side under
  2117. the system user @code{pubcvs}. Thus, there need not be
  2118. any system user named @code{melissa}, but there
  2119. @emph{must} be one named @code{pubcvs}.
  2120. The fifth line shows that system user identities can be
  2121. shared: any client who successfully authenticates as
  2122. @code{qproj} will actually run as @code{pubcvs}, just
  2123. as @code{melissa} does. That way you could create a
  2124. single, shared system user for each project in your
  2125. repository, and give each developer their own line in
  2126. the @file{$CVSROOT/CVSROOT/passwd} file. The @sc{cvs}
  2127. username on each line would be different, but the
  2128. system username would be the same. The reason to have
  2129. different @sc{cvs} usernames is that @sc{cvs} will log their
  2130. actions under those names: when @code{melissa} commits
  2131. a change to a project, the checkin is recorded in the
  2132. project's history under the name @code{melissa}, not
  2133. @code{pubcvs}. And the reason to have them share a
  2134. system username is so that you can arrange permissions
  2135. in the relevant area of the repository such that only
  2136. that account has write-permission there.
  2137. If the system-user field is present, all
  2138. password-authenticated @sc{cvs} commands run as that
  2139. user; if no system user is specified, @sc{cvs} simply
  2140. takes the @sc{cvs} username as the system username and
  2141. runs commands as that user. In either case, if there
  2142. is no such user on the system, then the @sc{cvs}
  2143. operation will fail (regardless of whether the client
  2144. supplied a valid password).
  2145. The password and system-user fields can both be omitted
  2146. (and if the system-user field is omitted, then also
  2147. omit the colon that would have separated it from the
  2148. encrypted password). For example, this would be a
  2149. valid @file{$CVSROOT/CVSROOT/passwd} file:
  2150. @example
  2151. anonymous::pubcvs
  2152. fish:rKa5jzULzmhOo:kfogel
  2153. sussman:1sOp854gDF3DY
  2154. @end example
  2155. @noindent
  2156. When the password field is omitted or empty, then the
  2157. client's authentication attempt will succeed with any
  2158. password, including the empty string. However, the
  2159. colon after the @sc{cvs} username is always necessary,
  2160. even if the password is empty.
  2161. @sc{cvs} can also fall back to use system authentication.
  2162. When authenticating a password, the server first checks
  2163. for the user in the @file{$CVSROOT/CVSROOT/passwd}
  2164. file. If it finds the user, it will use that entry for
  2165. authentication as described above. But if it does not
  2166. find the user, or if the @sc{cvs} @file{passwd} file
  2167. does not exist, then the server can try to authenticate
  2168. the username and password using the operating system's
  2169. user-lookup routines (this "fallback" behavior can be
  2170. disabled by setting @code{SystemAuth=no} in the
  2171. @sc{cvs} @file{config} file, @pxref{config}).
  2172. The default fallback behaviour is to look in
  2173. @file{/etc/passwd} for this system password unless your
  2174. system has PAM (Pluggable Authentication Modules)
  2175. and your @sc{cvs} server executable was configured to
  2176. use it at compile time (using @code{./configure --enable-pam} - see the
  2177. INSTALL file for more). In this case, PAM will be consulted instead.
  2178. This means that @sc{cvs} can be configured to use any password
  2179. authentication source PAM can be configured to use (possibilities
  2180. include a simple UNIX password, NIS, LDAP, and others) in its
  2181. global configuration file (usually @file{/etc/pam.conf}
  2182. or possibly @file{/etc/pam.d/cvs}). See your PAM documentation
  2183. for more details on PAM configuration.
  2184. Note that PAM is an experimental feature in @sc{cvs} and feedback is
  2185. encouraged. Please send a mail to one of the @sc{cvs} mailing lists
  2186. (@code{info-cvs@@gnu.org} or @code{bug-cvs@@gnu.org}) if you use the
  2187. @sc{cvs} PAM support.
  2188. @strong{WARNING: Using PAM gives the system administrator much more
  2189. flexibility about how @sc{cvs} users are authenticated but
  2190. no more security than other methods. See below for more.}
  2191. CVS needs an "auth" and "account" module in the
  2192. PAM configuration file. A typical PAM configuration
  2193. would therefore have the following lines
  2194. in @file{/etc/pam.conf} to emulate the standard @sc{cvs}
  2195. system @file{/etc/passwd} authentication:
  2196. @example
  2197. cvs auth required pam_unix.so
  2198. cvs account required pam_unix.so
  2199. @end example
  2200. The the equivalent @file{/etc/pam.d/cvs} would contain
  2201. @example
  2202. auth required pam_unix.so
  2203. account required pam_unix.so
  2204. @end example
  2205. Some systems require a full path to the module so that
  2206. @file{pam_unix.so} (Linux) would become something like
  2207. @file{/usr/lib/security/$ISA/pam_unix.so.1} (Sun Solaris).
  2208. See the @file{contrib/pam} subdirectory of the @sc{cvs}
  2209. source distribution for further example configurations.
  2210. The PAM service name given above as "cvs" is just
  2211. the service name in the default configuration amd can be
  2212. set using
  2213. @code{./configure --with-hardcoded-pam-service-name=<pam-service-name>}
  2214. before compiling. @sc{cvs} can also be configured to use whatever
  2215. name it is invoked as as its PAM service name using
  2216. @code{./configure --without-hardcoded-pam-service-name}, but this
  2217. feature should not be used if you may not have control of the name
  2218. @sc{cvs} will be invoked as.
  2219. Be aware, also, that falling back to system
  2220. authentication might be a security risk: @sc{cvs}
  2221. operations would then be authenticated with that user's
  2222. regular login password, and the password flies across
  2223. the network in plaintext. See @ref{Password
  2224. authentication security} for more on this.
  2225. This may be more of a problem with PAM authentication
  2226. because it is likely that the source of the system
  2227. password is some central authentication service like
  2228. LDAP which is also used to authenticate other services.
  2229. On the other hand, PAM makes it very easy to change your password
  2230. regularly. If they are given the option of a one-password system for
  2231. all of their activities, users are often more willing to change their
  2232. password on a regular basis.
  2233. In the non-PAM configuration where the password is stored in the
  2234. @file{CVSROOT/passwd} file, it is difficult to change passwords on a
  2235. regular basis since only administrative users (or in some cases
  2236. processes that act as an administrative user) are typicaly given
  2237. access to modify this file. Either there needs to be some
  2238. hand-crafted web page or set-uid program to update the file, or the
  2239. update needs to be done by submitting a request to an administrator to
  2240. perform the duty by hand. In the first case, having to remember to
  2241. update a separate password on a periodic basis can be difficult. In
  2242. the second case, the manual nature of the change will typically mean
  2243. that the password will not be changed unless it is absolutely
  2244. necessary.
  2245. Note that PAM administrators should probably avoid configuring
  2246. one-time-passwords (OTP) for @sc{cvs} authentication/authorization. If
  2247. OTPs are desired, the administrator may wish to encourage the use of
  2248. one of the other Client/Server access methods. See the section on
  2249. @pxref{Remote repositories} for a list of other methods.
  2250. Right now, the only way to put a password in the
  2251. @sc{cvs} @file{passwd} file is to paste it there from
  2252. somewhere else. Someday, there may be a @code{cvs
  2253. passwd} command.
  2254. Unlike many of the files in @file{$CVSROOT/CVSROOT}, it
  2255. is normal to edit the @file{passwd} file in-place,
  2256. rather than via @sc{cvs}. This is because of the
  2257. possible security risks of having the @file{passwd}
  2258. file checked out to people's working copies. If you do
  2259. want to include the @file{passwd} file in checkouts of
  2260. @file{$CVSROOT/CVSROOT}, see @ref{checkoutlist}.
  2261. @c We might also suggest using the @code{htpasswd} command
  2262. @c from freely available web servers as well, but that
  2263. @c would open up a can of worms in that the users next
  2264. @c questions are likely to be "where do I get it?" and
  2265. @c "how do I use it?"
  2266. @c Also note that htpasswd, at least the version I had,
  2267. @c likes to clobber the third field.
  2268. @node Password authentication client
  2269. @subsubsection Using the client with password authentication
  2270. @cindex Login (subcommand)
  2271. @cindex Password client, using
  2272. @cindex Authenticated client, using
  2273. @cindex :pserver:, setting up
  2274. To run a @sc{cvs} command on a remote repository via
  2275. the password-authenticating server, one specifies the
  2276. @code{pserver} protocol, optional username, repository host, an
  2277. optional port number, and path to the repository. For example:
  2278. @example
  2279. cvs -d :pserver:faun.example.org:/usr/local/cvsroot checkout someproj
  2280. @end example
  2281. @noindent
  2282. or
  2283. @example
  2284. CVSROOT=:pserver:bach@@faun.example.org:2401/usr/local/cvsroot
  2285. cvs checkout someproj
  2286. @end example
  2287. However, unless you're connecting to a public-access
  2288. repository (i.e., one where that username doesn't
  2289. require a password), you'll need to supply a password or @dfn{log in} first.
  2290. Logging in verifies your password with the repository and stores it in a file.
  2291. It's done with the @code{login} command, which will
  2292. prompt you interactively for the password if you didn't supply one as part of
  2293. @var{$CVSROOT}:
  2294. @example
  2295. cvs -d :pserver:bach@@faun.example.org:/usr/local/cvsroot login
  2296. CVS password:
  2297. @end example
  2298. @noindent
  2299. or
  2300. @example
  2301. cvs -d :pserver:bach:p4ss30rd@@faun.example.org:/usr/local/cvsroot login
  2302. @end example
  2303. After you enter the password, @sc{cvs} verifies it with
  2304. the server. If the verification succeeds, then that
  2305. combination of username, host, repository, and password
  2306. is permanently recorded, so future transactions with
  2307. that repository won't require you to run @code{cvs
  2308. login}. (If verification fails, @sc{cvs} will exit
  2309. complaining that the password was incorrect, and
  2310. nothing will be recorded.)
  2311. The records are stored, by default, in the file
  2312. @file{$HOME/.cvspass}. That file's format is
  2313. human-readable, and to a degree human-editable, but
  2314. note that the passwords are not stored in
  2315. cleartext---they are trivially encoded to protect them
  2316. from "innocent" compromise (i.e., inadvertent viewing
  2317. by a system administrator or other non-malicious
  2318. person).
  2319. @cindex CVS_PASSFILE, environment variable
  2320. You can change the default location of this file by
  2321. setting the @code{CVS_PASSFILE} environment variable.
  2322. If you use this variable, make sure you set it
  2323. @emph{before} @code{cvs login} is run. If you were to
  2324. set it after running @code{cvs login}, then later
  2325. @sc{cvs} commands would be unable to look up the
  2326. password for transmission to the server.
  2327. Once you have logged in, all @sc{cvs} commands using
  2328. that remote repository and username will authenticate
  2329. with the stored password. So, for example
  2330. @example
  2331. cvs -d :pserver:bach@@faun.example.org:/usr/local/cvsroot checkout foo
  2332. @end example
  2333. @noindent
  2334. should just work (unless the password changes on the
  2335. server side, in which case you'll have to re-run
  2336. @code{cvs login}).
  2337. Note that if the @samp{:pserver:} were not present in
  2338. the repository specification, @sc{cvs} would assume it
  2339. should use @code{rsh} to connect with the server
  2340. instead (@pxref{Connecting via rsh}).
  2341. Of course, once you have a working copy checked out and
  2342. are running @sc{cvs} commands from within it, there is
  2343. no longer any need to specify the repository
  2344. explicitly, because @sc{cvs} can deduce the repository
  2345. from the working copy's @file{CVS} subdirectory.
  2346. @c FIXME: seems to me this needs somewhat more
  2347. @c explanation.
  2348. @cindex Logout (subcommand)
  2349. The password for a given remote repository can be
  2350. removed from the @code{CVS_PASSFILE} by using the
  2351. @code{cvs logout} command.
  2352. @node Password authentication security
  2353. @subsubsection Security considerations with password authentication
  2354. @cindex Security, of pserver
  2355. The passwords are stored on the client side in a
  2356. trivial encoding of the cleartext, and transmitted in
  2357. the same encoding. The encoding is done only to
  2358. prevent inadvertent password compromises (i.e., a
  2359. system administrator accidentally looking at the file),
  2360. and will not prevent even a naive attacker from gaining
  2361. the password.
  2362. @c FIXME: The bit about "access to the repository
  2363. @c implies general access to the system is *not* specific
  2364. @c to pserver; it applies to kerberos and SSH and
  2365. @c everything else too. Should reorganize the
  2366. @c documentation to make this clear.
  2367. The separate @sc{cvs} password file (@pxref{Password
  2368. authentication server}) allows people
  2369. to use a different password for repository access than
  2370. for login access. On the other hand, once a user has
  2371. non-read-only
  2372. access to the repository, she can execute programs on
  2373. the server system through a variety of means. Thus, repository
  2374. access implies fairly broad system access as well. It
  2375. might be possible to modify @sc{cvs} to prevent that,
  2376. but no one has done so as of this writing.
  2377. @c OpenBSD uses chroot() and copies the repository to
  2378. @c provide anonymous read-only access (for details see
  2379. @c http://www.openbsd.org/anoncvs.shar). While this
  2380. @c closes the most obvious holes, I'm not sure it
  2381. @c closes enough holes to recommend it (plus it is
  2382. @c *very* easy to accidentally screw up a setup of this
  2383. @c type).
  2384. Note that because the @file{$CVSROOT/CVSROOT} directory
  2385. contains @file{passwd} and other files which are used
  2386. to check security, you must control the permissions on
  2387. this directory as tightly as the permissions on
  2388. @file{/etc}. The same applies to the @file{$CVSROOT}
  2389. directory itself and any directory
  2390. above it in the tree. Anyone who has write access to
  2391. such a directory will have the ability to become any
  2392. user on the system. Note that these permissions are
  2393. typically tighter than you would use if you are not
  2394. using pserver.
  2395. @c TODO: Would be really nice to document/implement a
  2396. @c scheme where the CVS server can run as some non-root
  2397. @c user, e.g. "cvs". CVSROOT/passwd would contain a
  2398. @c bunch of entries of the form foo:xxx:cvs (or the "cvs"
  2399. @c would be implicit). This would greatly reduce
  2400. @c security risks such as those hinted at in the
  2401. @c previous paragraph. I think minor changes to CVS
  2402. @c might be required but mostly this would just need
  2403. @c someone who wants to play with it, document it, &c.
  2404. In summary, anyone who gets the password gets
  2405. repository access (which may imply some measure of general system
  2406. access as well). The password is available to anyone
  2407. who can sniff network packets or read a protected
  2408. (i.e., user read-only) file. If you want real
  2409. security, get Kerberos.
  2410. @node GSSAPI authenticated
  2411. @subsection Direct connection with GSSAPI
  2412. @cindex GSSAPI
  2413. @cindex Security, GSSAPI
  2414. @cindex :gserver:, setting up
  2415. @cindex Kerberos, using :gserver:
  2416. GSSAPI is a generic interface to network security
  2417. systems such as Kerberos 5.
  2418. If you have a working GSSAPI library, you can have
  2419. @sc{cvs} connect via a direct @sc{tcp} connection,
  2420. authenticating with GSSAPI.
  2421. To do this, @sc{cvs} needs to be compiled with GSSAPI
  2422. support; when configuring @sc{cvs} it tries to detect
  2423. whether GSSAPI libraries using kerberos version 5 are
  2424. present. You can also use the @file{--with-gssapi}
  2425. flag to configure.
  2426. The connection is authenticated using GSSAPI, but the
  2427. message stream is @emph{not} authenticated by default.
  2428. You must use the @code{-a} global option to request
  2429. stream authentication.
  2430. The data transmitted is @emph{not} encrypted by
  2431. default. Encryption support must be compiled into both
  2432. the client and the server; use the
  2433. @file{--enable-encrypt} configure option to turn it on.
  2434. You must then use the @code{-x} global option to
  2435. request encryption.
  2436. GSSAPI connections are handled on the server side by
  2437. the same server which handles the password
  2438. authentication server; see @ref{Password authentication
  2439. server}. If you are using a GSSAPI mechanism such as
  2440. Kerberos which provides for strong authentication, you
  2441. will probably want to disable the ability to
  2442. authenticate via cleartext passwords. To do so, create
  2443. an empty @file{CVSROOT/passwd} password file, and set
  2444. @code{SystemAuth=no} in the config file
  2445. (@pxref{config}).
  2446. The GSSAPI server uses a principal name of
  2447. cvs/@var{hostname}, where @var{hostname} is the
  2448. canonical name of the server host. You will have to
  2449. set this up as required by your GSSAPI mechanism.
  2450. To connect using GSSAPI, use @samp{:gserver:}. For
  2451. example,
  2452. @example
  2453. cvs -d :gserver:faun.example.org:/usr/local/cvsroot checkout foo
  2454. @end example
  2455. @node Kerberos authenticated
  2456. @subsection Direct connection with kerberos
  2457. @cindex Kerberos, using :kserver:
  2458. @cindex Security, kerberos
  2459. @cindex :kserver:, setting up
  2460. The easiest way to use kerberos is to use the kerberos
  2461. @code{rsh}, as described in @ref{Connecting via rsh}.
  2462. The main disadvantage of using rsh is that all the data
  2463. needs to pass through additional programs, so it may be
  2464. slower. So if you have kerberos installed you can
  2465. connect via a direct @sc{tcp} connection,
  2466. authenticating with kerberos.
  2467. This section concerns the kerberos network security
  2468. system, version 4. Kerberos version 5 is supported via
  2469. the GSSAPI generic network security interface, as
  2470. described in the previous section.
  2471. To do this, @sc{cvs} needs to be compiled with kerberos
  2472. support; when configuring @sc{cvs} it tries to detect
  2473. whether kerberos is present or you can use the
  2474. @file{--with-krb4} flag to configure.
  2475. The data transmitted is @emph{not} encrypted by
  2476. default. Encryption support must be compiled into both
  2477. the client and server; use the
  2478. @file{--enable-encryption} configure option to turn it
  2479. on. You must then use the @code{-x} global option to
  2480. request encryption.
  2481. @cindex CVS_CLIENT_PORT
  2482. You need to edit @file{inetd.conf} on the server
  2483. machine to run @code{cvs kserver}. The client uses
  2484. port 1999 by default; if you want to use another port
  2485. specify it in the @code{CVSROOT} (@pxref{Remote repositories})
  2486. or the @code{CVS_CLIENT_PORT} environment variable
  2487. (@pxref{Environment variables}) on the client.
  2488. @cindex kinit
  2489. When you want to use @sc{cvs}, get a ticket in the
  2490. usual way (generally @code{kinit}); it must be a ticket
  2491. which allows you to log into the server machine. Then
  2492. you are ready to go:
  2493. @example
  2494. cvs -d :kserver:faun.example.org:/usr/local/cvsroot checkout foo
  2495. @end example
  2496. Previous versions of @sc{cvs} would fall back to a
  2497. connection via rsh; this version will not do so.
  2498. @node Connecting via fork
  2499. @subsection Connecting with fork
  2500. @cindex fork, access method
  2501. @cindex :fork:, setting up
  2502. This access method allows you to connect to a
  2503. repository on your local disk via the remote protocol.
  2504. In other words it does pretty much the same thing as
  2505. @code{:local:}, but various quirks, bugs and the like are
  2506. those of the remote @sc{cvs} rather than the local
  2507. @sc{cvs}.
  2508. For day-to-day operations you might prefer either
  2509. @code{:local:} or @code{:fork:}, depending on your
  2510. preferences. Of course @code{:fork:} comes in
  2511. particularly handy in testing or
  2512. debugging @code{cvs} and the remote protocol.
  2513. Specifically, we avoid all of the network-related
  2514. setup/configuration, timeouts, and authentication
  2515. inherent in the other remote access methods but still
  2516. create a connection which uses the remote protocol.
  2517. To connect using the @code{fork} method, use
  2518. @samp{:fork:} and the pathname to your local
  2519. repository. For example:
  2520. @example
  2521. cvs -d :fork:/usr/local/cvsroot checkout foo
  2522. @end example
  2523. @cindex CVS_SERVER, and :fork:
  2524. As with @code{:ext:}, the server is called @samp{cvs}
  2525. by default, or the value of the @code{CVS_SERVER}
  2526. environment variable.
  2527. @c ---------------------------------------------------------------------
  2528. @node Read-only access
  2529. @section Read-only repository access
  2530. @cindex Read-only repository access
  2531. @cindex readers (admin file)
  2532. @cindex writers (admin file)
  2533. It is possible to grant read-only repository
  2534. access to people using the password-authenticated
  2535. server (@pxref{Password authenticated}). (The
  2536. other access methods do not have explicit support for
  2537. read-only users because those methods all assume login
  2538. access to the repository machine anyway, and therefore
  2539. the user can do whatever local file permissions allow
  2540. her to do.)
  2541. A user who has read-only access can do only
  2542. those @sc{cvs} operations which do not modify the
  2543. repository, except for certain ``administrative'' files
  2544. (such as lock files and the history file). It may be
  2545. desirable to use this feature in conjunction with
  2546. user-aliasing (@pxref{Password authentication server}).
  2547. Unlike with previous versions of @sc{cvs}, read-only
  2548. users should be able merely to read the repository, and
  2549. not to execute programs on the server or otherwise gain
  2550. unexpected levels of access. Or to be more accurate,
  2551. the @emph{known} holes have been plugged. Because this
  2552. feature is new and has not received a comprehensive
  2553. security audit, you should use whatever level of
  2554. caution seems warranted given your attitude concerning
  2555. security.
  2556. There are two ways to specify read-only access
  2557. for a user: by inclusion, and by exclusion.
  2558. "Inclusion" means listing that user
  2559. specifically in the @file{$CVSROOT/CVSROOT/readers}
  2560. file, which is simply a newline-separated list of
  2561. users. Here is a sample @file{readers} file:
  2562. @example
  2563. melissa
  2564. splotnik
  2565. jrandom
  2566. @end example
  2567. @noindent
  2568. (Don't forget the newline after the last user.)
  2569. "Exclusion" means explicitly listing everyone
  2570. who has @emph{write} access---if the file
  2571. @example
  2572. $CVSROOT/CVSROOT/writers
  2573. @end example
  2574. @noindent
  2575. exists, then only
  2576. those users listed in it have write access, and
  2577. everyone else has read-only access (of course, even the
  2578. read-only users still need to be listed in the
  2579. @sc{cvs} @file{passwd} file). The
  2580. @file{writers} file has the same format as the
  2581. @file{readers} file.
  2582. Note: if your @sc{cvs} @file{passwd}
  2583. file maps cvs users onto system users (@pxref{Password
  2584. authentication server}), make sure you deny or grant
  2585. read-only access using the @emph{cvs} usernames, not
  2586. the system usernames. That is, the @file{readers} and
  2587. @file{writers} files contain cvs usernames, which may
  2588. or may not be the same as system usernames.
  2589. Here is a complete description of the server's
  2590. behavior in deciding whether to grant read-only or
  2591. read-write access:
  2592. If @file{readers} exists, and this user is
  2593. listed in it, then she gets read-only access. Or if
  2594. @file{writers} exists, and this user is NOT listed in
  2595. it, then she also gets read-only access (this is true
  2596. even if @file{readers} exists but she is not listed
  2597. there). Otherwise, she gets full read-write access.
  2598. Of course there is a conflict if the user is
  2599. listed in both files. This is resolved in the more
  2600. conservative way, it being better to protect the
  2601. repository too much than too little: such a user gets
  2602. read-only access.
  2603. @node Server temporary directory
  2604. @section Temporary directories for the server
  2605. @cindex Temporary directories, and server
  2606. @cindex Server, temporary directories
  2607. While running, the @sc{cvs} server creates temporary
  2608. directories. They are named
  2609. @example
  2610. cvs-serv@var{pid}
  2611. @end example
  2612. @noindent
  2613. where @var{pid} is the process identification number of
  2614. the server.
  2615. They are located in the directory specified by
  2616. the @samp{-T} global option (@pxref{Global options}),
  2617. the @code{TMPDIR} environment variable (@pxref{Environment variables}),
  2618. or, failing that, @file{/tmp}.
  2619. In most cases the server will remove the temporary
  2620. directory when it is done, whether it finishes normally
  2621. or abnormally. However, there are a few cases in which
  2622. the server does not or cannot remove the temporary
  2623. directory, for example:
  2624. @itemize @bullet
  2625. @item
  2626. If the server aborts due to an internal server error,
  2627. it may preserve the directory to aid in debugging
  2628. @item
  2629. If the server is killed in a way that it has no way of
  2630. cleaning up (most notably, @samp{kill -KILL} on unix).
  2631. @item
  2632. If the system shuts down without an orderly shutdown,
  2633. which tells the server to clean up.
  2634. @end itemize
  2635. In cases such as this, you will need to manually remove
  2636. the @file{cvs-serv@var{pid}} directories. As long as
  2637. there is no server running with process identification
  2638. number @var{pid}, it is safe to do so.
  2639. @c ---------------------------------------------------------------------
  2640. @node Starting a new project
  2641. @chapter Starting a project with CVS
  2642. @cindex Starting a project with CVS
  2643. @cindex Creating a project
  2644. @comment --moduledb--
  2645. Because renaming files and moving them between
  2646. directories is somewhat inconvenient, the first thing
  2647. you do when you start a new project should be to think
  2648. through your file organization. It is not impossible
  2649. to rename or move files, but it does increase the
  2650. potential for confusion and @sc{cvs} does have some
  2651. quirks particularly in the area of renaming
  2652. directories. @xref{Moving files}.
  2653. What to do next depends on the situation at hand.
  2654. @menu
  2655. * Setting up the files:: Getting the files into the repository
  2656. * Defining the module:: How to make a module of the files
  2657. @end menu
  2658. @c -- File permissions!
  2659. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2660. @node Setting up the files
  2661. @section Setting up the files
  2662. The first step is to create the files inside the repository. This can
  2663. be done in a couple of different ways.
  2664. @c -- The contributed scripts
  2665. @menu
  2666. * From files:: This method is useful with old projects
  2667. where files already exists.
  2668. * From other version control systems:: Old projects where you want to
  2669. preserve history from another system.
  2670. * From scratch:: Creating a directory tree from scratch.
  2671. @end menu
  2672. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  2673. @node From files
  2674. @subsection Creating a directory tree from a number of files
  2675. @cindex Importing files
  2676. When you begin using @sc{cvs}, you will probably already have several
  2677. projects that can be
  2678. put under @sc{cvs} control. In these cases the easiest way is to use the
  2679. @code{import} command. An example is probably the easiest way to
  2680. explain how to use it. If the files you want to install in
  2681. @sc{cvs} reside in @file{@var{wdir}}, and you want them to appear in the
  2682. repository as @file{$CVSROOT/yoyodyne/@var{rdir}}, you can do this:
  2683. @example
  2684. $ cd @var{wdir}
  2685. $ cvs import -m "Imported sources" yoyodyne/@var{rdir} yoyo start
  2686. @end example
  2687. Unless you supply a log message with the @samp{-m}
  2688. flag, @sc{cvs} starts an editor and prompts for a
  2689. message. The string @samp{yoyo} is a @dfn{vendor tag},
  2690. and @samp{start} is a @dfn{release tag}. They may fill
  2691. no purpose in this context, but since @sc{cvs} requires
  2692. them they must be present. @xref{Tracking sources}, for
  2693. more information about them.
  2694. You can now verify that it worked, and remove your
  2695. original source directory.
  2696. @c FIXME: Need to say more about "verify that it
  2697. @c worked". What should the user look for in the output
  2698. @c from "diff -r"?
  2699. @example
  2700. $ cd ..
  2701. $ cvs checkout yoyodyne/@var{rdir} # @r{Explanation below}
  2702. $ diff -r @var{wdir} yoyodyne/@var{rdir}
  2703. $ rm -r @var{wdir}
  2704. @end example
  2705. @noindent
  2706. Erasing the original sources is a good idea, to make sure that you do
  2707. not accidentally edit them in @var{wdir}, bypassing @sc{cvs}.
  2708. Of course, it would be wise to make sure that you have
  2709. a backup of the sources before you remove them.
  2710. The @code{checkout} command can either take a module
  2711. name as argument (as it has done in all previous
  2712. examples) or a path name relative to @code{$CVSROOT},
  2713. as it did in the example above.
  2714. It is a good idea to check that the permissions
  2715. @sc{cvs} sets on the directories inside @code{$CVSROOT}
  2716. are reasonable, and that they belong to the proper
  2717. groups. @xref{File permissions}.
  2718. If some of the files you want to import are binary, you
  2719. may want to use the wrappers features to specify which
  2720. files are binary and which are not. @xref{Wrappers}.
  2721. @c The node name is too long, but I am having trouble
  2722. @c thinking of something more concise.
  2723. @node From other version control systems
  2724. @subsection Creating Files From Other Version Control Systems
  2725. @cindex Importing files, from other version control systems
  2726. If you have a project which you are maintaining with
  2727. another version control system, such as @sc{rcs}, you
  2728. may wish to put the files from that project into
  2729. @sc{cvs}, and preserve the revision history of the
  2730. files.
  2731. @table @asis
  2732. @cindex RCS, importing files from
  2733. @item From RCS
  2734. If you have been using @sc{rcs}, find the @sc{rcs}
  2735. files---usually a file named @file{foo.c} will have its
  2736. @sc{rcs} file in @file{RCS/foo.c,v} (but it could be
  2737. other places; consult the @sc{rcs} documentation for
  2738. details). Then create the appropriate directories in
  2739. @sc{cvs} if they do not already exist. Then copy the
  2740. files into the appropriate directories in the @sc{cvs}
  2741. repository (the name in the repository must be the name
  2742. of the source file with @samp{,v} added; the files go
  2743. directly in the appropriate directory of the repository,
  2744. not in an @file{RCS} subdirectory). This is one of the
  2745. few times when it is a good idea to access the @sc{cvs}
  2746. repository directly, rather than using @sc{cvs}
  2747. commands. Then you are ready to check out a new
  2748. working directory.
  2749. @c Someday there probably should be a "cvs import -t
  2750. @c rcs" or some such. It could even create magic
  2751. @c branches. It could also do something about the case
  2752. @c where the RCS file had a (non-magic) "0" branch.
  2753. The @sc{rcs} file should not be locked when you move it
  2754. into @sc{cvs}; if it is, @sc{cvs} will have trouble
  2755. letting you operate on it.
  2756. @c What is the easiest way to unlock your files if you
  2757. @c have them locked? Especially if you have a lot of them?
  2758. @c This is a CVS bug/misfeature; importing RCS files
  2759. @c should ignore whether they are locked and leave them in
  2760. @c an unlocked state. Yet another reason for a separate
  2761. @c "import RCS file" command.
  2762. @c How many is "many"? Or do they just import RCS files?
  2763. @item From another version control system
  2764. Many version control systems have the ability to export
  2765. @sc{rcs} files in the standard format. If yours does,
  2766. export the @sc{rcs} files and then follow the above
  2767. instructions.
  2768. Failing that, probably your best bet is to write a
  2769. script that will check out the files one revision at a
  2770. time using the command line interface to the other
  2771. system, and then check the revisions into @sc{cvs}.
  2772. The @file{sccs2rcs} script mentioned below may be a
  2773. useful example to follow.
  2774. @cindex SCCS, importing files from
  2775. @item From SCCS
  2776. There is a script in the @file{contrib} directory of
  2777. the @sc{cvs} source distribution called @file{sccs2rcs}
  2778. which converts @sc{sccs} files to @sc{rcs} files.
  2779. Note: you must run it on a machine which has both
  2780. @sc{sccs} and @sc{rcs} installed, and like everything
  2781. else in contrib it is unsupported (your mileage may
  2782. vary).
  2783. @cindex PVCS, importing files from
  2784. @item From PVCS
  2785. There is a script in the @file{contrib} directory of
  2786. the @sc{cvs} source distribution called @file{pvcs_to_rcs}
  2787. which converts @sc{pvcs} archives to @sc{rcs} files.
  2788. You must run it on a machine which has both
  2789. @sc{pvcs} and @sc{rcs} installed, and like everything
  2790. else in contrib it is unsupported (your mileage may
  2791. vary). See the comments in the script for details.
  2792. @end table
  2793. @c CMZ and/or PATCHY were systems that were used in the
  2794. @c high energy physics community (especially for
  2795. @c CERNLIB). CERN has replaced them with CVS, but the
  2796. @c CAR format seems to live on as a way to submit
  2797. @c changes. There is a program car2cvs which converts
  2798. @c but I'm not sure where one gets a copy.
  2799. @c Not sure it is worth mentioning here, since it would
  2800. @c appear to affect only one particular community.
  2801. @c Best page for more information is:
  2802. @c http://wwwcn1.cern.ch/asd/cvs/index.html
  2803. @c See also:
  2804. @c http://ecponion.cern.ch/ecpsa/cernlib.html
  2805. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  2806. @node From scratch
  2807. @subsection Creating a directory tree from scratch
  2808. @c Also/instead should be documenting
  2809. @c $ cvs co -l .
  2810. @c $ mkdir tc
  2811. @c $ cvs add tc
  2812. @c $ cd tc
  2813. @c $ mkdir man
  2814. @c $ cvs add man
  2815. @c etc.
  2816. @c Using import to create the directories only is
  2817. @c probably a somewhat confusing concept.
  2818. For a new project, the easiest thing to do is probably
  2819. to create an empty directory structure, like this:
  2820. @example
  2821. $ mkdir tc
  2822. $ mkdir tc/man
  2823. $ mkdir tc/testing
  2824. @end example
  2825. After that, you use the @code{import} command to create
  2826. the corresponding (empty) directory structure inside
  2827. the repository:
  2828. @example
  2829. $ cd tc
  2830. $ cvs import -m "Created directory structure" yoyodyne/@var{dir} yoyo start
  2831. @end example
  2832. Then, use @code{add} to add files (and new directories)
  2833. as they appear.
  2834. Check that the permissions @sc{cvs} sets on the
  2835. directories inside @code{$CVSROOT} are reasonable.
  2836. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2837. @node Defining the module
  2838. @section Defining the module
  2839. @cindex Defining a module
  2840. @cindex Editing the modules file
  2841. @cindex Module, defining
  2842. @cindex Modules file, changing
  2843. The next step is to define the module in the
  2844. @file{modules} file. This is not strictly necessary,
  2845. but modules can be convenient in grouping together
  2846. related files and directories.
  2847. In simple cases these steps are sufficient to define a module.
  2848. @enumerate
  2849. @item
  2850. Get a working copy of the modules file.
  2851. @example
  2852. $ cvs checkout CVSROOT/modules
  2853. $ cd CVSROOT
  2854. @end example
  2855. @item
  2856. Edit the file and insert a line that defines the module. @xref{Intro
  2857. administrative files}, for an introduction. @xref{modules}, for a full
  2858. description of the modules file. You can use the
  2859. following line to define the module @samp{tc}:
  2860. @example
  2861. tc yoyodyne/tc
  2862. @end example
  2863. @item
  2864. Commit your changes to the modules file.
  2865. @example
  2866. $ cvs commit -m "Added the tc module." modules
  2867. @end example
  2868. @item
  2869. Release the modules module.
  2870. @example
  2871. $ cd ..
  2872. $ cvs release -d CVSROOT
  2873. @end example
  2874. @end enumerate
  2875. @c ---------------------------------------------------------------------
  2876. @node Revisions
  2877. @chapter Revisions
  2878. For many uses of @sc{cvs}, one doesn't need to worry
  2879. too much about revision numbers; @sc{cvs} assigns
  2880. numbers such as @code{1.1}, @code{1.2}, and so on, and
  2881. that is all one needs to know. However, some people
  2882. prefer to have more knowledge and control concerning
  2883. how @sc{cvs} assigns revision numbers.
  2884. If one wants to keep track of a set of revisions
  2885. involving more than one file, such as which revisions
  2886. went into a particular release, one uses a @dfn{tag},
  2887. which is a symbolic revision which can be assigned to a
  2888. numeric revision in each file.
  2889. @menu
  2890. * Revision numbers:: The meaning of a revision number
  2891. * Versions revisions releases:: Terminology used in this manual
  2892. * Assigning revisions:: Assigning revisions
  2893. * Tags:: Tags--Symbolic revisions
  2894. * Tagging the working directory:: The cvs tag command
  2895. * Tagging by date/tag:: The cvs rtag command
  2896. * Modifying tags:: Adding, renaming, and deleting tags
  2897. * Tagging add/remove:: Tags with adding and removing files
  2898. * Sticky tags:: Certain tags are persistent
  2899. @end menu
  2900. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2901. @node Revision numbers
  2902. @section Revision numbers
  2903. @cindex Revision numbers
  2904. @cindex Revision tree
  2905. @cindex Linear development
  2906. @cindex Number, revision-
  2907. @cindex Decimal revision number
  2908. @cindex Branch number
  2909. @cindex Number, branch
  2910. Each version of a file has a unique @dfn{revision
  2911. number}. Revision numbers look like @samp{1.1},
  2912. @samp{1.2}, @samp{1.3.2.2} or even @samp{1.3.2.2.4.5}.
  2913. A revision number always has an even number of
  2914. period-separated decimal integers. By default revision
  2915. 1.1 is the first revision of a file. Each successive
  2916. revision is given a new number by increasing the
  2917. rightmost number by one. The following figure displays
  2918. a few revisions, with newer revisions to the right.
  2919. @example
  2920. +-----+ +-----+ +-----+ +-----+ +-----+
  2921. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 !
  2922. +-----+ +-----+ +-----+ +-----+ +-----+
  2923. @end example
  2924. It is also possible to end up with numbers containing
  2925. more than one period, for example @samp{1.3.2.2}. Such
  2926. revisions represent revisions on branches
  2927. (@pxref{Branching and merging}); such revision numbers
  2928. are explained in detail in @ref{Branches and
  2929. revisions}.
  2930. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2931. @node Versions revisions releases
  2932. @section Versions, revisions and releases
  2933. @cindex Revisions, versions and releases
  2934. @cindex Versions, revisions and releases
  2935. @cindex Releases, revisions and versions
  2936. A file can have several versions, as described above.
  2937. Likewise, a software product can have several versions.
  2938. A software product is often given a version number such
  2939. as @samp{4.1.1}.
  2940. Versions in the first sense are called @dfn{revisions}
  2941. in this document, and versions in the second sense are
  2942. called @dfn{releases}. To avoid confusion, the word
  2943. @dfn{version} is almost never used in this document.
  2944. @node Assigning revisions
  2945. @section Assigning revisions
  2946. @c We avoid the "major revision" terminology. It seems
  2947. @c like jargon. Hopefully "first number" is clear enough.
  2948. @c
  2949. @c Well, in the context of software release numbers,
  2950. @c "major" and "minor" release or version numbers are
  2951. @c documented in at least the GNU Coding Standards, but I'm
  2952. @c still not sure I find that a valid reason to apply the
  2953. @c terminology to RCS revision numbers. "First", "Second",
  2954. @c "subsequent", and so on is almost surely clearer,
  2955. @c especially to a novice reader. -DRP
  2956. By default, @sc{cvs} will assign numeric revisions by
  2957. leaving the first number the same and incrementing the
  2958. second number. For example, @code{1.1}, @code{1.2},
  2959. @code{1.3}, etc.
  2960. When adding a new file, the second number will always
  2961. be one and the first number will equal the highest
  2962. first number of any file in that directory. For
  2963. example, the current directory contains files whose
  2964. highest numbered revisions are @code{1.7}, @code{3.1},
  2965. and @code{4.12}, then an added file will be given the
  2966. numeric revision @code{4.1}.
  2967. @c This is sort of redundant with something we said a
  2968. @c while ago. Somewhere we need a better way of
  2969. @c introducing how the first number can be anything
  2970. @c except "1", perhaps. Also I don't think this
  2971. @c presentation is clear on why we are discussing releases
  2972. @c and first numbers of numeric revisions in the same
  2973. @c breath.
  2974. Normally there is no reason to care
  2975. about the revision numbers---it is easier to treat them
  2976. as internal numbers that @sc{cvs} maintains, and tags
  2977. provide a better way to distinguish between things like
  2978. release 1 versus release 2 of your product
  2979. (@pxref{Tags}). However, if you want to set the
  2980. numeric revisions, the @samp{-r} option to @code{cvs
  2981. commit} can do that. The @samp{-r} option implies the
  2982. @samp{-f} option, in the sense that it causes the
  2983. files to be committed even if they are not modified.
  2984. For example, to bring all your files up to
  2985. revision 3.0 (including those that haven't changed),
  2986. you might invoke:
  2987. @example
  2988. $ cvs commit -r 3.0
  2989. @end example
  2990. Note that the number you specify with @samp{-r} must be
  2991. larger than any existing revision number. That is, if
  2992. revision 3.0 exists, you cannot @samp{cvs commit
  2993. -r 1.3}. If you want to maintain several releases in
  2994. parallel, you need to use a branch (@pxref{Branching and merging}).
  2995. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2996. @node Tags
  2997. @section Tags--Symbolic revisions
  2998. @cindex Tags
  2999. The revision numbers live a life of their own. They
  3000. need not have anything at all to do with the release
  3001. numbers of your software product. Depending
  3002. on how you use @sc{cvs} the revision numbers might change several times
  3003. between two releases. As an example, some of the
  3004. source files that make up @sc{rcs} 5.6 have the following
  3005. revision numbers:
  3006. @cindex RCS revision numbers
  3007. @example
  3008. ci.c 5.21
  3009. co.c 5.9
  3010. ident.c 5.3
  3011. rcs.c 5.12
  3012. rcsbase.h 5.11
  3013. rcsdiff.c 5.10
  3014. rcsedit.c 5.11
  3015. rcsfcmp.c 5.9
  3016. rcsgen.c 5.10
  3017. rcslex.c 5.11
  3018. rcsmap.c 5.2
  3019. rcsutil.c 5.10
  3020. @end example
  3021. @cindex tag (subcommand), introduction
  3022. @cindex Tags, symbolic name
  3023. @cindex Symbolic name (tag)
  3024. @cindex Name, symbolic (tag)
  3025. @cindex HEAD, as reserved tag name
  3026. @cindex BASE, as reserved tag name
  3027. You can use the @code{tag} command to give a symbolic name to a
  3028. certain revision of a file. You can use the @samp{-v} flag to the
  3029. @code{status} command to see all tags that a file has, and
  3030. which revision numbers they represent. Tag names must
  3031. start with an uppercase or lowercase letter and can
  3032. contain uppercase and lowercase letters, digits,
  3033. @samp{-}, and @samp{_}. The two tag names @code{BASE}
  3034. and @code{HEAD} are reserved for use by @sc{cvs}. It
  3035. is expected that future names which are special to
  3036. @sc{cvs} will be specially named, for example by
  3037. starting with @samp{.}, rather than being named analogously to
  3038. @code{BASE} and @code{HEAD}, to avoid conflicts with
  3039. actual tag names.
  3040. @c Including a character such as % or = has also been
  3041. @c suggested as the naming convention for future
  3042. @c special tag names. Starting with . is nice because
  3043. @c that is not a legal tag name as far as RCS is concerned.
  3044. @c FIXME: CVS actually accepts quite a few characters
  3045. @c in tag names, not just the ones documented above
  3046. @c (see RCS_check_tag). RCS
  3047. @c defines legitimate tag names by listing illegal
  3048. @c characters rather than legal ones. CVS is said to lose its
  3049. @c mind if you try to use "/" (try making such a tag sticky
  3050. @c and using "cvs status" client/server--see remote
  3051. @c protocol format for entries line for probable cause).
  3052. @c TODO: The testsuite
  3053. @c should test for whatever are documented above as
  3054. @c officially-OK tag names, and CVS should at least reject
  3055. @c characters that won't work, like "/".
  3056. You'll want to choose some convention for naming tags,
  3057. based on information such as the name of the program
  3058. and the version number of the release. For example,
  3059. one might take the name of the program, immediately
  3060. followed by the version number with @samp{.} changed to
  3061. @samp{-}, so that @sc{cvs} 1.9 would be tagged with the name
  3062. @code{cvs1-9}. If you choose a consistent convention,
  3063. then you won't constantly be guessing whether a tag is
  3064. @code{cvs-1-9} or @code{cvs1_9} or what. You might
  3065. even want to consider enforcing your convention in the
  3066. taginfo file (@pxref{user-defined logging}).
  3067. @c Might be nice to say more about using taginfo this
  3068. @c way, like giving an example, or pointing out any particular
  3069. @c issues which arise.
  3070. @cindex Adding a tag
  3071. @cindex Tags, example
  3072. The following example shows how you can add a tag to a
  3073. file. The commands must be issued inside your working
  3074. directory. That is, you should issue the
  3075. command in the directory where @file{backend.c}
  3076. resides.
  3077. @example
  3078. $ cvs tag rel-0-4 backend.c
  3079. T backend.c
  3080. $ cvs status -v backend.c
  3081. ===================================================================
  3082. File: backend.c Status: Up-to-date
  3083. Version: 1.4 Tue Dec 1 14:39:01 1992
  3084. RCS Version: 1.4 /u/cvsroot/yoyodyne/tc/backend.c,v
  3085. Sticky Tag: (none)
  3086. Sticky Date: (none)
  3087. Sticky Options: (none)
  3088. Existing Tags:
  3089. rel-0-4 (revision: 1.4)
  3090. @end example
  3091. For a complete summary of the syntax of @code{cvs tag},
  3092. including the various options, see @ref{Invoking CVS}.
  3093. There is seldom reason to tag a file in isolation. A more common use is
  3094. to tag all the files that constitute a module with the same tag at
  3095. strategic points in the development life-cycle, such as when a release
  3096. is made.
  3097. @example
  3098. $ cvs tag rel-1-0 .
  3099. cvs tag: Tagging .
  3100. T Makefile
  3101. T backend.c
  3102. T driver.c
  3103. T frontend.c
  3104. T parser.c
  3105. @end example
  3106. @noindent
  3107. (When you give @sc{cvs} a directory as argument, it generally applies the
  3108. operation to all the files in that directory, and (recursively), to any
  3109. subdirectories that it may contain. @xref{Recursive behavior}.)
  3110. @cindex Retrieving an old revision using tags
  3111. @cindex Tags, retrieving old revisions
  3112. The @code{checkout} command has a flag, @samp{-r}, that lets you check out
  3113. a certain revision of a module. This flag makes it easy to
  3114. retrieve the sources that make up release 1.0 of the module @samp{tc} at
  3115. any time in the future:
  3116. @example
  3117. $ cvs checkout -r rel-1-0 tc
  3118. @end example
  3119. @noindent
  3120. This is useful, for instance, if someone claims that there is a bug in
  3121. that release, but you cannot find the bug in the current working copy.
  3122. You can also check out a module as it was at any given date.
  3123. @xref{checkout options}. When specifying @samp{-r} to
  3124. any of these commands, you will need beware of sticky
  3125. tags; see @ref{Sticky tags}.
  3126. When you tag more than one file with the same tag you
  3127. can think about the tag as "a curve drawn through a
  3128. matrix of filename vs. revision number." Say we have 5
  3129. files with the following revisions:
  3130. @example
  3131. @group
  3132. file1 file2 file3 file4 file5
  3133. 1.1 1.1 1.1 1.1 /--1.1* <-*- TAG
  3134. 1.2*- 1.2 1.2 -1.2*-
  3135. 1.3 \- 1.3*- 1.3 / 1.3
  3136. 1.4 \ 1.4 / 1.4
  3137. \-1.5*- 1.5
  3138. 1.6
  3139. @end group
  3140. @end example
  3141. At some time in the past, the @code{*} versions were tagged.
  3142. You can think of the tag as a handle attached to the curve
  3143. drawn through the tagged revisions. When you pull on
  3144. the handle, you get all the tagged revisions. Another
  3145. way to look at it is that you "sight" through a set of
  3146. revisions that is "flat" along the tagged revisions,
  3147. like this:
  3148. @example
  3149. @group
  3150. file1 file2 file3 file4 file5
  3151. 1.1
  3152. 1.2
  3153. 1.1 1.3 _
  3154. 1.1 1.2 1.4 1.1 /
  3155. 1.2*----1.3*----1.5*----1.2*----1.1 (--- <--- Look here
  3156. 1.3 1.6 1.3 \_
  3157. 1.4 1.4
  3158. 1.5
  3159. @end group
  3160. @end example
  3161. @node Tagging the working directory
  3162. @section Specifying what to tag from the working directory
  3163. @cindex tag (subcommand)
  3164. The example in the previous section demonstrates one of
  3165. the most common ways to choose which revisions to tag.
  3166. Namely, running the @code{cvs tag} command without
  3167. arguments causes @sc{cvs} to select the revisions which
  3168. are checked out in the current working directory. For
  3169. example, if the copy of @file{backend.c} in working
  3170. directory was checked out from revision 1.4, then
  3171. @sc{cvs} will tag revision 1.4. Note that the tag is
  3172. applied immediately to revision 1.4 in the repository;
  3173. tagging is not like modifying a file, or other
  3174. operations in which one first modifies the working
  3175. directory and then runs @code{cvs commit} to transfer
  3176. that modification to the repository.
  3177. One potentially surprising aspect of the fact that
  3178. @code{cvs tag} operates on the repository is that you
  3179. are tagging the checked-in revisions, which may differ
  3180. from locally modified files in your working directory.
  3181. If you want to avoid doing this by mistake, specify the
  3182. @samp{-c} option to @code{cvs tag}. If there are any
  3183. locally modified files, @sc{cvs} will abort with an
  3184. error before it tags any files:
  3185. @example
  3186. $ cvs tag -c rel-0-4
  3187. cvs tag: backend.c is locally modified
  3188. cvs [tag aborted]: correct the above errors first!
  3189. @end example
  3190. @node Tagging by date/tag
  3191. @section Specifying what to tag by date or revision
  3192. @cindex rtag (subcommand)
  3193. The @code{cvs rtag} command tags the repository as of a
  3194. certain date or time (or can be used to tag the latest
  3195. revision). @code{rtag} works directly on the
  3196. repository contents (it requires no prior checkout and
  3197. does not look for a working directory).
  3198. The following options specify which date or revision to
  3199. tag. See @ref{Common options}, for a complete
  3200. description of them.
  3201. @table @code
  3202. @item -D @var{date}
  3203. Tag the most recent revision no later than @var{date}.
  3204. @item -f
  3205. Only useful with the @samp{-D @var{date}} or @samp{-r @var{tag}}
  3206. flags. If no matching revision is found, use the most
  3207. recent revision (instead of ignoring the file).
  3208. @item -r @var{tag}
  3209. Only tag those files that contain existing tag @var{tag}.
  3210. @end table
  3211. The @code{cvs tag} command also allows one to specify
  3212. files by revision or date, using the same @samp{-r},
  3213. @samp{-D}, and @samp{-f} options. However, this
  3214. feature is probably not what you want. The reason is
  3215. that @code{cvs tag} chooses which files to tag based on
  3216. the files that exist in the working directory, rather
  3217. than the files which existed as of the given tag/date.
  3218. Therefore, you are generally better off using @code{cvs
  3219. rtag}. The exceptions might be cases like:
  3220. @example
  3221. cvs tag -r 1.4 stable backend.c
  3222. @end example
  3223. @node Modifying tags
  3224. @section Deleting, moving, and renaming tags
  3225. @c Also see:
  3226. @c "How do I move or rename a magic branch tag?"
  3227. @c in the FAQ (I think the issues it talks about still
  3228. @c apply, but this could use some sanity.sh work).
  3229. Normally one does not modify tags. They exist in order
  3230. to record the history of the repository and so deleting
  3231. them or changing their meaning would, generally, not be
  3232. what you want.
  3233. However, there might be cases in which one uses a tag
  3234. temporarily or accidentally puts one in the wrong
  3235. place. Therefore, one might delete, move, or rename a
  3236. tag.
  3237. @noindent
  3238. @strong{WARNING: the commands in this section are
  3239. dangerous; they permanently discard historical
  3240. information and it can be difficult or impossible to
  3241. recover from errors. If you are a @sc{cvs}
  3242. administrator, you may consider restricting these
  3243. commands with taginfo (@pxref{user-defined logging}).}
  3244. @cindex Deleting tags
  3245. @cindex Deleting branch tags
  3246. @cindex Removing tags
  3247. @cindex Removing branch tags
  3248. @cindex Tags, deleting
  3249. @cindex Branch tags, deleting
  3250. To delete a tag, specify the @samp{-d} option to either
  3251. @code{cvs tag} or @code{cvs rtag}. For example:
  3252. @example
  3253. cvs rtag -d rel-0-4 tc
  3254. @end example
  3255. @noindent
  3256. deletes the non-branch tag @code{rel-0-4} from the module @code{tc}.
  3257. In the event that branch tags are encountered within the repository
  3258. with the given name, a warning message will be issued and the branch
  3259. tag will not be deleted. If you are absolutely certain you know what
  3260. you are doing, the @code{-B} option may be specified to allow deletion
  3261. of branch tags. In that case, any non-branch tags encountered will
  3262. trigger warnings and will not be deleted.
  3263. @noindent
  3264. @strong{WARNING: Moving branch tags is very dangerous! If you think
  3265. you need the @code{-B} option, think again and ask your @sc{cvs}
  3266. administrator about it (if that isn't you). There is almost certainly
  3267. another way to accomplish what you want to accomplish.}
  3268. @cindex Moving tags
  3269. @cindex Moving branch tags
  3270. @cindex Tags, moving
  3271. @cindex Branch tags, moving
  3272. When we say @dfn{move} a tag, we mean to make the same
  3273. name point to different revisions. For example, the
  3274. @code{stable} tag may currently point to revision 1.4
  3275. of @file{backend.c} and perhaps we want to make it
  3276. point to revision 1.6. To move a non-branch tag, specify the
  3277. @samp{-F} option to either @code{cvs tag} or @code{cvs
  3278. rtag}. For example, the task just mentioned might be
  3279. accomplished as:
  3280. @example
  3281. cvs tag -r 1.6 -F stable backend.c
  3282. @end example
  3283. @noindent
  3284. If any branch tags are encountered in the repository
  3285. with the given name, a warning is issued and the branch
  3286. tag is not disturbed. If you are absolutely certain you
  3287. wish to move the branch tag, the @code{-B} option may be specified.
  3288. In that case, non-branch tags encountered with the given
  3289. name are ignored with a warning message.
  3290. @noindent
  3291. @strong{WARNING: Moving branch tags is very dangerous! If you think you
  3292. need the @code{-B} option, think again and ask your @sc{cvs}
  3293. administrator about it (if that isn't you). There is almost certainly
  3294. another way to accomplish what you want to accomplish.}
  3295. @cindex Renaming tags
  3296. @cindex Tags, renaming
  3297. When we say @dfn{rename} a tag, we mean to make a
  3298. different name point to the same revisions as the old
  3299. tag. For example, one may have misspelled the tag name
  3300. and want to correct it (hopefully before others are
  3301. relying on the old spelling). To rename a tag, first
  3302. create a new tag using the @samp{-r} option to
  3303. @code{cvs rtag}, and then delete the old name. (Caution:
  3304. this method will not work with branch tags.)
  3305. This leaves the new tag on exactly the
  3306. same files as the old tag. For example:
  3307. @example
  3308. cvs rtag -r old-name-0-4 rel-0-4 tc
  3309. cvs rtag -d old-name-0-4 tc
  3310. @end example
  3311. @node Tagging add/remove
  3312. @section Tagging and adding and removing files
  3313. The subject of exactly how tagging interacts with
  3314. adding and removing files is somewhat obscure; for the
  3315. most part @sc{cvs} will keep track of whether files
  3316. exist or not without too much fussing. By default,
  3317. tags are applied to only files which have a revision
  3318. corresponding to what is being tagged. Files which did
  3319. not exist yet, or which were already removed, simply
  3320. omit the tag, and @sc{cvs} knows to treat the absence
  3321. of a tag as meaning that the file didn't exist as of
  3322. that tag.
  3323. However, this can lose a small amount of information.
  3324. For example, suppose a file was added and then removed.
  3325. Then, if the tag is missing for that file, there is no
  3326. way to know whether the tag refers to the time before
  3327. the file was added, or the time after it was removed.
  3328. If you specify the @samp{-r} option to @code{cvs rtag},
  3329. then @sc{cvs} tags the files which have been removed,
  3330. and thereby avoids this problem. For example, one
  3331. might specify @code{-r HEAD} to tag the head.
  3332. On the subject of adding and removing files, the
  3333. @code{cvs rtag} command has a @samp{-a} option which
  3334. means to clear the tag from removed files that would
  3335. not otherwise be tagged. For example, one might
  3336. specify this option in conjunction with @samp{-F} when
  3337. moving a tag. If one moved a tag without @samp{-a},
  3338. then the tag in the removed files might still refer to
  3339. the old revision, rather than reflecting the fact that
  3340. the file had been removed. I don't think this is
  3341. necessary if @samp{-r} is specified, as noted above.
  3342. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3343. @node Sticky tags
  3344. @section Sticky tags
  3345. @cindex Sticky tags
  3346. @cindex Tags, sticky
  3347. @c A somewhat related issue is per-directory sticky
  3348. @c tags (see comment at CVS/Tag in node Working
  3349. @c directory storage); we probably want to say
  3350. @c something like "you can set a sticky tag for only
  3351. @c some files, but you don't want to" or some such.
  3352. Sometimes a working copy's revision has extra data
  3353. associated with it, for example it might be on a branch
  3354. (@pxref{Branching and merging}), or restricted to
  3355. versions prior to a certain date by @samp{checkout -D}
  3356. or @samp{update -D}. Because this data persists --
  3357. that is, it applies to subsequent commands in the
  3358. working copy -- we refer to it as @dfn{sticky}.
  3359. Most of the time, stickiness is an obscure aspect of
  3360. @sc{cvs} that you don't need to think about. However,
  3361. even if you don't want to use the feature, you may need
  3362. to know @emph{something} about sticky tags (for
  3363. example, how to avoid them!).
  3364. You can use the @code{status} command to see if any
  3365. sticky tags or dates are set:
  3366. @example
  3367. $ cvs status driver.c
  3368. ===================================================================
  3369. File: driver.c Status: Up-to-date
  3370. Version: 1.7.2.1 Sat Dec 5 19:35:03 1992
  3371. RCS Version: 1.7.2.1 /u/cvsroot/yoyodyne/tc/driver.c,v
  3372. Sticky Tag: rel-1-0-patches (branch: 1.7.2)
  3373. Sticky Date: (none)
  3374. Sticky Options: (none)
  3375. @end example
  3376. @cindex Resetting sticky tags
  3377. @cindex Sticky tags, resetting
  3378. @cindex Deleting sticky tags
  3379. The sticky tags will remain on your working files until
  3380. you delete them with @samp{cvs update -A}. The
  3381. @samp{-A} option merges local changes into the version of the
  3382. file from the head of the trunk, removing any sticky tags,
  3383. dates, or options. See @ref{update} for more on the operation
  3384. of @code{cvs update}.
  3385. @cindex Sticky date
  3386. The most common use of sticky tags is to identify which
  3387. branch one is working on, as described in
  3388. @ref{Accessing branches}. However, non-branch
  3389. sticky tags have uses as well. For example,
  3390. suppose that you want to avoid updating your working
  3391. directory, to isolate yourself from possibly
  3392. destabilizing changes other people are making. You
  3393. can, of course, just refrain from running @code{cvs
  3394. update}. But if you want to avoid updating only a
  3395. portion of a larger tree, then sticky tags can help.
  3396. If you check out a certain revision (such as 1.4) it
  3397. will become sticky. Subsequent @code{cvs update}
  3398. commands will
  3399. not retrieve the latest revision until you reset the
  3400. tag with @code{cvs update -A}. Likewise, use of the
  3401. @samp{-D} option to @code{update} or @code{checkout}
  3402. sets a @dfn{sticky date}, which, similarly, causes that
  3403. date to be used for future retrievals.
  3404. People often want to retrieve an old version of
  3405. a file without setting a sticky tag. This can
  3406. be done with the @samp{-p} option to @code{checkout} or
  3407. @code{update}, which sends the contents of the file to
  3408. standard output. For example:
  3409. @example
  3410. $ cvs update -p -r 1.1 file1 >file1
  3411. ===================================================================
  3412. Checking out file1
  3413. RCS: /tmp/cvs-sanity/cvsroot/first-dir/Attic/file1,v
  3414. VERS: 1.1
  3415. ***************
  3416. $
  3417. @end example
  3418. However, this isn't the easiest way, if you are asking
  3419. how to undo a previous checkin (in this example, put
  3420. @file{file1} back to the way it was as of revision
  3421. 1.1). In that case you are better off using the
  3422. @samp{-j} option to @code{update}; for further
  3423. discussion see @ref{Merging two revisions}.
  3424. @c ---------------------------------------------------------------------
  3425. @node Branching and merging
  3426. @chapter Branching and merging
  3427. @cindex Branching
  3428. @cindex Merging
  3429. @cindex Copying changes
  3430. @cindex Main trunk and branches
  3431. @cindex Revision tree, making branches
  3432. @cindex Branches, copying changes between
  3433. @cindex Changes, copying between branches
  3434. @cindex Modifications, copying between branches
  3435. @sc{cvs} allows you to isolate changes onto a separate
  3436. line of development, known as a @dfn{branch}. When you
  3437. change files on a branch, those changes do not appear
  3438. on the main trunk or other branches.
  3439. Later you can move changes from one branch to another
  3440. branch (or the main trunk) by @dfn{merging}. Merging
  3441. involves first running @code{cvs update -j}, to merge
  3442. the changes into the working directory.
  3443. You can then commit that revision, and thus effectively
  3444. copy the changes onto another branch.
  3445. @menu
  3446. * Branches motivation:: What branches are good for
  3447. * Creating a branch:: Creating a branch
  3448. * Accessing branches:: Checking out and updating branches
  3449. * Branches and revisions:: Branches are reflected in revision numbers
  3450. * Magic branch numbers:: Magic branch numbers
  3451. * Merging a branch:: Merging an entire branch
  3452. * Merging more than once:: Merging from a branch several times
  3453. * Merging two revisions:: Merging differences between two revisions
  3454. * Merging adds and removals:: What if files are added or removed?
  3455. * Merging and keywords:: Avoiding conflicts due to keyword substitution
  3456. @end menu
  3457. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3458. @node Branches motivation
  3459. @section What branches are good for
  3460. @cindex Branches motivation
  3461. @cindex What branches are good for
  3462. @cindex Motivation for branches
  3463. @c FIXME: this node mentions one way to use branches,
  3464. @c but it is by no means the only way. For example,
  3465. @c the technique of committing a new feature on a branch,
  3466. @c until it is ready for the main trunk. The whole
  3467. @c thing is generally speaking more akin to the
  3468. @c "Revision management" node although it isn't clear to
  3469. @c me whether policy matters should be centralized or
  3470. @c distributed throughout the relevant sections.
  3471. Suppose that release 1.0 of tc has been made. You are continuing to
  3472. develop tc, planning to create release 1.1 in a couple of months. After a
  3473. while your customers start to complain about a fatal bug. You check
  3474. out release 1.0 (@pxref{Tags}) and find the bug
  3475. (which turns out to have a trivial fix). However, the current revision
  3476. of the sources are in a state of flux and are not expected to be stable
  3477. for at least another month. There is no way to make a
  3478. bugfix release based on the newest sources.
  3479. The thing to do in a situation like this is to create a @dfn{branch} on
  3480. the revision trees for all the files that make up
  3481. release 1.0 of tc. You can then make
  3482. modifications to the branch without disturbing the main trunk. When the
  3483. modifications are finished you can elect to either incorporate them on
  3484. the main trunk, or leave them on the branch.
  3485. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3486. @node Creating a branch
  3487. @section Creating a branch
  3488. @cindex Creating a branch
  3489. @cindex Branch, creating a
  3490. @cindex tag (subcommand), creating a branch using
  3491. @cindex rtag (subcommand), creating a branch using
  3492. You can create a branch with @code{tag -b}; for
  3493. example, assuming you're in a working copy:
  3494. @example
  3495. $ cvs tag -b rel-1-0-patches
  3496. @end example
  3497. @c FIXME: we should be more explicit about the value of
  3498. @c having a tag on the branchpoint. For example
  3499. @c "cvs tag rel-1-0-patches-branchpoint" before
  3500. @c the "cvs tag -b". This points out that
  3501. @c rel-1-0-patches is a pretty awkward name for
  3502. @c this example (more so than for the rtag example
  3503. @c below).
  3504. This splits off a branch based on the current revisions
  3505. in the working copy, assigning that branch the name
  3506. @samp{rel-1-0-patches}.
  3507. It is important to understand that branches get created
  3508. in the repository, not in the working copy. Creating a
  3509. branch based on current revisions, as the above example
  3510. does, will @emph{not} automatically switch the working
  3511. copy to be on the new branch. For information on how
  3512. to do that, see @ref{Accessing branches}.
  3513. You can also create a branch without reference to any
  3514. working copy, by using @code{rtag}:
  3515. @example
  3516. $ cvs rtag -b -r rel-1-0 rel-1-0-patches tc
  3517. @end example
  3518. @samp{-r rel-1-0} says that this branch should be
  3519. rooted at the revision that
  3520. corresponds to the tag @samp{rel-1-0}. It need not
  3521. be the most recent revision -- it's often useful to
  3522. split a branch off an old revision (for example, when
  3523. fixing a bug in a past release otherwise known to be
  3524. stable).
  3525. As with @samp{tag}, the @samp{-b} flag tells
  3526. @code{rtag} to create a branch (rather than just a
  3527. symbolic revision name). Note that the numeric
  3528. revision number that matches @samp{rel-1-0} will
  3529. probably be different from file to file.
  3530. So, the full effect of the command is to create a new
  3531. branch -- named @samp{rel-1-0-patches} -- in module
  3532. @samp{tc}, rooted in the revision tree at the point tagged
  3533. by @samp{rel-1-0}.
  3534. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3535. @node Accessing branches
  3536. @section Accessing branches
  3537. @cindex Check out a branch
  3538. @cindex Retrieve a branch
  3539. @cindex Access a branch
  3540. @cindex Identifying a branch
  3541. @cindex Branch, check out
  3542. @cindex Branch, retrieving
  3543. @cindex Branch, accessing
  3544. @cindex Branch, identifying
  3545. You can retrieve a branch in one of two ways: by
  3546. checking it out fresh from the repository, or by
  3547. switching an existing working copy over to the branch.
  3548. To check out a branch from the repository, invoke
  3549. @samp{checkout} with the @samp{-r} flag, followed by
  3550. the tag name of the branch (@pxref{Creating a branch}):
  3551. @example
  3552. $ cvs checkout -r rel-1-0-patches tc
  3553. @end example
  3554. Or, if you already have a working copy, you can switch
  3555. it to a given branch with @samp{update -r}:
  3556. @example
  3557. $ cvs update -r rel-1-0-patches tc
  3558. @end example
  3559. @noindent
  3560. or equivalently:
  3561. @example
  3562. $ cd tc
  3563. $ cvs update -r rel-1-0-patches
  3564. @end example
  3565. It does not matter if the working copy was originally
  3566. on the main trunk or on some other branch -- the above
  3567. command will switch it to the named branch. And
  3568. similarly to a regular @samp{update} command,
  3569. @samp{update -r} merges any changes you have made,
  3570. notifying you of conflicts where they occur.
  3571. Once you have a working copy tied to a particular
  3572. branch, it remains there until you tell it otherwise.
  3573. This means that changes checked in from the working
  3574. copy will add new revisions on that branch, while
  3575. leaving the main trunk and other branches unaffected.
  3576. @cindex Branches, sticky
  3577. To find out what branch a working copy is on, you can
  3578. use the @samp{status} command. In its output, look for
  3579. the field named @samp{Sticky tag} (@pxref{Sticky tags})
  3580. -- that's @sc{cvs}'s way of telling you the branch, if
  3581. any, of the current working files:
  3582. @example
  3583. $ cvs status -v driver.c backend.c
  3584. ===================================================================
  3585. File: driver.c Status: Up-to-date
  3586. Version: 1.7 Sat Dec 5 18:25:54 1992
  3587. RCS Version: 1.7 /u/cvsroot/yoyodyne/tc/driver.c,v
  3588. Sticky Tag: rel-1-0-patches (branch: 1.7.2)
  3589. Sticky Date: (none)
  3590. Sticky Options: (none)
  3591. Existing Tags:
  3592. rel-1-0-patches (branch: 1.7.2)
  3593. rel-1-0 (revision: 1.7)
  3594. ===================================================================
  3595. File: backend.c Status: Up-to-date
  3596. Version: 1.4 Tue Dec 1 14:39:01 1992
  3597. RCS Version: 1.4 /u/cvsroot/yoyodyne/tc/backend.c,v
  3598. Sticky Tag: rel-1-0-patches (branch: 1.4.2)
  3599. Sticky Date: (none)
  3600. Sticky Options: (none)
  3601. Existing Tags:
  3602. rel-1-0-patches (branch: 1.4.2)
  3603. rel-1-0 (revision: 1.4)
  3604. rel-0-4 (revision: 1.4)
  3605. @end example
  3606. Don't be confused by the fact that the branch numbers
  3607. for each file are different (@samp{1.7.2} and
  3608. @samp{1.4.2} respectively). The branch tag is the
  3609. same, @samp{rel-1-0-patches}, and the files are
  3610. indeed on the same branch. The numbers simply reflect
  3611. the point in each file's revision history at which the
  3612. branch was made. In the above example, one can deduce
  3613. that @samp{driver.c} had been through more changes than
  3614. @samp{backend.c} before this branch was created.
  3615. See @ref{Branches and revisions} for details about how
  3616. branch numbers are constructed.
  3617. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3618. @node Branches and revisions
  3619. @section Branches and revisions
  3620. @cindex Branch number
  3621. @cindex Number, branch
  3622. @cindex Revision numbers (branches)
  3623. Ordinarily, a file's revision history is a linear
  3624. series of increments (@pxref{Revision numbers}):
  3625. @example
  3626. +-----+ +-----+ +-----+ +-----+ +-----+
  3627. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 !
  3628. +-----+ +-----+ +-----+ +-----+ +-----+
  3629. @end example
  3630. However, @sc{cvs} is not limited to linear development. The
  3631. @dfn{revision tree} can be split into @dfn{branches},
  3632. where each branch is a self-maintained line of
  3633. development. Changes made on one branch can easily be
  3634. moved back to the main trunk.
  3635. Each branch has a @dfn{branch number}, consisting of an
  3636. odd number of period-separated decimal integers. The
  3637. branch number is created by appending an integer to the
  3638. revision number where the corresponding branch forked
  3639. off. Having branch numbers allows more than one branch
  3640. to be forked off from a certain revision.
  3641. @need 3500
  3642. All revisions on a branch have revision numbers formed
  3643. by appending an ordinal number to the branch number.
  3644. The following figure illustrates branching with an
  3645. example.
  3646. @example
  3647. @c This example used to have a 1.2.2.4 revision, which
  3648. @c might help clarify that development can continue on
  3649. @c 1.2.2. Might be worth reinstating if it can be done
  3650. @c without overfull hboxes.
  3651. @group
  3652. +-------------+
  3653. Branch 1.2.2.3.2 -> ! 1.2.2.3.2.1 !
  3654. / +-------------+
  3655. /
  3656. /
  3657. +---------+ +---------+ +---------+
  3658. Branch 1.2.2 -> _! 1.2.2.1 !----! 1.2.2.2 !----! 1.2.2.3 !
  3659. / +---------+ +---------+ +---------+
  3660. /
  3661. /
  3662. +-----+ +-----+ +-----+ +-----+ +-----+
  3663. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! <- The main trunk
  3664. +-----+ +-----+ +-----+ +-----+ +-----+
  3665. !
  3666. !
  3667. ! +---------+ +---------+ +---------+
  3668. Branch 1.2.4 -> +---! 1.2.4.1 !----! 1.2.4.2 !----! 1.2.4.3 !
  3669. +---------+ +---------+ +---------+
  3670. @end group
  3671. @end example
  3672. @c -- However, at least for me the figure is not enough. I suggest more
  3673. @c -- text to accompany it. "A picture is worth a thousand words", so you
  3674. @c -- have to make sure the reader notices the couple of hundred words
  3675. @c -- *you* had in mind more than the others!
  3676. @c -- Why an even number of segments? This section implies that this is
  3677. @c -- how the main trunk is distinguished from branch roots, but you never
  3678. @c -- explicitly say that this is the purpose of the [by itself rather
  3679. @c -- surprising] restriction to an even number of segments.
  3680. The exact details of how the branch number is
  3681. constructed is not something you normally need to be
  3682. concerned about, but here is how it works: When
  3683. @sc{cvs} creates a branch number it picks the first
  3684. unused even integer, starting with 2. So when you want
  3685. to create a branch from revision 6.4 it will be
  3686. numbered 6.4.2. All branch numbers ending in a zero
  3687. (such as 6.4.0) are used internally by @sc{cvs}
  3688. (@pxref{Magic branch numbers}). The branch 1.1.1 has a
  3689. special meaning. @xref{Tracking sources}.
  3690. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3691. @node Magic branch numbers
  3692. @section Magic branch numbers
  3693. @c Want xref to here from "log"?
  3694. This section describes a @sc{cvs} feature called
  3695. @dfn{magic branches}. For most purposes, you need not
  3696. worry about magic branches; @sc{cvs} handles them for
  3697. you. However, they are visible to you in certain
  3698. circumstances, so it may be useful to have some idea of
  3699. how it works.
  3700. Externally, branch numbers consist of an odd number of
  3701. dot-separated decimal integers. @xref{Revision
  3702. numbers}. That is not the whole truth, however. For
  3703. efficiency reasons @sc{cvs} sometimes inserts an extra 0
  3704. in the second rightmost position (1.2.4 becomes
  3705. 1.2.0.4, 8.9.10.11.12 becomes 8.9.10.11.0.12 and so
  3706. on).
  3707. @sc{cvs} does a pretty good job at hiding these so
  3708. called magic branches, but in a few places the hiding
  3709. is incomplete:
  3710. @itemize @bullet
  3711. @ignore
  3712. @c This is in ignore as I'm taking their word for it,
  3713. @c that this was fixed
  3714. @c a long time ago. But before deleting this
  3715. @c entirely, I'd rather verify it (and add a test
  3716. @c case to the testsuite).
  3717. @item
  3718. The magic branch can appear in the output from
  3719. @code{cvs status} in vanilla @sc{cvs} 1.3. This is
  3720. fixed in @sc{cvs} 1.3-s2.
  3721. @end ignore
  3722. @item
  3723. The magic branch number appears in the output from
  3724. @code{cvs log}.
  3725. @c What output should appear instead?
  3726. @item
  3727. You cannot specify a symbolic branch name to @code{cvs
  3728. admin}.
  3729. @end itemize
  3730. @c Can CVS do this automatically the first time
  3731. @c you check something in to that branch? Should
  3732. @c it?
  3733. You can use the @code{admin} command to reassign a
  3734. symbolic name to a branch the way @sc{rcs} expects it
  3735. to be. If @code{R4patches} is assigned to the branch
  3736. 1.4.2 (magic branch number 1.4.0.2) in file
  3737. @file{numbers.c} you can do this:
  3738. @example
  3739. $ cvs admin -NR4patches:1.4.2 numbers.c
  3740. @end example
  3741. It only works if at least one revision is already
  3742. committed on the branch. Be very careful so that you
  3743. do not assign the tag to the wrong number. (There is
  3744. no way to see how the tag was assigned yesterday).
  3745. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3746. @node Merging a branch
  3747. @section Merging an entire branch
  3748. @cindex Merging a branch
  3749. @cindex -j (merging branches)
  3750. You can merge changes made on a branch into your working copy by giving
  3751. the @samp{-j @var{branchname}} flag to the @code{update} subcommand. With one
  3752. @samp{-j @var{branchname}} option it merges the changes made between the
  3753. greatest common ancestor (GCA) of the branch and the destination revision (in
  3754. the simple case below the GCA is the point where the branch forked) and the
  3755. newest revision on that branch into your working copy.
  3756. @cindex Join
  3757. The @samp{-j} stands for ``join''.
  3758. @cindex Branch merge example
  3759. @cindex Example, branch merge
  3760. @cindex Merge, branch example
  3761. Consider this revision tree:
  3762. @example
  3763. +-----+ +-----+ +-----+ +-----+
  3764. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 ! <- The main trunk
  3765. +-----+ +-----+ +-----+ +-----+
  3766. !
  3767. !
  3768. ! +---------+ +---------+
  3769. Branch R1fix -> +---! 1.2.2.1 !----! 1.2.2.2 !
  3770. +---------+ +---------+
  3771. @end example
  3772. @noindent
  3773. The branch 1.2.2 has been given the tag (symbolic name) @samp{R1fix}. The
  3774. following example assumes that the module @samp{mod} contains only one
  3775. file, @file{m.c}.
  3776. @example
  3777. $ cvs checkout mod # @r{Retrieve the latest revision, 1.4}
  3778. $ cvs update -j R1fix m.c # @r{Merge all changes made on the branch,}
  3779. # @r{i.e. the changes between revision 1.2}
  3780. # @r{and 1.2.2.2, into your working copy}
  3781. # @r{of the file.}
  3782. $ cvs commit -m "Included R1fix" # @r{Create revision 1.5.}
  3783. @end example
  3784. A conflict can result from a merge operation. If that
  3785. happens, you should resolve it before committing the
  3786. new revision. @xref{Conflicts example}.
  3787. If your source files contain keywords (@pxref{Keyword substitution}),
  3788. you might be getting more conflicts than strictly necessary. See
  3789. @ref{Merging and keywords}, for information on how to avoid this.
  3790. The @code{checkout} command also supports the @samp{-j @var{branchname}} flag. The
  3791. same effect as above could be achieved with this:
  3792. @example
  3793. $ cvs checkout -j R1fix mod
  3794. $ cvs commit -m "Included R1fix"
  3795. @end example
  3796. It should be noted that @code{update -j @var{tagname}} will also work but may
  3797. not produce the desired result. @xref{Merging adds and removals}, for more.
  3798. @node Merging more than once
  3799. @section Merging from a branch several times
  3800. Continuing our example, the revision tree now looks
  3801. like this:
  3802. @example
  3803. +-----+ +-----+ +-----+ +-----+ +-----+
  3804. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! <- The main trunk
  3805. +-----+ +-----+ +-----+ +-----+ +-----+
  3806. ! *
  3807. ! *
  3808. ! +---------+ +---------+
  3809. Branch R1fix -> +---! 1.2.2.1 !----! 1.2.2.2 !
  3810. +---------+ +---------+
  3811. @end example
  3812. @noindent
  3813. where the starred line represents the merge from the
  3814. @samp{R1fix} branch to the main trunk, as just
  3815. discussed.
  3816. Now suppose that development continues on the
  3817. @samp{R1fix} branch:
  3818. @example
  3819. +-----+ +-----+ +-----+ +-----+ +-----+
  3820. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! <- The main trunk
  3821. +-----+ +-----+ +-----+ +-----+ +-----+
  3822. ! *
  3823. ! *
  3824. ! +---------+ +---------+ +---------+
  3825. Branch R1fix -> +---! 1.2.2.1 !----! 1.2.2.2 !----! 1.2.2.3 !
  3826. +---------+ +---------+ +---------+
  3827. @end example
  3828. @noindent
  3829. and then you want to merge those new changes onto the
  3830. main trunk. If you just use the @code{cvs update -j
  3831. R1fix m.c} command again, @sc{cvs} will attempt to
  3832. merge again the changes which you have already merged,
  3833. which can have undesirable side effects.
  3834. So instead you need to specify that you only want to
  3835. merge the changes on the branch which have not yet been
  3836. merged into the trunk. To do that you specify two
  3837. @samp{-j} options, and @sc{cvs} merges the changes from
  3838. the first revision to the second revision. For
  3839. example, in this case the simplest way would be
  3840. @example
  3841. cvs update -j 1.2.2.2 -j R1fix m.c # @r{Merge changes from 1.2.2.2 to the}
  3842. # @r{head of the R1fix branch}
  3843. @end example
  3844. The problem with this is that you need to specify the
  3845. 1.2.2.2 revision manually. A slightly better approach
  3846. might be to use the date the last merge was done:
  3847. @example
  3848. cvs update -j R1fix:yesterday -j R1fix m.c
  3849. @end example
  3850. Better yet, tag the R1fix branch after every merge into
  3851. the trunk, and then use that tag for subsequent merges:
  3852. @example
  3853. cvs update -j merged_from_R1fix_to_trunk -j R1fix m.c
  3854. @end example
  3855. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3856. @node Merging two revisions
  3857. @section Merging differences between any two revisions
  3858. @cindex Merging two revisions
  3859. @cindex Revisions, merging differences between
  3860. @cindex Differences, merging
  3861. With two @samp{-j @var{revision}} flags, the @code{update}
  3862. (and @code{checkout}) command can merge the differences
  3863. between any two revisions into your working file.
  3864. @cindex Undoing a change
  3865. @cindex Removing a change
  3866. @example
  3867. $ cvs update -j 1.5 -j 1.3 backend.c
  3868. @end example
  3869. @noindent
  3870. will undo all changes made between revision
  3871. 1.3 and 1.5. Note the order of the revisions!
  3872. If you try to use this option when operating on
  3873. multiple files, remember that the numeric revisions will
  3874. probably be very different between the various files.
  3875. You almost always use symbolic
  3876. tags rather than revision numbers when operating on
  3877. multiple files.
  3878. @cindex Restoring old version of removed file
  3879. @cindex Resurrecting old version of dead file
  3880. Specifying two @samp{-j} options can also undo file
  3881. removals or additions. For example, suppose you have
  3882. a file
  3883. named @file{file1} which existed as revision 1.1, and
  3884. you then removed it (thus adding a dead revision 1.2).
  3885. Now suppose you want to add it again, with the same
  3886. contents it had previously. Here is how to do it:
  3887. @example
  3888. $ cvs update -j 1.2 -j 1.1 file1
  3889. U file1
  3890. $ cvs commit -m test
  3891. Checking in file1;
  3892. /tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
  3893. new revision: 1.3; previous revision: 1.2
  3894. done
  3895. $
  3896. @end example
  3897. @node Merging adds and removals
  3898. @section Merging can add or remove files
  3899. If the changes which you are merging involve removing
  3900. or adding some files, @code{update -j} will reflect
  3901. such additions or removals.
  3902. @c FIXME: This example needs a lot more explanation.
  3903. @c We also need other examples for some of the other
  3904. @c cases (not all--there are too many--as long as we present a
  3905. @c coherent general principle).
  3906. For example:
  3907. @example
  3908. cvs update -A
  3909. touch a b c
  3910. cvs add a b c ; cvs ci -m "added" a b c
  3911. cvs tag -b branchtag
  3912. cvs update -r branchtag
  3913. touch d ; cvs add d
  3914. rm a ; cvs rm a
  3915. cvs ci -m "added d, removed a"
  3916. cvs update -A
  3917. cvs update -jbranchtag
  3918. @end example
  3919. After these commands are executed and a @samp{cvs commit} is done,
  3920. file @file{a} will be removed and file @file{d} added in the main branch.
  3921. @c (which was determined by trying it)
  3922. Note that using a single static tag (@samp{-j @var{tagname}})
  3923. rather than a dynamic tag (@samp{-j @var{branchname}}) to merge
  3924. changes from a branch will usually not remove files which were removed on the
  3925. branch since @sc{cvs} does not automatically add static tags to dead revisions.
  3926. The exception to this rule occurs when
  3927. a static tag has been attached to a dead revision manually. Use the branch tag
  3928. to merge all changes from the branch or use two static tags as merge endpoints
  3929. to be sure that all intended changes are propagated in the merge.
  3930. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3931. @node Merging and keywords
  3932. @section Merging and keywords
  3933. @cindex Merging, and keyword substitution
  3934. @cindex Keyword substitution, and merging
  3935. @cindex -j (merging branches), and keyword substitution
  3936. @cindex -kk, to avoid conflicts during a merge
  3937. If you merge files containing keywords (@pxref{Keyword
  3938. substitution}), you will normally get numerous
  3939. conflicts during the merge, because the keywords are
  3940. expanded differently in the revisions which you are
  3941. merging.
  3942. Therefore, you will often want to specify the
  3943. @samp{-kk} (@pxref{Substitution modes}) switch to the
  3944. merge command line. By substituting just the name of
  3945. the keyword, not the expanded value of that keyword,
  3946. this option ensures that the revisions which you are
  3947. merging will be the same as each other, and avoid
  3948. spurious conflicts.
  3949. For example, suppose you have a file like this:
  3950. @example
  3951. +---------+
  3952. _! 1.1.2.1 ! <- br1
  3953. / +---------+
  3954. /
  3955. /
  3956. +-----+ +-----+
  3957. ! 1.1 !----! 1.2 !
  3958. +-----+ +-----+
  3959. @end example
  3960. @noindent
  3961. and your working directory is currently on the trunk
  3962. (revision 1.2). Then you might get the following
  3963. results from a merge:
  3964. @example
  3965. $ cat file1
  3966. key $@splitrcskeyword{}Revision: 1.2 $
  3967. . . .
  3968. $ cvs update -j br1
  3969. U file1
  3970. RCS file: /cvsroot/first-dir/file1,v
  3971. retrieving revision 1.1
  3972. retrieving revision 1.1.2.1
  3973. Merging differences between 1.1 and 1.1.2.1 into file1
  3974. rcsmerge: warning: conflicts during merge
  3975. $ cat file1
  3976. @asis{}<<<<<<< file1
  3977. key $@splitrcskeyword{}Revision: 1.2 $
  3978. @asis{}=======
  3979. key $@splitrcskeyword{}Revision: 1.1.2.1 $
  3980. @asis{}>>>>>>> 1.1.2.1
  3981. . . .
  3982. @end example
  3983. What happened was that the merge tried to merge the
  3984. differences between 1.1 and 1.1.2.1 into your working
  3985. directory. So, since the keyword changed from
  3986. @code{Revision: 1.1} to @code{Revision: 1.1.2.1},
  3987. @sc{cvs} tried to merge that change into your working
  3988. directory, which conflicted with the fact that your
  3989. working directory had contained @code{Revision: 1.2}.
  3990. Here is what happens if you had used @samp{-kk}:
  3991. @example
  3992. $ cat file1
  3993. key $@splitrcskeyword{}Revision: 1.2 $
  3994. . . .
  3995. $ cvs update -kk -j br1
  3996. U file1
  3997. RCS file: /cvsroot/first-dir/file1,v
  3998. retrieving revision 1.1
  3999. retrieving revision 1.1.2.1
  4000. Merging differences between 1.1 and 1.1.2.1 into file1
  4001. $ cat file1
  4002. key $@splitrcskeyword{}Revision$
  4003. . . .
  4004. @end example
  4005. What is going on here is that revision 1.1 and 1.1.2.1
  4006. both expand as plain @code{Revision}, and therefore
  4007. merging the changes between them into the working
  4008. directory need not change anything. Therefore, there
  4009. is no conflict.
  4010. @strong{WARNING: In versions of @sc{cvs} prior to 1.12.2, there was a
  4011. major problem with using @samp{-kk} on merges. Namely, @samp{-kk}
  4012. overrode any default keyword expansion mode set in the archive file in
  4013. the repository. This could, unfortunately for some users, cause data
  4014. corruption in binary files (with a default keyword expansion mode set
  4015. to @samp{-kb}). Therefore, when a repository contained binary files,
  4016. conflicts had to be dealt with manually rather than using @samp{-kk} in
  4017. a merge command.}
  4018. In @sc{cvs} version 1.12.2 and later, the keyword expansion mode
  4019. provided on the command line to any @sc{cvs} command no longer
  4020. overrides the @samp{-kb} keyword expansion mode setting for binary
  4021. files, though it will still override other default keyword expansion
  4022. modes. You can now safely merge using @samp{-kk} to avoid spurious conflicts
  4023. on lines containing RCS keywords, even when your repository contains
  4024. binary files.
  4025. @c ---------------------------------------------------------------------
  4026. @node Recursive behavior
  4027. @chapter Recursive behavior
  4028. @cindex Recursive (directory descending)
  4029. @cindex Directory, descending
  4030. @cindex Descending directories
  4031. @cindex Subdirectories
  4032. Almost all of the subcommands of @sc{cvs} work
  4033. recursively when you specify a directory as an
  4034. argument. For instance, consider this directory
  4035. structure:
  4036. @example
  4037. @code{$HOME}
  4038. |
  4039. +--@t{tc}
  4040. | |
  4041. +--@t{CVS}
  4042. | (internal @sc{cvs} files)
  4043. +--@t{Makefile}
  4044. +--@t{backend.c}
  4045. +--@t{driver.c}
  4046. +--@t{frontend.c}
  4047. +--@t{parser.c}
  4048. +--@t{man}
  4049. | |
  4050. | +--@t{CVS}
  4051. | | (internal @sc{cvs} files)
  4052. | +--@t{tc.1}
  4053. |
  4054. +--@t{testing}
  4055. |
  4056. +--@t{CVS}
  4057. | (internal @sc{cvs} files)
  4058. +--@t{testpgm.t}
  4059. +--@t{test2.t}
  4060. @end example
  4061. @noindent
  4062. If @file{tc} is the current working directory, the
  4063. following is true:
  4064. @itemize @bullet
  4065. @item
  4066. @samp{cvs update testing} is equivalent to
  4067. @example
  4068. cvs update testing/testpgm.t testing/test2.t
  4069. @end example
  4070. @item
  4071. @samp{cvs update testing man} updates all files in the
  4072. subdirectories
  4073. @item
  4074. @samp{cvs update .} or just @samp{cvs update} updates
  4075. all files in the @code{tc} directory
  4076. @end itemize
  4077. If no arguments are given to @code{update} it will
  4078. update all files in the current working directory and
  4079. all its subdirectories. In other words, @file{.} is a
  4080. default argument to @code{update}. This is also true
  4081. for most of the @sc{cvs} subcommands, not only the
  4082. @code{update} command.
  4083. The recursive behavior of the @sc{cvs} subcommands can be
  4084. turned off with the @samp{-l} option.
  4085. Conversely, the @samp{-R} option can be used to force recursion if
  4086. @samp{-l} is specified in @file{~/.cvsrc} (@pxref{~/.cvsrc}).
  4087. @example
  4088. $ cvs update -l # @r{Don't update files in subdirectories}
  4089. @end example
  4090. @c ---------------------------------------------------------------------
  4091. @node Adding and removing
  4092. @chapter Adding, removing, and renaming files and directories
  4093. In the course of a project, one will often add new
  4094. files. Likewise with removing or renaming, or with
  4095. directories. The general concept to keep in mind in
  4096. all these cases is that instead of making an
  4097. irreversible change you want @sc{cvs} to record the
  4098. fact that a change has taken place, just as with
  4099. modifying an existing file. The exact mechanisms to do
  4100. this in @sc{cvs} vary depending on the situation.
  4101. @menu
  4102. * Adding files:: Adding files
  4103. * Removing files:: Removing files
  4104. * Removing directories:: Removing directories
  4105. * Moving files:: Moving and renaming files
  4106. * Moving directories:: Moving and renaming directories
  4107. @end menu
  4108. @node Adding files
  4109. @section Adding files to a directory
  4110. @cindex Adding files
  4111. To add a new file to a directory, follow these steps.
  4112. @itemize @bullet
  4113. @item
  4114. You must have a working copy of the directory.
  4115. @xref{Getting the source}.
  4116. @item
  4117. Create the new file inside your working copy of the directory.
  4118. @item
  4119. Use @samp{cvs add @var{filename}} to tell @sc{cvs} that you
  4120. want to version control the file. If the file contains
  4121. binary data, specify @samp{-kb} (@pxref{Binary files}).
  4122. @item
  4123. Use @samp{cvs commit @var{filename}} to actually check
  4124. in the file into the repository. Other developers
  4125. cannot see the file until you perform this step.
  4126. @end itemize
  4127. You can also use the @code{add} command to add a new
  4128. directory.
  4129. @c FIXCVS and/or FIXME: Adding a directory doesn't
  4130. @c require the commit step. This probably can be
  4131. @c considered a CVS bug, but it is possible we should
  4132. @c warn people since this behavior probably won't be
  4133. @c changing right away.
  4134. Unlike most other commands, the @code{add} command is
  4135. not recursive. You cannot even type @samp{cvs add
  4136. foo/bar}! Instead, you have to
  4137. @c FIXCVS: This is, of course, not a feature. It is
  4138. @c just that no one has gotten around to fixing "cvs add
  4139. @c foo/bar".
  4140. @example
  4141. $ cd foo
  4142. $ cvs add bar
  4143. @end example
  4144. @cindex add (subcommand)
  4145. @deffn Command {cvs add} [@code{-k} kflag] [@code{-m} message] files @dots{}
  4146. Schedule @var{files} to be added to the repository.
  4147. The files or directories specified with @code{add} must
  4148. already exist in the current directory. To add a whole
  4149. new directory hierarchy to the source repository (for
  4150. example, files received from a third-party vendor), use
  4151. the @code{import} command instead. @xref{import}.
  4152. The added files are not placed in the source repository
  4153. until you use @code{commit} to make the change
  4154. permanent. Doing an @code{add} on a file that was
  4155. removed with the @code{remove} command will undo the
  4156. effect of the @code{remove}, unless a @code{commit}
  4157. command intervened. @xref{Removing files}, for an
  4158. example.
  4159. The @samp{-k} option specifies the default way that
  4160. this file will be checked out; for more information see
  4161. @ref{Substitution modes}.
  4162. @c As noted in BUGS, -m is broken client/server (Nov
  4163. @c 96). Also see testsuite log2-* tests.
  4164. The @samp{-m} option specifies a description for the
  4165. file. This description appears in the history log (if
  4166. it is enabled, @pxref{history file}). It will also be
  4167. saved in the version history inside the repository when
  4168. the file is committed. The @code{log} command displays
  4169. this description. The description can be changed using
  4170. @samp{admin -t}. @xref{admin}. If you omit the
  4171. @samp{-m @var{description}} flag, an empty string will
  4172. be used. You will not be prompted for a description.
  4173. @end deffn
  4174. For example, the following commands add the file
  4175. @file{backend.c} to the repository:
  4176. @c This example used to specify
  4177. @c -m "Optimizer and code generation passes."
  4178. @c to the cvs add command, but that doesn't work
  4179. @c client/server (see log2 in sanity.sh). Should fix CVS,
  4180. @c but also seems strange to document things which
  4181. @c don't work...
  4182. @example
  4183. $ cvs add backend.c
  4184. $ cvs commit -m "Early version. Not yet compilable." backend.c
  4185. @end example
  4186. When you add a file it is added only on the branch
  4187. which you are working on (@pxref{Branching and merging}). You can
  4188. later merge the additions to another branch if you want
  4189. (@pxref{Merging adds and removals}).
  4190. @c Should we mention that earlier versions of CVS
  4191. @c lacked this feature (1.3) or implemented it in a buggy
  4192. @c way (well, 1.8 had many bugs in cvs update -j)?
  4193. @c Should we mention the bug/limitation regarding a
  4194. @c file being a regular file on one branch and a directory
  4195. @c on another?
  4196. @c FIXME: This needs an example, or several, here or
  4197. @c elsewhere, for it to make much sense.
  4198. @c Somewhere we need to discuss the aspects of death
  4199. @c support which don't involve branching, I guess.
  4200. @c Like the ability to re-create a release from a tag.
  4201. @c ---------------------------------------------------------------------
  4202. @node Removing files
  4203. @section Removing files
  4204. @cindex Removing files
  4205. @cindex Deleting files
  4206. @c FIXME: this node wants to be split into several
  4207. @c smaller nodes. Could make these children of
  4208. @c "Adding and removing", probably (death support could
  4209. @c be its own section, for example, as could the
  4210. @c various bits about undoing mistakes in adding and
  4211. @c removing).
  4212. Directories change. New files are added, and old files
  4213. disappear. Still, you want to be able to retrieve an
  4214. exact copy of old releases.
  4215. Here is what you can do to remove a file,
  4216. but remain able to retrieve old revisions:
  4217. @itemize @bullet
  4218. @c FIXME: should probably be saying something about
  4219. @c having a working directory in the first place.
  4220. @item
  4221. Make sure that you have not made any uncommitted
  4222. modifications to the file. @xref{Viewing differences},
  4223. for one way to do that. You can also use the
  4224. @code{status} or @code{update} command. If you remove
  4225. the file without committing your changes, you will of
  4226. course not be able to retrieve the file as it was
  4227. immediately before you deleted it.
  4228. @item
  4229. Remove the file from your working copy of the directory.
  4230. You can for instance use @code{rm}.
  4231. @item
  4232. Use @samp{cvs remove @var{filename}} to tell @sc{cvs} that
  4233. you really want to delete the file.
  4234. @item
  4235. Use @samp{cvs commit @var{filename}} to actually
  4236. perform the removal of the file from the repository.
  4237. @end itemize
  4238. @c FIXME: Somehow this should be linked in with a more
  4239. @c general discussion of death support. I don't know
  4240. @c whether we want to use the term "death support" or
  4241. @c not (we can perhaps get by without it), but we do
  4242. @c need to discuss the "dead" state in "cvs log" and
  4243. @c related subjects. The current discussion is
  4244. @c scattered around, and not xref'd to each other.
  4245. @c FIXME: I think this paragraph wants to be moved
  4246. @c later down, at least after the first example.
  4247. When you commit the removal of the file, @sc{cvs}
  4248. records the fact that the file no longer exists. It is
  4249. possible for a file to exist on only some branches and
  4250. not on others, or to re-add another file with the same
  4251. name later. @sc{cvs} will correctly create or not create
  4252. the file, based on the @samp{-r} and @samp{-D} options
  4253. specified to @code{checkout} or @code{update}.
  4254. @c FIXME: This style seems to clash with how we
  4255. @c document things in general.
  4256. @cindex Remove (subcommand)
  4257. @deffn Command {cvs remove} [options] files @dots{}
  4258. Schedule file(s) to be removed from the repository
  4259. (files which have not already been removed from the
  4260. working directory are not processed). This command
  4261. does not actually remove the file from the repository
  4262. until you commit the removal. For a full list of
  4263. options, see @ref{Invoking CVS}.
  4264. @end deffn
  4265. Here is an example of removing several files:
  4266. @example
  4267. $ cd test
  4268. $ rm *.c
  4269. $ cvs remove
  4270. cvs remove: Removing .
  4271. cvs remove: scheduling a.c for removal
  4272. cvs remove: scheduling b.c for removal
  4273. cvs remove: use 'cvs commit' to remove these files permanently
  4274. $ cvs ci -m "Removed unneeded files"
  4275. cvs commit: Examining .
  4276. cvs commit: Committing .
  4277. @end example
  4278. As a convenience you can remove the file and @code{cvs
  4279. remove} it in one step, by specifying the @samp{-f}
  4280. option. For example, the above example could also be
  4281. done like this:
  4282. @example
  4283. $ cd test
  4284. $ cvs remove -f *.c
  4285. cvs remove: scheduling a.c for removal
  4286. cvs remove: scheduling b.c for removal
  4287. cvs remove: use 'cvs commit' to remove these files permanently
  4288. $ cvs ci -m "Removed unneeded files"
  4289. cvs commit: Examining .
  4290. cvs commit: Committing .
  4291. @end example
  4292. If you execute @code{remove} for a file, and then
  4293. change your mind before you commit, you can undo the
  4294. @code{remove} with an @code{add} command.
  4295. @ignore
  4296. @c is this worth saying or not? Somehow it seems
  4297. @c confusing to me.
  4298. Of course,
  4299. since you have removed your copy of file in the working
  4300. directory, @sc{cvs} does not necessarily bring back the
  4301. contents of the file from right before you executed
  4302. @code{remove}; instead it gets the file from the
  4303. repository again.
  4304. @end ignore
  4305. @c FIXME: what if you change your mind after you commit
  4306. @c it? (answer is also "cvs add" but we don't say that...).
  4307. @c We need some index entries for thinks like "undoing
  4308. @c removal" too.
  4309. @example
  4310. $ ls
  4311. CVS ja.h oj.c
  4312. $ rm oj.c
  4313. $ cvs remove oj.c
  4314. cvs remove: scheduling oj.c for removal
  4315. cvs remove: use 'cvs commit' to remove this file permanently
  4316. $ cvs add oj.c
  4317. U oj.c
  4318. cvs add: oj.c, version 1.1.1.1, resurrected
  4319. @end example
  4320. If you realize your mistake before you run the
  4321. @code{remove} command you can use @code{update} to
  4322. resurrect the file:
  4323. @example
  4324. $ rm oj.c
  4325. $ cvs update oj.c
  4326. cvs update: warning: oj.c was lost
  4327. U oj.c
  4328. @end example
  4329. When you remove a file it is removed only on the branch
  4330. which you are working on (@pxref{Branching and merging}). You can
  4331. later merge the removals to another branch if you want
  4332. (@pxref{Merging adds and removals}).
  4333. @node Removing directories
  4334. @section Removing directories
  4335. @cindex Removing directories
  4336. @cindex Directories, removing
  4337. In concept removing directories is somewhat similar to
  4338. removing files---you want the directory to not exist in
  4339. your current working directories, but you also want to
  4340. be able to retrieve old releases in which the directory
  4341. existed.
  4342. The way that you remove a directory is to remove all
  4343. the files in it. You don't remove the directory
  4344. itself; there is no way to do that.
  4345. Instead you specify the @samp{-P} option to
  4346. @code{cvs update} or @code{cvs checkout},
  4347. which will cause @sc{cvs} to remove empty
  4348. directories from working directories.
  4349. (Note that @code{cvs export} always removes empty directories.)
  4350. Probably the
  4351. best way to do this is to always specify @samp{-P}; if
  4352. you want an empty directory then put a dummy file (for
  4353. example @file{.keepme}) in it to prevent @samp{-P} from
  4354. removing it.
  4355. @c I'd try to give a rationale for this, but I'm not
  4356. @c sure there is a particularly convincing one. What
  4357. @c we would _like_ is for CVS to do a better job of version
  4358. @c controlling whether directories exist, to eliminate the
  4359. @c need for -P and so that a file can be a directory in
  4360. @c one revision and a regular file in another.
  4361. Note that @samp{-P} is implied by the @samp{-r} or @samp{-D}
  4362. options of @code{checkout}. This way
  4363. @sc{cvs} will be able to correctly create the directory
  4364. or not depending on whether the particular version you
  4365. are checking out contains any files in that directory.
  4366. @c ---------------------------------------------------------------------
  4367. @node Moving files
  4368. @section Moving and renaming files
  4369. @cindex Moving files
  4370. @cindex Renaming files
  4371. @cindex Files, moving
  4372. Moving files to a different directory or renaming them
  4373. is not difficult, but some of the ways in which this
  4374. works may be non-obvious. (Moving or renaming a
  4375. directory is even harder. @xref{Moving directories}.).
  4376. The examples below assume that the file @var{old} is renamed to
  4377. @var{new}.
  4378. @menu
  4379. * Outside:: The normal way to Rename
  4380. * Inside:: A tricky, alternative way
  4381. * Rename by copying:: Another tricky, alternative way
  4382. @end menu
  4383. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4384. @node Outside
  4385. @subsection The Normal way to Rename
  4386. @c More rename issues. Not sure whether these are
  4387. @c worth documenting; I'm putting them here because
  4388. @c it seems to be as good a place as any to try to
  4389. @c set down the issues.
  4390. @c * "cvs annotate" will annotate either the new
  4391. @c file or the old file; it cannot annotate _each
  4392. @c line_ based on whether it was last changed in the
  4393. @c new or old file. Unlike "cvs log", where the
  4394. @c consequences of having to select either the new
  4395. @c or old name seem fairly benign, this may be a
  4396. @c real advantage to having CVS know about renames
  4397. @c other than as a deletion and an addition.
  4398. The normal way to move a file is to copy @var{old} to
  4399. @var{new}, and then issue the normal @sc{cvs} commands
  4400. to remove @var{old} from the repository, and add
  4401. @var{new} to it.
  4402. @c The following sentence is not true: one must cd into
  4403. @c the directory to run "cvs add".
  4404. @c (Both @var{old} and @var{new} could
  4405. @c contain relative paths, for example @file{foo/bar.c}).
  4406. @example
  4407. $ mv @var{old} @var{new}
  4408. $ cvs remove @var{old}
  4409. $ cvs add @var{new}
  4410. $ cvs commit -m "Renamed @var{old} to @var{new}" @var{old} @var{new}
  4411. @end example
  4412. This is the simplest way to move a file, it is not
  4413. error-prone, and it preserves the history of what was
  4414. done. Note that to access the history of the file you
  4415. must specify the old or the new name, depending on what
  4416. portion of the history you are accessing. For example,
  4417. @code{cvs log @var{old}} will give the log up until the
  4418. time of the rename.
  4419. When @var{new} is committed its revision numbers will
  4420. start again, usually at 1.1, so if that bothers you,
  4421. use the @samp{-r rev} option to commit. For more
  4422. information see @ref{Assigning revisions}.
  4423. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4424. @node Inside
  4425. @subsection Moving the history file
  4426. This method is more dangerous, since it involves moving
  4427. files inside the repository. Read this entire section
  4428. before trying it out!
  4429. @example
  4430. $ cd $CVSROOT/@var{dir}
  4431. $ mv @var{old},v @var{new},v
  4432. @end example
  4433. @noindent
  4434. Advantages:
  4435. @itemize @bullet
  4436. @item
  4437. The log of changes is maintained intact.
  4438. @item
  4439. The revision numbers are not affected.
  4440. @end itemize
  4441. @noindent
  4442. Disadvantages:
  4443. @itemize @bullet
  4444. @item
  4445. Old releases cannot easily be fetched from the
  4446. repository. (The file will show up as @var{new} even
  4447. in revisions from the time before it was renamed).
  4448. @item
  4449. There is no log information of when the file was renamed.
  4450. @item
  4451. Nasty things might happen if someone accesses the history file
  4452. while you are moving it. Make sure no one else runs any of the @sc{cvs}
  4453. commands while you move it.
  4454. @end itemize
  4455. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4456. @node Rename by copying
  4457. @subsection Copying the history file
  4458. This way also involves direct modifications to the
  4459. repository. It is safe, but not without drawbacks.
  4460. @example
  4461. # @r{Copy the @sc{rcs} file inside the repository}
  4462. $ cd $CVSROOT/@var{dir}
  4463. $ cp @var{old},v @var{new},v
  4464. # @r{Remove the old file}
  4465. $ cd ~/@var{dir}
  4466. $ rm @var{old}
  4467. $ cvs remove @var{old}
  4468. $ cvs commit @var{old}
  4469. # @r{Remove all tags from @var{new}}
  4470. $ cvs update @var{new}
  4471. $ cvs log @var{new} # @r{Remember the non-branch tag names}
  4472. $ cvs tag -d @var{tag1} @var{new}
  4473. $ cvs tag -d @var{tag2} @var{new}
  4474. @dots{}
  4475. @end example
  4476. By removing the tags you will be able to check out old
  4477. revisions.
  4478. @noindent
  4479. Advantages:
  4480. @itemize @bullet
  4481. @item
  4482. @c FIXME: Is this true about -D now that we have death
  4483. @c support? See 5B.3 in the FAQ.
  4484. Checking out old revisions works correctly, as long as
  4485. you use @samp{-r@var{tag}} and not @samp{-D@var{date}}
  4486. to retrieve the revisions.
  4487. @item
  4488. The log of changes is maintained intact.
  4489. @item
  4490. The revision numbers are not affected.
  4491. @end itemize
  4492. @noindent
  4493. Disadvantages:
  4494. @itemize @bullet
  4495. @item
  4496. You cannot easily see the history of the file across the rename.
  4497. @ignore
  4498. @c Is this true? I don't see how the revision numbers
  4499. @c _could_ start over, when new,v is just old,v with
  4500. @c the tags deleted.
  4501. @c If there is some need to reinstate this text,
  4502. @c it is "usually 1.1", not "1.0" and it needs an
  4503. @c xref to Assigning revisions
  4504. @item
  4505. Unless you use the @samp{-r rev} (@pxref{commit
  4506. options}) flag when @var{new} is committed its revision
  4507. numbers will start at 1.0 again.
  4508. @end ignore
  4509. @end itemize
  4510. @c ---------------------------------------------------------------------
  4511. @node Moving directories
  4512. @section Moving and renaming directories
  4513. @cindex Moving directories
  4514. @cindex Renaming directories
  4515. @cindex Directories, moving
  4516. The normal way to rename or move a directory is to
  4517. rename or move each file within it as described in
  4518. @ref{Outside}. Then check out with the @samp{-P}
  4519. option, as described in @ref{Removing directories}.
  4520. If you really want to hack the repository to rename or
  4521. delete a directory in the repository, you can do it
  4522. like this:
  4523. @enumerate
  4524. @item
  4525. Inform everyone who has a checked out copy of the directory that the
  4526. directory will be renamed. They should commit all
  4527. their changes, and remove their working copies,
  4528. before you take the steps below.
  4529. @item
  4530. Rename the directory inside the repository.
  4531. @example
  4532. $ cd $CVSROOT/@var{parent-dir}
  4533. $ mv @var{old-dir} @var{new-dir}
  4534. @end example
  4535. @item
  4536. Fix the @sc{cvs} administrative files, if necessary (for
  4537. instance if you renamed an entire module).
  4538. @item
  4539. Tell everyone that they can check out again and continue
  4540. working.
  4541. @end enumerate
  4542. If someone had a working copy the @sc{cvs} commands will
  4543. cease to work for him, until he removes the directory
  4544. that disappeared inside the repository.
  4545. It is almost always better to move the files in the
  4546. directory instead of moving the directory. If you move the
  4547. directory you are unlikely to be able to retrieve old
  4548. releases correctly, since they probably depend on the
  4549. name of the directories.
  4550. @c ---------------------------------------------------------------------
  4551. @node History browsing
  4552. @chapter History browsing
  4553. @cindex History browsing
  4554. @cindex Traceability
  4555. @cindex Isolation
  4556. @ignore
  4557. @c This is too long for an introduction (goal is
  4558. @c one 20x80 character screen), and also mixes up a
  4559. @c variety of issues (parallel development, history,
  4560. @c maybe even touches on process control).
  4561. @c -- @quote{To lose ones history is to lose ones soul.}
  4562. @c -- ///
  4563. @c -- ///Those who cannot remember the past are condemned to repeat it.
  4564. @c -- /// -- George Santayana
  4565. @c -- ///
  4566. @sc{cvs} tries to make it easy for a group of people to work
  4567. together. This is done in two ways:
  4568. @itemize @bullet
  4569. @item
  4570. Isolation---You have your own working copy of the
  4571. source. You are not affected by modifications made by
  4572. others until you decide to incorporate those changes
  4573. (via the @code{update} command---@pxref{update}).
  4574. @item
  4575. Traceability---When something has changed, you can
  4576. always see @emph{exactly} what changed.
  4577. @end itemize
  4578. There are several features of @sc{cvs} that together lead
  4579. to traceability:
  4580. @itemize @bullet
  4581. @item
  4582. Each revision of a file has an accompanying log
  4583. message.
  4584. @item
  4585. All commits are optionally logged to a central history
  4586. database.
  4587. @item
  4588. Logging information can be sent to a user-defined
  4589. program (@pxref{loginfo}).
  4590. @end itemize
  4591. @c -- More text here.
  4592. This chapter should talk about the history file, the
  4593. @code{log} command, the usefulness of ChangeLogs
  4594. even when you run @sc{cvs}, and things like that.
  4595. @end ignore
  4596. @c kind of lame, in a lot of ways the above text inside
  4597. @c the @ignore motivates this chapter better
  4598. Once you have used @sc{cvs} to store a version control
  4599. history---what files have changed when, how, and by
  4600. whom, there are a variety of mechanisms for looking
  4601. through the history.
  4602. @c FIXME: should also be talking about how you look at
  4603. @c old revisions (e.g. "cvs update -p -r 1.2 foo.c").
  4604. @menu
  4605. * log messages:: Log messages
  4606. * history database:: The history database
  4607. * user-defined logging:: User-defined logging
  4608. * annotate:: What revision modified each line of a file?
  4609. @end menu
  4610. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4611. @node log messages
  4612. @section Log messages
  4613. @c FIXME: @xref to place where we talk about how to
  4614. @c specify message to commit.
  4615. Whenever you commit a file you specify a log message.
  4616. @c FIXME: bring the information here, and get rid of or
  4617. @c greatly shrink the "log" node.
  4618. To look through the log messages which have been
  4619. specified for every revision which has been committed,
  4620. use the @code{cvs log} command (@pxref{log}).
  4621. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4622. @node history database
  4623. @section The history database
  4624. @c FIXME: bring the information from the history file
  4625. @c and history nodes here. Rewrite it to be motivated
  4626. @c better (start out by clearly explaining what gets
  4627. @c logged in history, for example).
  4628. You can use the history file (@pxref{history file}) to
  4629. log various @sc{cvs} actions. To retrieve the
  4630. information from the history file, use the @code{cvs
  4631. history} command (@pxref{history}).
  4632. Note: you can control what is logged to this file by using the
  4633. @samp{LogHistory} keyword in the @file{CVSROOT/config} file
  4634. (@pxref{config}).
  4635. @c
  4636. @c The history database has many problems:
  4637. @c * It is very unclear what field means what. This
  4638. @c could be improved greatly by better documentation,
  4639. @c but there are still non-orthogonalities (for
  4640. @c example, tag does not record the "repository"
  4641. @c field but most records do).
  4642. @c * Confusion about files, directories, and modules.
  4643. @c Some commands record one, some record others.
  4644. @c * File removal is not logged. There is an 'R'
  4645. @c record type documented, but CVS never uses it.
  4646. @c * Tags are only logged for the "cvs rtag" command,
  4647. @c not "cvs tag". The fix for this is not completely
  4648. @c clear (see above about modules vs. files).
  4649. @c * Are there other cases of operations that are not
  4650. @c logged? One would hope for all changes to the
  4651. @c repository to be logged somehow (particularly
  4652. @c operations like tagging, "cvs admin -k", and other
  4653. @c operations which do not record a history that one
  4654. @c can get with "cvs log"). Operations on the working
  4655. @c directory, like export, get, and release, are a
  4656. @c second category also covered by the current "cvs
  4657. @c history".
  4658. @c * The history file does not record the options given
  4659. @c to a command. The most serious manifestation of
  4660. @c this is perhaps that it doesn't record whether a command
  4661. @c was recursive. It is not clear to me whether one
  4662. @c wants to log at a level very close to the command
  4663. @c line, as a sort of way of logging each command
  4664. @c (more or less), or whether one wants
  4665. @c to log more at the level of what was changed (or
  4666. @c something in between), but either way the current
  4667. @c information has pretty big gaps.
  4668. @c * Further details about a tag--like whether it is a
  4669. @c branch tag or, if a non-branch tag, which branch it
  4670. @c is on. One can find out this information about the
  4671. @c tag as it exists _now_, but if the tag has been
  4672. @c moved, one doesn't know what it was like at the time
  4673. @c the history record was written.
  4674. @c * Whether operating on a particular tag, date, or
  4675. @c options was implicit (sticky) or explicit.
  4676. @c
  4677. @c Another item, only somewhat related to the above, is a
  4678. @c way to control what is logged in the history file.
  4679. @c This is probably the only good way to handle
  4680. @c different people having different ideas about
  4681. @c information/space tradeoffs.
  4682. @c
  4683. @c It isn't really clear that it makes sense to try to
  4684. @c patch up the history file format as it exists now to
  4685. @c include all that stuff. It might be better to
  4686. @c design a whole new CVSROOT/nhistory file and "cvs
  4687. @c nhistory" command, or some such, or in some other
  4688. @c way trying to come up with a clean break from the
  4689. @c past, which can address the above concerns. Another
  4690. @c open question is how/whether this relates to
  4691. @c taginfo/loginfo/etc.
  4692. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4693. @node user-defined logging
  4694. @section User-defined logging
  4695. @c FIXME: should probably also mention the fact the -l
  4696. @c global option can disable most of the mechanisms
  4697. @c discussed here (why? What is the -l global option for?).
  4698. @c
  4699. @c FIXME: probably should centralize this information
  4700. @c here, at least to some extent. Maybe by moving the
  4701. @c loginfo, etc., nodes here and replacing
  4702. @c the "user-defined logging" node with one node for
  4703. @c each method.
  4704. You can customize @sc{cvs} to log various kinds of
  4705. actions, in whatever manner you choose. These
  4706. mechanisms operate by executing a script at various
  4707. times. The script might append a message to a file
  4708. listing the information and the programmer who created
  4709. it, or send mail to a group of developers, or, perhaps,
  4710. post a message to a particular newsgroup. To log
  4711. commits, use the @file{loginfo} file (@pxref{loginfo}).
  4712. @c FIXME: What is difference between doing it in the
  4713. @c modules file and using loginfo/taginfo? Why should
  4714. @c user use one or the other?
  4715. To log commits, checkouts, exports, and tags,
  4716. respectively, you can also use the @samp{-i},
  4717. @samp{-o}, @samp{-e}, and @samp{-t} options in the
  4718. modules file. For a more flexible way of giving
  4719. notifications to various users, which requires less in
  4720. the way of keeping centralized scripts up to date, use
  4721. the @code{cvs watch add} command (@pxref{Getting
  4722. Notified}); this command is useful even if you are not
  4723. using @code{cvs watch on}.
  4724. @cindex taginfo
  4725. @cindex Exit status, of taginfo
  4726. The @file{taginfo} file defines programs to execute
  4727. when someone executes a @code{tag} or @code{rtag}
  4728. command. The @file{taginfo} file has the standard form
  4729. for administrative files (@pxref{Administrative
  4730. files}), where each line is a regular expression
  4731. followed by a command to execute. The arguments passed
  4732. to the command are, in order, the @var{tagname},
  4733. @var{operation} (@code{add} for @code{tag},
  4734. @code{mov} for @code{tag -F}, and @code{del} for
  4735. @code{tag -d}), @var{repository}, and any remaining are
  4736. pairs of @var{filename} @var{revision}. A non-zero
  4737. exit of the filter program will cause the tag to be
  4738. aborted.
  4739. Here is an example of using taginfo to log tag and rtag
  4740. commands. In the taginfo file put:
  4741. @example
  4742. ALL /usr/local/cvsroot/CVSROOT/loggit
  4743. @end example
  4744. @noindent
  4745. Where @file{/usr/local/cvsroot/CVSROOT/loggit} contains the
  4746. following script:
  4747. @example
  4748. #!/bin/sh
  4749. echo "$@@" >>/home/kingdon/cvsroot/CVSROOT/taglog
  4750. @end example
  4751. @node annotate
  4752. @section Annotate command
  4753. @cindex annotate (subcommand)
  4754. @deffn Command {cvs annotate} [@code{-FflR}] [@code{-r rev}|@code{-D date}] files @dots{}
  4755. For each file in @var{files}, print the head revision
  4756. of the trunk, together with information on the last
  4757. modification for each line. For example:
  4758. @example
  4759. $ cvs annotate ssfile
  4760. Annotations for ssfile
  4761. ***************
  4762. 1.1 (mary 27-Mar-96): ssfile line 1
  4763. 1.2 (joe 28-Mar-96): ssfile line 2
  4764. @end example
  4765. The file @file{ssfile} currently contains two lines.
  4766. The @code{ssfile line 1} line was checked in by
  4767. @code{mary} on March 27. Then, on March 28, @code{joe}
  4768. added a line @code{ssfile line 2}, without modifying
  4769. the @code{ssfile line 1} line. This report doesn't
  4770. tell you anything about lines which have been deleted
  4771. or replaced; you need to use @code{cvs diff} for that
  4772. (@pxref{diff}).
  4773. @end deffn
  4774. The options to @code{cvs annotate} are listed in
  4775. @ref{Invoking CVS}, and can be used to select the files
  4776. and revisions to annotate. The options are described
  4777. in more detail there and in @ref{Common options}.
  4778. @c FIXME: maybe an example using the options? Just
  4779. @c what it means to select a revision might be worth a
  4780. @c few words of explanation ("you want to see who
  4781. @c changed this line *before* 1.4"...).
  4782. @c ---------------------------------------------------------------------
  4783. @node Binary files
  4784. @chapter Handling binary files
  4785. @cindex Binary files
  4786. The most common use for @sc{cvs} is to store text
  4787. files. With text files, @sc{cvs} can merge revisions,
  4788. display the differences between revisions in a
  4789. human-visible fashion, and other such operations.
  4790. However, if you are willing to give up a few of these
  4791. abilities, @sc{cvs} can store binary files. For
  4792. example, one might store a web site in @sc{cvs}
  4793. including both text files and binary images.
  4794. @menu
  4795. * Binary why:: More details on issues with binary files
  4796. * Binary howto:: How to store them
  4797. @end menu
  4798. @node Binary why
  4799. @section The issues with binary files
  4800. While the need to manage binary files may seem obvious
  4801. if the files that you customarily work with are binary,
  4802. putting them into version control does present some
  4803. additional issues.
  4804. One basic function of version control is to show the
  4805. differences between two revisions. For example, if
  4806. someone else checked in a new version of a file, you
  4807. may wish to look at what they changed and determine
  4808. whether their changes are good. For text files,
  4809. @sc{cvs} provides this functionality via the @code{cvs
  4810. diff} command. For binary files, it may be possible to
  4811. extract the two revisions and then compare them with a
  4812. tool external to @sc{cvs} (for example, word processing
  4813. software often has such a feature). If there is no
  4814. such tool, one must track changes via other mechanisms,
  4815. such as urging people to write good log messages, and
  4816. hoping that the changes they actually made were the
  4817. changes that they intended to make.
  4818. Another ability of a version control system is the
  4819. ability to merge two revisions. For @sc{cvs} this
  4820. happens in two contexts. The first is when users make
  4821. changes in separate working directories
  4822. (@pxref{Multiple developers}). The second is when one
  4823. merges explicitly with the @samp{update -j} command
  4824. (@pxref{Branching and merging}).
  4825. In the case of text
  4826. files, @sc{cvs} can merge changes made independently,
  4827. and signal a conflict if the changes conflict. With
  4828. binary files, the best that @sc{cvs} can do is present
  4829. the two different copies of the file, and leave it to
  4830. the user to resolve the conflict. The user may choose
  4831. one copy or the other, or may run an external merge
  4832. tool which knows about that particular file format, if
  4833. one exists.
  4834. Note that having the user merge relies primarily on the
  4835. user to not accidentally omit some changes, and thus is
  4836. potentially error prone.
  4837. If this process is thought to be undesirable, the best
  4838. choice may be to avoid merging. To avoid the merges
  4839. that result from separate working directories, see the
  4840. discussion of reserved checkouts (file locking) in
  4841. @ref{Multiple developers}. To avoid the merges
  4842. resulting from branches, restrict use of branches.
  4843. @node Binary howto
  4844. @section How to store binary files
  4845. There are two issues with using @sc{cvs} to store
  4846. binary files. The first is that @sc{cvs} by default
  4847. converts line endings between the canonical form in
  4848. which they are stored in the repository (linefeed
  4849. only), and the form appropriate to the operating system
  4850. in use on the client (for example, carriage return
  4851. followed by line feed for Windows NT).
  4852. The second is that a binary file might happen to
  4853. contain data which looks like a keyword (@pxref{Keyword
  4854. substitution}), so keyword expansion must be turned
  4855. off.
  4856. @c FIXME: the third is that one can't do merges with
  4857. @c binary files. xref to Multiple Developers and the
  4858. @c reserved checkout issues.
  4859. The @samp{-kb} option available with some @sc{cvs}
  4860. commands insures that neither line ending conversion
  4861. nor keyword expansion will be done.
  4862. Here is an example of how you can create a new file
  4863. using the @samp{-kb} flag:
  4864. @example
  4865. $ echo '$@splitrcskeyword{}Id$' > kotest
  4866. $ cvs add -kb -m"A test file" kotest
  4867. $ cvs ci -m"First checkin; contains a keyword" kotest
  4868. @end example
  4869. If a file accidentally gets added without @samp{-kb},
  4870. one can use the @code{cvs admin} command to recover.
  4871. For example:
  4872. @example
  4873. $ echo '$@splitrcskeyword{}Id$' > kotest
  4874. $ cvs add -m"A test file" kotest
  4875. $ cvs ci -m"First checkin; contains a keyword" kotest
  4876. $ cvs admin -kb kotest
  4877. $ cvs update -A kotest
  4878. # @r{For non-unix systems:}
  4879. # @r{Copy in a good copy of the file from outside CVS}
  4880. $ cvs commit -m "make it binary" kotest
  4881. @end example
  4882. @c Trying to describe this for both unix and non-unix
  4883. @c in the same description is very confusing. Might
  4884. @c want to split the two, or just ditch the unix "shortcut"
  4885. @c (unixheads don't do much with binary files, anyway).
  4886. @c This used to say "(Try the above example, and do a
  4887. @c @code{cat kotest} after every command)". But that
  4888. @c only really makes sense for the unix case.
  4889. When you check in the file @file{kotest} the file is
  4890. not preserved as a binary file, because you did not
  4891. check it in as a binary file. The @code{cvs
  4892. admin -kb} command sets the default keyword
  4893. substitution method for this file, but it does not
  4894. alter the working copy of the file that you have. If you need to
  4895. cope with line endings (that is, you are using
  4896. @sc{cvs} on a non-unix system), then you need to
  4897. check in a new copy of the file, as shown by the
  4898. @code{cvs commit} command above.
  4899. On unix, the @code{cvs update -A} command suffices.
  4900. @c FIXME: should also describe what the *other users*
  4901. @c need to do, if they have checked out copies which
  4902. @c have been corrupted by lack of -kb. I think maybe
  4903. @c "cvs update -kb" or "cvs
  4904. @c update -A" would suffice, although the user who
  4905. @c reported this suggested removing the file, manually
  4906. @c removing it from CVS/Entries, and then "cvs update"
  4907. (Note that you can use @code{cvs log} to determine the default keyword
  4908. substitution method for a file and @code{cvs status} to determine
  4909. the keyword substitution method for a working copy.)
  4910. However, in using @code{cvs admin -k} to change the
  4911. keyword expansion, be aware that the keyword expansion
  4912. mode is not version controlled. This means that, for
  4913. example, that if you have a text file in old releases,
  4914. and a binary file with the same name in new releases,
  4915. @sc{cvs} provides no way to check out the file in text
  4916. or binary mode depending on what version you are
  4917. checking out. There is no good workaround for this
  4918. problem.
  4919. You can also set a default for whether @code{cvs add}
  4920. and @code{cvs import} treat a file as binary based on
  4921. its name; for example you could say that files who
  4922. names end in @samp{.exe} are binary. @xref{Wrappers}.
  4923. There is currently no way to have @sc{cvs} detect
  4924. whether a file is binary based on its contents. The
  4925. main difficulty with designing such a feature is that
  4926. it is not clear how to distinguish between binary and
  4927. non-binary files, and the rules to apply would vary
  4928. considerably with the operating system.
  4929. @c For example, it would be good on MS-DOS-family OSes
  4930. @c for anything containing ^Z to be binary. Having
  4931. @c characters with the 8th bit set imply binary is almost
  4932. @c surely a bad idea in the context of ISO-8859-* and
  4933. @c other such character sets. On VMS or the Mac, we
  4934. @c could use the OS's file typing. This is a
  4935. @c commonly-desired feature, and something of this sort
  4936. @c may make sense. But there are a lot of pitfalls here.
  4937. @c
  4938. @c Another, probably better, way to tell is to read the
  4939. @c file in text mode, write it to a temp file in text
  4940. @c mode, and then do a binary mode compare of the two
  4941. @c files. If they differ, it is a binary file. This
  4942. @c might have problems on VMS (or some other system
  4943. @c with several different text modes), but in general
  4944. @c should be relatively portable. The only other
  4945. @c downside I can think of is that it would be fairly
  4946. @c slow, but that is perhaps a small price to pay for
  4947. @c not having your files corrupted. Another issue is
  4948. @c what happens if you import a text file with bare
  4949. @c linefeeds on Windows. Such files will show up on
  4950. @c Windows sometimes (I think some native windows
  4951. @c programs even write them, on occasion). Perhaps it
  4952. @c is reasonable to treat such files as binary; after
  4953. @c all it is something of a presumption to assume that
  4954. @c the user would want the linefeeds converted to CRLF.
  4955. @c ---------------------------------------------------------------------
  4956. @node Multiple developers
  4957. @chapter Multiple developers
  4958. @cindex Multiple developers
  4959. @cindex Team of developers
  4960. @cindex File locking
  4961. @cindex Locking files
  4962. @cindex Working copy
  4963. @cindex Reserved checkouts
  4964. @cindex Unreserved checkouts
  4965. @cindex RCS-style locking
  4966. When more than one person works on a software project
  4967. things often get complicated. Often, two people try to
  4968. edit the same file simultaneously. One solution, known
  4969. as @dfn{file locking} or @dfn{reserved checkouts}, is
  4970. to allow only one person to edit each file at a time.
  4971. This is the only solution with some version control
  4972. systems, including @sc{rcs} and @sc{sccs}. Currently
  4973. the usual way to get reserved checkouts with @sc{cvs}
  4974. is the @code{cvs admin -l} command (@pxref{admin
  4975. options}). This is not as nicely integrated into
  4976. @sc{cvs} as the watch features, described below, but it
  4977. seems that most people with a need for reserved
  4978. checkouts find it adequate.
  4979. @c Or "find it better than worrying about implementing
  4980. @c nicely integrated reserved checkouts" or ...?
  4981. It also may be possible to use the watches
  4982. features described below, together with suitable
  4983. procedures (not enforced by software), to avoid having
  4984. two people edit at the same time.
  4985. @c Our unreserved checkout model might not
  4986. @c be quite the same as others. For example, I
  4987. @c think that some systems will tend to create a branch
  4988. @c in the case where CVS prints "up-to-date check failed".
  4989. @c It isn't clear to me whether we should try to
  4990. @c explore these subtleties; it could easily just
  4991. @c confuse people.
  4992. The default model with @sc{cvs} is known as
  4993. @dfn{unreserved checkouts}. In this model, developers
  4994. can edit their own @dfn{working copy} of a file
  4995. simultaneously. The first person that commits his
  4996. changes has no automatic way of knowing that another
  4997. has started to edit it. Others will get an error
  4998. message when they try to commit the file. They must
  4999. then use @sc{cvs} commands to bring their working copy
  5000. up to date with the repository revision. This process
  5001. is almost automatic.
  5002. @c FIXME? should probably use the word "watch" here, to
  5003. @c tie this into the text below and above.
  5004. @sc{cvs} also supports mechanisms which facilitate
  5005. various kinds of communication, without actually
  5006. enforcing rules like reserved checkouts do.
  5007. The rest of this chapter describes how these various
  5008. models work, and some of the issues involved in
  5009. choosing between them.
  5010. @ignore
  5011. Here is a draft reserved checkout design or discussion
  5012. of the issues. This seems like as good a place as any
  5013. for this.
  5014. Might want a cvs lock/cvs unlock--in which the names
  5015. differ from edit/unedit because the network must be up
  5016. for these to work. unedit gives an error if there is a
  5017. reserved checkout in place (so that people don't
  5018. accidentally leave locks around); unlock gives an error
  5019. if one is not in place (this is more arguable; perhaps
  5020. it should act like unedit in that case).
  5021. On the other hand, might want it so that emacs,
  5022. scripts, etc., can get ready to edit a file without
  5023. having to know which model is in use. In that case we
  5024. would have a "cvs watch lock" (or .cvsrc?) (that is,
  5025. three settings, "on", "off", and "lock"). Having cvs
  5026. watch lock set would cause a get to record in the CVS
  5027. directory which model is in use, and cause "cvs edit"
  5028. to change behaviors. We'd want a way to query which
  5029. setting is in effect (this would be handy even if it is
  5030. only "on" or "off" as presently). If lock is in
  5031. effect, then commit would require a lock before
  5032. allowing a checkin; chmod wouldn't suffice (might be
  5033. debatable--see chmod comment below, in watches--but it
  5034. is the way people expect RCS to work and I can't think
  5035. of any significant downside. On the other hand, maybe
  5036. it isn't worth bothering, because people who are used
  5037. to RCS wouldn't think to use chmod anyway).
  5038. Implementation: use file attributes or use RCS
  5039. locking. The former avoids more dependence on RCS
  5040. behaviors we will need to reimplement as we librarify
  5041. RCS, and makes it easier to import/export RCS files (in
  5042. that context, want to ignore the locker field). But
  5043. note that RCS locks are per-branch, which is the
  5044. correct behavior (this is also an issue for the "watch
  5045. on" features; they should be per-branch too).
  5046. Here are a few more random notes about implementation
  5047. details, assuming "cvs watch lock" and
  5048. CVS/Watched file? Or try to fit this into CVS/Entries somehow?
  5049. Cases: (1) file is checked out (unreserved or with watch on) by old
  5050. version of @sc{cvs}, now we do something with new one, (2) file is checked
  5051. out by new version, now we do something with old one.
  5052. Remote protocol would have a "Watched" analogous to "Mode". Of course
  5053. it would apply to all Updated-like requests. How do we keep this
  5054. setting up to date? I guess that there wants to be a Watched request,
  5055. and the server would send a new one if it isn't up to date? (Ugh--hard
  5056. to implement and slows down "cvs -q update"--is there an easier way?)
  5057. "cvs edit"--checks CVS/Watched, and if watch lock, then sends
  5058. "edit-lock" request. Which comes back with a Checked-in with
  5059. appropriate Watched (off, on, lock, locked, or some such?), or error
  5060. message if already locked.
  5061. "cvs commit"--only will commit if off/on/locked. lock is not OK.
  5062. Doc:
  5063. note that "cvs edit" must be connected to network if watch lock is in
  5064. effect.
  5065. Talk about what to do if someone has locked a file and you want to
  5066. edit that file. (breaking locks, or lack thereof).
  5067. One other idea (which could work along with the
  5068. existing "cvs admin -l" reserved checkouts, as well as
  5069. the above):
  5070. "cvs editors" could show who has the file locked, if
  5071. someone does.
  5072. @end ignore
  5073. @menu
  5074. * File status:: A file can be in several states
  5075. * Updating a file:: Bringing a file up-to-date
  5076. * Conflicts example:: An informative example
  5077. * Informing others:: To cooperate you must inform
  5078. * Concurrency:: Simultaneous repository access
  5079. * Watches:: Mechanisms to track who is editing files
  5080. * Choosing a model:: Reserved or unreserved checkouts?
  5081. @end menu
  5082. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5083. @node File status
  5084. @section File status
  5085. @cindex File status
  5086. @cindex Status of a file
  5087. @c Shouldn't this start with an example or something,
  5088. @c introducing the unreserved checkout model? Before we
  5089. @c dive into listing states?
  5090. Based on what operations you have performed on a
  5091. checked out file, and what operations others have
  5092. performed to that file in the repository, one can
  5093. classify a file in a number of states. The states, as
  5094. reported by the @code{status} command, are:
  5095. @c The order of items is chosen to group logically
  5096. @c similar outputs together.
  5097. @c People who want alphabetical can use the index...
  5098. @table @asis
  5099. @cindex Up-to-date
  5100. @item Up-to-date
  5101. The file is identical with the latest revision in the
  5102. repository for the branch in use.
  5103. @c FIXME: should we clarify "in use"? The answer is
  5104. @c sticky tags, and trying to distinguish branch sticky
  5105. @c tags from non-branch sticky tags seems rather awkward
  5106. @c here.
  5107. @c FIXME: What happens with non-branch sticky tags? Is
  5108. @c a stuck file "Up-to-date" or "Needs checkout" or what?
  5109. @item Locally Modified
  5110. @cindex Locally Modified
  5111. You have edited the file, and not yet committed your changes.
  5112. @item Locally Added
  5113. @cindex Locally Added
  5114. You have added the file with @code{add}, and not yet
  5115. committed your changes.
  5116. @c There are many cases involving the file being
  5117. @c added/removed/modified in the working directory, and
  5118. @c added/removed/modified in the repository, which we
  5119. @c don't try to describe here. I'm not sure that "cvs
  5120. @c status" produces a non-confusing output in most of
  5121. @c those cases.
  5122. @item Locally Removed
  5123. @cindex Locally Removed
  5124. You have removed the file with @code{remove}, and not yet
  5125. committed your changes.
  5126. @item Needs Checkout
  5127. @cindex Needs Checkout
  5128. Someone else has committed a newer revision to the
  5129. repository. The name is slightly misleading; you will
  5130. ordinarily use @code{update} rather than
  5131. @code{checkout} to get that newer revision.
  5132. @item Needs Patch
  5133. @cindex Needs Patch
  5134. @c See also newb-123j0 in sanity.sh (although that case
  5135. @c should probably be changed rather than documented).
  5136. Like Needs Checkout, but the @sc{cvs} server will send
  5137. a patch rather than the entire file. Sending a patch or
  5138. sending an entire file accomplishes the same thing.
  5139. @item Needs Merge
  5140. @cindex Needs Merge
  5141. Someone else has committed a newer revision to the repository, and you
  5142. have also made modifications to the file.
  5143. @item Unresolved Conflict
  5144. @cindex Unresolved Conflict
  5145. @c FIXCVS - This file status needs to be changed to some more informative
  5146. @c text that distinguishes it more clearly from each of the Locally Added,
  5147. @c File had conflicts on merge, and Unknown status types, but an exact and
  5148. @c succinct wording escapes me at the moment.
  5149. A file with the same name as this new file has been added to the repository
  5150. from a second workspace. This file will need to be moved out of the way
  5151. to allow an @code{update} to complete.
  5152. @item File had conflicts on merge
  5153. @cindex File had conflicts on merge
  5154. @c is it worth saying that this message was "Unresolved
  5155. @c Conflict" in CVS 1.9 and earlier? I'm inclined to
  5156. @c think that is unnecessarily confusing to new users.
  5157. This is like Locally Modified, except that a previous
  5158. @code{update} command gave a conflict. If you have not
  5159. already done so, you need to
  5160. resolve the conflict as described in @ref{Conflicts example}.
  5161. @item Unknown
  5162. @cindex Unknown
  5163. @sc{cvs} doesn't know anything about this file. For
  5164. example, you have created a new file and have not run
  5165. @code{add}.
  5166. @c
  5167. @c "Entry Invalid" and "Classify Error" are also in the
  5168. @c status.c. The latter definitely indicates a CVS bug
  5169. @c (should it be worded more like "internal error" so
  5170. @c people submit bug reports if they see it?). The former
  5171. @c I'm not as sure; I haven't tracked down whether/when it
  5172. @c appears in "cvs status" output.
  5173. @end table
  5174. To help clarify the file status, @code{status} also
  5175. reports the @code{Working revision} which is the
  5176. revision that the file in the working directory derives
  5177. from, and the @code{Repository revision} which is the
  5178. latest revision in the repository for the branch in
  5179. use.
  5180. @c FIXME: should we clarify "in use"? The answer is
  5181. @c sticky tags, and trying to distinguish branch sticky
  5182. @c tags from non-branch sticky tags seems rather awkward
  5183. @c here.
  5184. @c FIXME: What happens with non-branch sticky tags?
  5185. @c What is the Repository Revision there? See the
  5186. @c comment at vn_rcs in cvs.h, which is kind of
  5187. @c confused--we really need to document better what this
  5188. @c field contains.
  5189. @c Q: Should we document "New file!" and other such
  5190. @c outputs or are they self-explanatory?
  5191. @c FIXME: what about the date to the right of "Working
  5192. @c revision"? It doesn't appear with client/server and
  5193. @c seems unnecessary (redundant with "ls -l") so
  5194. @c perhaps it should be removed for non-client/server too?
  5195. @c FIXME: Need some examples.
  5196. @c FIXME: Working revision can also be something like
  5197. @c "-1.3" for a locally removed file. Not at all
  5198. @c self-explanatory (and it is possible that CVS should
  5199. @c be changed rather than documenting this).
  5200. @c Would be nice to have an @example showing output
  5201. @c from cvs status, with comments showing the xref
  5202. @c where each part of the output is described. This
  5203. @c might fit in nicely if it is desirable to split this
  5204. @c node in two; one to introduce "cvs status" and one
  5205. @c to list each of the states.
  5206. The options to @code{status} are listed in
  5207. @ref{Invoking CVS}. For information on its @code{Sticky tag}
  5208. and @code{Sticky date} output, see @ref{Sticky tags}.
  5209. For information on its @code{Sticky options} output,
  5210. see the @samp{-k} option in @ref{update options}.
  5211. You can think of the @code{status} and @code{update}
  5212. commands as somewhat complementary. You use
  5213. @code{update} to bring your files up to date, and you
  5214. can use @code{status} to give you some idea of what an
  5215. @code{update} would do (of course, the state of the
  5216. repository might change before you actually run
  5217. @code{update}). In fact, if you want a command to
  5218. display file status in a more brief format than is
  5219. displayed by the @code{status} command, you can invoke
  5220. @cindex update, to display file status
  5221. @example
  5222. $ cvs -n -q update
  5223. @end example
  5224. The @samp{-n} option means to not actually do the
  5225. update, but merely to display statuses; the @samp{-q}
  5226. option avoids printing the name of each directory. For
  5227. more information on the @code{update} command, and
  5228. these options, see @ref{Invoking CVS}.
  5229. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5230. @node Updating a file
  5231. @section Bringing a file up to date
  5232. @cindex Bringing a file up to date
  5233. @cindex Updating a file
  5234. @cindex Merging a file
  5235. @cindex Update, introduction
  5236. When you want to update or merge a file, use the @code{update}
  5237. command. For files that are not up to date this is roughly equivalent
  5238. to a @code{checkout} command: the newest revision of the file is
  5239. extracted from the repository and put in your working directory.
  5240. Your modifications to a file are never lost when you
  5241. use @code{update}. If no newer revision exists,
  5242. running @code{update} has no effect. If you have
  5243. edited the file, and a newer revision is available,
  5244. @sc{cvs} will merge all changes into your working copy.
  5245. For instance, imagine that you checked out revision 1.4 and started
  5246. editing it. In the meantime someone else committed revision 1.5, and
  5247. shortly after that revision 1.6. If you run @code{update} on the file
  5248. now, @sc{cvs} will incorporate all changes between revision 1.4 and 1.6 into
  5249. your file.
  5250. @cindex Overlap
  5251. If any of the changes between 1.4 and 1.6 were made too
  5252. close to any of the changes you have made, an
  5253. @dfn{overlap} occurs. In such cases a warning is
  5254. printed, and the resulting file includes both
  5255. versions of the lines that overlap, delimited by
  5256. special markers.
  5257. @xref{update}, for a complete description of the
  5258. @code{update} command.
  5259. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5260. @node Conflicts example
  5261. @section Conflicts example
  5262. @cindex Merge, an example
  5263. @cindex Example of merge
  5264. @cindex driver.c (merge example)
  5265. Suppose revision 1.4 of @file{driver.c} contains this:
  5266. @example
  5267. #include <stdio.h>
  5268. void main()
  5269. @{
  5270. parse();
  5271. if (nerr == 0)
  5272. gencode();
  5273. else
  5274. fprintf(stderr, "No code generated.\n");
  5275. exit(nerr == 0 ? 0 : 1);
  5276. @}
  5277. @end example
  5278. @noindent
  5279. Revision 1.6 of @file{driver.c} contains this:
  5280. @example
  5281. #include <stdio.h>
  5282. int main(int argc,
  5283. char **argv)
  5284. @{
  5285. parse();
  5286. if (argc != 1)
  5287. @{
  5288. fprintf(stderr, "tc: No args expected.\n");
  5289. exit(1);
  5290. @}
  5291. if (nerr == 0)
  5292. gencode();
  5293. else
  5294. fprintf(stderr, "No code generated.\n");
  5295. exit(!!nerr);
  5296. @}
  5297. @end example
  5298. @noindent
  5299. Your working copy of @file{driver.c}, based on revision
  5300. 1.4, contains this before you run @samp{cvs update}:
  5301. @c -- Really include "cvs"?
  5302. @example
  5303. #include <stdlib.h>
  5304. #include <stdio.h>
  5305. void main()
  5306. @{
  5307. init_scanner();
  5308. parse();
  5309. if (nerr == 0)
  5310. gencode();
  5311. else
  5312. fprintf(stderr, "No code generated.\n");
  5313. exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
  5314. @}
  5315. @end example
  5316. @noindent
  5317. You run @samp{cvs update}:
  5318. @c -- Really include "cvs"?
  5319. @example
  5320. $ cvs update driver.c
  5321. RCS file: /usr/local/cvsroot/yoyodyne/tc/driver.c,v
  5322. retrieving revision 1.4
  5323. retrieving revision 1.6
  5324. Merging differences between 1.4 and 1.6 into driver.c
  5325. rcsmerge warning: overlaps during merge
  5326. cvs update: conflicts found in driver.c
  5327. C driver.c
  5328. @end example
  5329. @noindent
  5330. @cindex Conflicts (merge example)
  5331. @sc{cvs} tells you that there were some conflicts.
  5332. Your original working file is saved unmodified in
  5333. @file{.#driver.c.1.4}. The new version of
  5334. @file{driver.c} contains this:
  5335. @example
  5336. #include <stdlib.h>
  5337. #include <stdio.h>
  5338. int main(int argc,
  5339. char **argv)
  5340. @{
  5341. init_scanner();
  5342. parse();
  5343. if (argc != 1)
  5344. @{
  5345. fprintf(stderr, "tc: No args expected.\n");
  5346. exit(1);
  5347. @}
  5348. if (nerr == 0)
  5349. gencode();
  5350. else
  5351. fprintf(stderr, "No code generated.\n");
  5352. @asis{}<<<<<<< driver.c
  5353. exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
  5354. @asis{}=======
  5355. exit(!!nerr);
  5356. @asis{}>>>>>>> 1.6
  5357. @}
  5358. @end example
  5359. @noindent
  5360. @cindex Markers, conflict
  5361. @cindex Conflict markers
  5362. @cindex <<<<<<<
  5363. @cindex >>>>>>>
  5364. @cindex =======
  5365. Note how all non-overlapping modifications are incorporated in your working
  5366. copy, and that the overlapping section is clearly marked with
  5367. @samp{<<<<<<<}, @samp{=======} and @samp{>>>>>>>}.
  5368. @cindex Resolving a conflict
  5369. @cindex Conflict resolution
  5370. You resolve the conflict by editing the file, removing the markers and
  5371. the erroneous line. Suppose you end up with this file:
  5372. @c -- Add xref to the pcl-cvs manual when it talks
  5373. @c -- about this.
  5374. @example
  5375. #include <stdlib.h>
  5376. #include <stdio.h>
  5377. int main(int argc,
  5378. char **argv)
  5379. @{
  5380. init_scanner();
  5381. parse();
  5382. if (argc != 1)
  5383. @{
  5384. fprintf(stderr, "tc: No args expected.\n");
  5385. exit(1);
  5386. @}
  5387. if (nerr == 0)
  5388. gencode();
  5389. else
  5390. fprintf(stderr, "No code generated.\n");
  5391. exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
  5392. @}
  5393. @end example
  5394. @noindent
  5395. You can now go ahead and commit this as revision 1.7.
  5396. @example
  5397. $ cvs commit -m "Initialize scanner. Use symbolic exit values." driver.c
  5398. Checking in driver.c;
  5399. /usr/local/cvsroot/yoyodyne/tc/driver.c,v <-- driver.c
  5400. new revision: 1.7; previous revision: 1.6
  5401. done
  5402. @end example
  5403. For your protection, @sc{cvs} will refuse to check in a
  5404. file if a conflict occurred and you have not resolved
  5405. the conflict. Currently to resolve a conflict, you
  5406. must change the timestamp on the file. In previous
  5407. versions of @sc{cvs}, you also needed to
  5408. insure that the file contains no conflict markers.
  5409. Because
  5410. your file may legitimately contain conflict markers (that
  5411. is, occurrences of @samp{>>>>>>> } at the start of a
  5412. line that don't mark a conflict), the current
  5413. version of @sc{cvs} will print a warning and proceed to
  5414. check in the file.
  5415. @c The old behavior was really icky; the only way out
  5416. @c was to start hacking on
  5417. @c the @code{CVS/Entries} file or other such workarounds.
  5418. @c
  5419. @c If the timestamp thing isn't considered nice enough,
  5420. @c maybe there should be a "cvs resolved" command
  5421. @c which clears the conflict indication. For a nice user
  5422. @c interface, this should be invoked by an interactive
  5423. @c merge tool like emerge rather than by the user
  5424. @c directly--such a tool can verify that the user has
  5425. @c really dealt with each conflict.
  5426. @cindex emerge
  5427. If you use release 1.04 or later of pcl-cvs (a @sc{gnu}
  5428. Emacs front-end for @sc{cvs}) you can use an Emacs
  5429. package called emerge to help you resolve conflicts.
  5430. See the documentation for pcl-cvs.
  5431. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5432. @node Informing others
  5433. @section Informing others about commits
  5434. @cindex Informing others
  5435. @cindex Spreading information
  5436. @cindex Mail, automatic mail on commit
  5437. It is often useful to inform others when you commit a
  5438. new revision of a file. The @samp{-i} option of the
  5439. @file{modules} file, or the @file{loginfo} file, can be
  5440. used to automate this process. @xref{modules}.
  5441. @xref{loginfo}. You can use these features of @sc{cvs}
  5442. to, for instance, instruct @sc{cvs} to mail a
  5443. message to all developers, or post a message to a local
  5444. newsgroup.
  5445. @c -- More text would be nice here.
  5446. @node Concurrency
  5447. @section Several developers simultaneously attempting to run CVS
  5448. @cindex Locks, cvs, introduction
  5449. @c For a discussion of *why* CVS creates locks, see
  5450. @c the comment at the start of src/lock.c
  5451. If several developers try to run @sc{cvs} at the same
  5452. time, one may get the following message:
  5453. @example
  5454. [11:43:23] waiting for bach's lock in /usr/local/cvsroot/foo
  5455. @end example
  5456. @cindex #cvs.rfl, removing
  5457. @cindex #cvs.wfl, removing
  5458. @cindex #cvs.lock, removing
  5459. @sc{cvs} will try again every 30 seconds, and either
  5460. continue with the operation or print the message again,
  5461. if it still needs to wait. If a lock seems to stick
  5462. around for an undue amount of time, find the person
  5463. holding the lock and ask them about the cvs command
  5464. they are running. If they aren't running a cvs
  5465. command, look in the repository directory mentioned in
  5466. the message and remove files which they own whose names
  5467. start with @file{#cvs.rfl},
  5468. @file{#cvs.wfl}, or @file{#cvs.lock}.
  5469. Note that these locks are to protect @sc{cvs}'s
  5470. internal data structures and have no relationship to
  5471. the word @dfn{lock} in the sense used by
  5472. @sc{rcs}---which refers to reserved checkouts
  5473. (@pxref{Multiple developers}).
  5474. Any number of people can be reading from a given
  5475. repository at a time; only when someone is writing do
  5476. the locks prevent other people from reading or writing.
  5477. @cindex Atomic transactions, lack of
  5478. @cindex Transactions, atomic, lack of
  5479. @c the following talks about what one might call commit/update
  5480. @c atomicity.
  5481. @c Probably also should say something about
  5482. @c commit/commit atomicity, that is, "An update will
  5483. @c not get partial versions of more than one commit".
  5484. @c CVS currently has this property and I guess we can
  5485. @c make it a documented feature.
  5486. @c For example one person commits
  5487. @c a/one.c and b/four.c and another commits a/two.c and
  5488. @c b/three.c. Then an update cannot get the new a/one.c
  5489. @c and a/two.c and the old b/four.c and b/three.c.
  5490. One might hope for the following property:
  5491. @quotation
  5492. If someone commits some changes in one cvs command,
  5493. then an update by someone else will either get all the
  5494. changes, or none of them.
  5495. @end quotation
  5496. @noindent
  5497. but @sc{cvs} does @emph{not} have this property. For
  5498. example, given the files
  5499. @example
  5500. a/one.c
  5501. a/two.c
  5502. b/three.c
  5503. b/four.c
  5504. @end example
  5505. @noindent
  5506. if someone runs
  5507. @example
  5508. cvs ci a/two.c b/three.c
  5509. @end example
  5510. @noindent
  5511. and someone else runs @code{cvs update} at the same
  5512. time, the person running @code{update} might get only
  5513. the change to @file{b/three.c} and not the change to
  5514. @file{a/two.c}.
  5515. @node Watches
  5516. @section Mechanisms to track who is editing files
  5517. @cindex Watches
  5518. For many groups, use of @sc{cvs} in its default mode is
  5519. perfectly satisfactory. Users may sometimes go to
  5520. check in a modification only to find that another
  5521. modification has intervened, but they deal with it and
  5522. proceed with their check in. Other groups prefer to be
  5523. able to know who is editing what files, so that if two
  5524. people try to edit the same file they can choose to
  5525. talk about who is doing what when rather than be
  5526. surprised at check in time. The features in this
  5527. section allow such coordination, while retaining the
  5528. ability of two developers to edit the same file at the
  5529. same time.
  5530. @c Some people might ask why CVS does not enforce the
  5531. @c rule on chmod, by requiring a cvs edit before a cvs
  5532. @c commit. The main reason is that it could always be
  5533. @c circumvented--one could edit the file, and
  5534. @c then when ready to check it in, do the cvs edit and put
  5535. @c in the new contents and do the cvs commit. One
  5536. @c implementation note: if we _do_ want to have cvs commit
  5537. @c require a cvs edit, we should store the state on
  5538. @c whether the cvs edit has occurred in the working
  5539. @c directory, rather than having the server try to keep
  5540. @c track of what working directories exist.
  5541. @c FIXME: should the above discussion be part of the
  5542. @c manual proper, somewhere, not just in a comment?
  5543. For maximum benefit developers should use @code{cvs
  5544. edit} (not @code{chmod}) to make files read-write to
  5545. edit them, and @code{cvs release} (not @code{rm}) to
  5546. discard a working directory which is no longer in use,
  5547. but @sc{cvs} is not able to enforce this behavior.
  5548. @c I'm a little dissatisfied with this presentation,
  5549. @c because "watch on"/"edit"/"editors" are one set of
  5550. @c functionality, and "watch add"/"watchers" is another
  5551. @c which is somewhat orthogonal even though they interact in
  5552. @c various ways. But I think it might be
  5553. @c confusing to describe them separately (e.g. "watch
  5554. @c add" with loginfo). I don't know.
  5555. @menu
  5556. * Setting a watch:: Telling CVS to watch certain files
  5557. * Getting Notified:: Telling CVS to notify you
  5558. * Editing files:: How to edit a file which is being watched
  5559. * Watch information:: Information about who is watching and editing
  5560. * Watches Compatibility:: Watches interact poorly with CVS 1.6 or earlier
  5561. @end menu
  5562. @node Setting a watch
  5563. @subsection Telling CVS to watch certain files
  5564. To enable the watch features, you first specify that
  5565. certain files are to be watched.
  5566. @cindex watch on (subcommand)
  5567. @deffn Command {cvs watch on} [@code{-lR}] [@var{files}]@dots{}
  5568. @cindex Read-only files, and watches
  5569. Specify that developers should run @code{cvs edit}
  5570. before editing @var{files}. @sc{cvs} will create working
  5571. copies of @var{files} read-only, to remind developers
  5572. to run the @code{cvs edit} command before working on
  5573. them.
  5574. If @var{files} includes the name of a directory, @sc{cvs}
  5575. arranges to watch all files added to the corresponding
  5576. repository directory, and sets a default for files
  5577. added in the future; this allows the user to set
  5578. notification policies on a per-directory basis. The
  5579. contents of the directory are processed recursively,
  5580. unless the @code{-l} option is given.
  5581. The @code{-R} option can be used to force recursion if the @code{-l}
  5582. option is set in @file{~/.cvsrc} (@pxref{~/.cvsrc}).
  5583. If @var{files} is omitted, it defaults to the current directory.
  5584. @cindex watch off (subcommand)
  5585. @end deffn
  5586. @deffn Command {cvs watch off} [@code{-lR}] [@var{files}]@dots{}
  5587. Do not create @var{files} read-only on checkout; thus,
  5588. developers will not be reminded to use @code{cvs edit}
  5589. and @code{cvs unedit}.
  5590. @ignore
  5591. @sc{cvs} will check out @var{files}
  5592. read-write as usual, unless other permissions override
  5593. due to the @code{PreservePermissions} option being
  5594. enabled in the @file{config} administrative file
  5595. (@pxref{Special Files}, @pxref{config})
  5596. @end ignore
  5597. The @var{files} and options are processed as for @code{cvs
  5598. watch on}.
  5599. @end deffn
  5600. @node Getting Notified
  5601. @subsection Telling CVS to notify you
  5602. You can tell @sc{cvs} that you want to receive
  5603. notifications about various actions taken on a file.
  5604. You can do this without using @code{cvs watch on} for
  5605. the file, but generally you will want to use @code{cvs
  5606. watch on}, to remind developers to use the @code{cvs edit}
  5607. command.
  5608. @cindex watch add (subcommand)
  5609. @deffn Command {cvs watch add} [@code{-lR}] [@code{-a} @var{action}]@dots{} [@var{files}]@dots{}
  5610. Add the current user to the list of people to receive notification of
  5611. work done on @var{files}.
  5612. The @code{-a} option specifies what kinds of events @sc{cvs} should notify
  5613. the user about. @var{action} is one of the following:
  5614. @table @code
  5615. @item edit
  5616. Another user has applied the @code{cvs edit} command (described
  5617. below) to a watched file.
  5618. @item commit
  5619. Another user has committed changes to one of the named @var{files}.
  5620. @item unedit
  5621. Another user has abandoned editing a file (other than by committing changes).
  5622. They can do this in several ways, by:
  5623. @itemize @bullet
  5624. @item
  5625. applying the @code{cvs unedit} command (described below) to the file
  5626. @item
  5627. applying the @code{cvs release} command (@pxref{release}) to the file's parent directory
  5628. (or recursively to a directory more than one level up)
  5629. @item
  5630. deleting the file and allowing @code{cvs update} to recreate it
  5631. @end itemize
  5632. @item all
  5633. All of the above.
  5634. @item none
  5635. None of the above. (This is useful with @code{cvs edit},
  5636. described below.)
  5637. @end table
  5638. The @code{-a} option may appear more than once, or not at all. If
  5639. omitted, the action defaults to @code{all}.
  5640. The @var{files} and options are processed as for
  5641. @code{cvs watch on}.
  5642. @end deffn
  5643. @cindex watch remove (subcommand)
  5644. @deffn Command {cvs watch remove} [@code{-lR}] [@code{-a} @var{action}]@dots{} [@var{files}]@dots{}
  5645. Remove a notification request established using @code{cvs watch add};
  5646. the arguments are the same. If the @code{-a} option is present, only
  5647. watches for the specified actions are removed.
  5648. @end deffn
  5649. @cindex notify (admin file)
  5650. When the conditions exist for notification, @sc{cvs}
  5651. calls the @file{notify} administrative file. Edit
  5652. @file{notify} as one edits the other administrative
  5653. files (@pxref{Intro administrative files}). This
  5654. file follows the usual conventions for administrative
  5655. files (@pxref{syntax}), where each line is a regular
  5656. expression followed by a command to execute. The
  5657. command should contain a single occurrence of @samp{%s}
  5658. which will be replaced by the user to notify; the rest
  5659. of the information regarding the notification will be
  5660. supplied to the command on standard input. The
  5661. standard thing to put in the @code{notify} file is the
  5662. single line:
  5663. @example
  5664. ALL mail %s -s "CVS notification"
  5665. @end example
  5666. @noindent
  5667. This causes users to be notified by electronic mail.
  5668. @c FIXME: should it be this hard to set up this
  5669. @c behavior (and the result when one fails to do so,
  5670. @c silent failure to notify, so non-obvious)? Should
  5671. @c CVS give a warning if no line in notify matches (and
  5672. @c document the use of "DEFAULT :" for the case where
  5673. @c skipping the notification is indeed desired)?
  5674. @cindex users (admin file)
  5675. Note that if you set this up in the straightforward
  5676. way, users receive notifications on the server machine.
  5677. One could of course write a @file{notify} script which
  5678. directed notifications elsewhere, but to make this
  5679. easy, @sc{cvs} allows you to associate a notification
  5680. address for each user. To do so create a file
  5681. @file{users} in @file{CVSROOT} with a line for each
  5682. user in the format @var{user}:@var{value}. Then
  5683. instead of passing the name of the user to be notified
  5684. to @file{notify}, @sc{cvs} will pass the @var{value}
  5685. (normally an email address on some other machine).
  5686. @sc{cvs} does not notify you for your own changes.
  5687. Currently this check is done based on whether the user
  5688. name of the person taking the action which triggers
  5689. notification matches the user name of the person
  5690. getting notification. In fact, in general, the watches
  5691. features only track one edit by each user. It probably
  5692. would be more useful if watches tracked each working
  5693. directory separately, so this behavior might be worth
  5694. changing.
  5695. @c "behavior might be worth changing" is an effort to
  5696. @c point to future directions while also not promising
  5697. @c that "they" (as in "why don't they fix CVS to....")
  5698. @c will do this.
  5699. @c one implementation issue is identifying whether a
  5700. @c working directory is same or different. Comparing
  5701. @c pathnames/hostnames is hopeless, but having the server
  5702. @c supply a serial number which the client stores in the
  5703. @c CVS directory as a magic cookie should work.
  5704. @node Editing files
  5705. @subsection How to edit a file which is being watched
  5706. @cindex Checkout, as term for getting ready to edit
  5707. Since a file which is being watched is checked out
  5708. read-only, you cannot simply edit it. To make it
  5709. read-write, and inform others that you are planning to
  5710. edit it, use the @code{cvs edit} command. Some systems
  5711. call this a @dfn{checkout}, but @sc{cvs} uses that term
  5712. for obtaining a copy of the sources (@pxref{Getting the
  5713. source}), an operation which those systems call a
  5714. @dfn{get} or a @dfn{fetch}.
  5715. @c Issue to think about: should we transition CVS
  5716. @c towards the "get" terminology? "cvs get" is already a
  5717. @c synonym for "cvs checkout" and that section of the
  5718. @c manual refers to "Getting the source". If this is
  5719. @c done, needs to be done gingerly (for example, we should
  5720. @c still accept "checkout" in .cvsrc files indefinitely
  5721. @c even if the CVS's messages are changed from "cvs checkout: "
  5722. @c to "cvs get: ").
  5723. @c There is a concern about whether "get" is not as
  5724. @c good for novices because it is a more general term
  5725. @c than "checkout" (and thus arguably harder to assign
  5726. @c a technical meaning for).
  5727. @cindex edit (subcommand)
  5728. @deffn Command {cvs edit} [@code{-lR}] [@code{-a} @var{action}]@dots{} [@var{files}]@dots{}
  5729. Prepare to edit the working files @var{files}. @sc{cvs} makes the
  5730. @var{files} read-write, and notifies users who have requested
  5731. @code{edit} notification for any of @var{files}.
  5732. The @code{cvs edit} command accepts the same options as the
  5733. @code{cvs watch add} command, and establishes a temporary watch for the
  5734. user on @var{files}; @sc{cvs} will remove the watch when @var{files} are
  5735. @code{unedit}ed or @code{commit}ted. If the user does not wish to
  5736. receive notifications, she should specify @code{-a none}.
  5737. The @var{files} and the options are processed as for the @code{cvs
  5738. watch} commands.
  5739. @ignore
  5740. @strong{Caution: If the @code{PreservePermissions}
  5741. option is enabled in the repository (@pxref{config}),
  5742. @sc{cvs} will not change the permissions on any of the
  5743. @var{files}. The reason for this change is to ensure
  5744. that using @samp{cvs edit} does not interfere with the
  5745. ability to store file permissions in the @sc{cvs}
  5746. repository.}
  5747. @end ignore
  5748. @end deffn
  5749. Normally when you are done with a set of changes, you
  5750. use the @code{cvs commit} command, which checks in your
  5751. changes and returns the watched files to their usual
  5752. read-only state. But if you instead decide to abandon
  5753. your changes, or not to make any changes, you can use
  5754. the @code{cvs unedit} command.
  5755. @cindex unedit (subcommand)
  5756. @cindex Abandoning work
  5757. @cindex Reverting to repository version
  5758. @deffn Command {cvs unedit} [@code{-lR}] [@var{files}]@dots{}
  5759. Abandon work on the working files @var{files}, and revert them to the
  5760. repository versions on which they are based. @sc{cvs} makes those
  5761. @var{files} read-only for which users have requested notification using
  5762. @code{cvs watch on}. @sc{cvs} notifies users who have requested @code{unedit}
  5763. notification for any of @var{files}.
  5764. The @var{files} and options are processed as for the
  5765. @code{cvs watch} commands.
  5766. If watches are not in use, the @code{unedit} command
  5767. probably does not work, and the way to revert to the
  5768. repository version is with the command @code{cvs update -C file}
  5769. (@pxref{update}).
  5770. The meaning is
  5771. not precisely the same; the latter may also
  5772. bring in some changes which have been made in the
  5773. repository since the last time you updated.
  5774. @c It would be a useful enhancement to CVS to make
  5775. @c unedit work in the non-watch case as well.
  5776. @end deffn
  5777. When using client/server @sc{cvs}, you can use the
  5778. @code{cvs edit} and @code{cvs unedit} commands even if
  5779. @sc{cvs} is unable to successfully communicate with the
  5780. server; the notifications will be sent upon the next
  5781. successful @sc{cvs} command.
  5782. @node Watch information
  5783. @subsection Information about who is watching and editing
  5784. @cindex watchers (subcommand)
  5785. @deffn Command {cvs watchers} [@code{-lR}] [@var{files}]@dots{}
  5786. List the users currently watching changes to @var{files}. The report
  5787. includes the files being watched, and the mail address of each watcher.
  5788. The @var{files} and options are processed as for the
  5789. @code{cvs watch} commands.
  5790. @end deffn
  5791. @cindex editors (subcommand)
  5792. @deffn Command {cvs editors} [@code{-lR}] [@var{files}]@dots{}
  5793. List the users currently working on @var{files}. The report
  5794. includes the mail address of each user, the time when the user began
  5795. working with the file, and the host and path of the working directory
  5796. containing the file.
  5797. The @var{files} and options are processed as for the
  5798. @code{cvs watch} commands.
  5799. @end deffn
  5800. @node Watches Compatibility
  5801. @subsection Using watches with old versions of CVS
  5802. @cindex CVS 1.6, and watches
  5803. If you use the watch features on a repository, it
  5804. creates @file{CVS} directories in the repository and
  5805. stores the information about watches in that directory.
  5806. If you attempt to use @sc{cvs} 1.6 or earlier with the
  5807. repository, you get an error message such as the
  5808. following (all on one line):
  5809. @example
  5810. cvs update: cannot open CVS/Entries for reading:
  5811. No such file or directory
  5812. @end example
  5813. @noindent
  5814. and your operation will likely be aborted. To use the
  5815. watch features, you must upgrade all copies of @sc{cvs}
  5816. which use that repository in local or server mode. If
  5817. you cannot upgrade, use the @code{watch off} and
  5818. @code{watch remove} commands to remove all watches, and
  5819. that will restore the repository to a state which
  5820. @sc{cvs} 1.6 can cope with.
  5821. @node Choosing a model
  5822. @section Choosing between reserved or unreserved checkouts
  5823. @cindex Choosing, reserved or unreserved checkouts
  5824. Reserved and unreserved checkouts each have pros and
  5825. cons. Let it be said that a lot of this is a matter of
  5826. opinion or what works given different groups' working
  5827. styles, but here is a brief description of some of the
  5828. issues. There are many ways to organize a team of
  5829. developers. @sc{cvs} does not try to enforce a certain
  5830. organization. It is a tool that can be used in several
  5831. ways.
  5832. Reserved checkouts can be very counter-productive. If
  5833. two persons want to edit different parts of a file,
  5834. there may be no reason to prevent either of them from
  5835. doing so. Also, it is common for someone to take out a
  5836. lock on a file, because they are planning to edit it,
  5837. but then forget to release the lock.
  5838. @c "many groups"? specifics? cites to papers on this?
  5839. @c some way to weasel-word it a bit more so we don't
  5840. @c need facts :-)?
  5841. People, especially people who are familiar with
  5842. reserved checkouts, often wonder how often conflicts
  5843. occur if unreserved checkouts are used, and how
  5844. difficult they are to resolve. The experience with
  5845. many groups is that they occur rarely and usually are
  5846. relatively straightforward to resolve.
  5847. The rarity of serious conflicts may be surprising, until one realizes
  5848. that they occur only when two developers disagree on the proper design
  5849. for a given section of code; such a disagreement suggests that the
  5850. team has not been communicating properly in the first place. In order
  5851. to collaborate under @emph{any} source management regimen, developers
  5852. must agree on the general design of the system; given this agreement,
  5853. overlapping changes are usually straightforward to merge.
  5854. In some cases unreserved checkouts are clearly
  5855. inappropriate. If no merge tool exists for the kind of
  5856. file you are managing (for example word processor files
  5857. or files edited by Computer Aided Design programs), and
  5858. it is not desirable to change to a program which uses a
  5859. mergeable data format, then resolving conflicts is
  5860. going to be unpleasant enough that you generally will
  5861. be better off to simply avoid the conflicts instead, by
  5862. using reserved checkouts.
  5863. The watches features described above in @ref{Watches}
  5864. can be considered to be an intermediate model between
  5865. reserved checkouts and unreserved checkouts. When you
  5866. go to edit a file, it is possible to find out who else
  5867. is editing it. And rather than having the system
  5868. simply forbid both people editing the file, it can tell
  5869. you what the situation is and let you figure out
  5870. whether it is a problem in that particular case or not.
  5871. Therefore, for some groups it can be considered the
  5872. best of both the reserved checkout and unreserved
  5873. checkout worlds.
  5874. @c ---------------------------------------------------------------------
  5875. @node Revision management
  5876. @chapter Revision management
  5877. @cindex Revision management
  5878. @c -- This chapter could be expanded a lot.
  5879. @c -- Experiences are very welcome!
  5880. If you have read this far, you probably have a pretty
  5881. good grasp on what @sc{cvs} can do for you. This
  5882. chapter talks a little about things that you still have
  5883. to decide.
  5884. If you are doing development on your own using @sc{cvs}
  5885. you could probably skip this chapter. The questions
  5886. this chapter takes up become more important when more
  5887. than one person is working in a repository.
  5888. @menu
  5889. * When to commit:: Some discussion on the subject
  5890. @end menu
  5891. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5892. @node When to commit
  5893. @section When to commit?
  5894. @cindex When to commit
  5895. @cindex Committing, when to
  5896. @cindex Policy
  5897. Your group should decide which policy to use regarding
  5898. commits. Several policies are possible, and as your
  5899. experience with @sc{cvs} grows you will probably find
  5900. out what works for you.
  5901. If you commit files too quickly you might commit files
  5902. that do not even compile. If your partner updates his
  5903. working sources to include your buggy file, he will be
  5904. unable to compile the code. On the other hand, other
  5905. persons will not be able to benefit from the
  5906. improvements you make to the code if you commit very
  5907. seldom, and conflicts will probably be more common.
  5908. It is common to only commit files after making sure
  5909. that they can be compiled. Some sites require that the
  5910. files pass a test suite. Policies like this can be
  5911. enforced using the commitinfo file
  5912. (@pxref{commitinfo}), but you should think twice before
  5913. you enforce such a convention. By making the
  5914. development environment too controlled it might become
  5915. too regimented and thus counter-productive to the real
  5916. goal, which is to get software written.
  5917. @c ---------------------------------------------------------------------
  5918. @node Keyword substitution
  5919. @chapter Keyword substitution
  5920. @cindex Keyword substitution
  5921. @cindex Keyword expansion
  5922. @cindex Identifying files
  5923. @comment Be careful when editing this chapter.
  5924. @comment Remember that this file is kept under
  5925. @comment version control, so we must not accidentally
  5926. @comment include a valid keyword in the running text.
  5927. As long as you edit source files inside a working
  5928. directory you can always find out the state of
  5929. your files via @samp{cvs status} and @samp{cvs log}.
  5930. But as soon as you export the files from your
  5931. development environment it becomes harder to identify
  5932. which revisions they are.
  5933. @sc{cvs} can use a mechanism known as @dfn{keyword
  5934. substitution} (or @dfn{keyword expansion}) to help
  5935. identifying the files. Embedded strings of the form
  5936. @code{$@var{keyword}$} and
  5937. @code{$@var{keyword}:@dots{}$} in a file are replaced
  5938. with strings of the form
  5939. @code{$@var{keyword}:@var{value}$} whenever you obtain
  5940. a new revision of the file.
  5941. @menu
  5942. * Keyword list:: Keywords
  5943. * Using keywords:: Using keywords
  5944. * Avoiding substitution:: Avoiding substitution
  5945. * Substitution modes:: Substitution modes
  5946. * Configuring keyword expansion:: Configuring keyword expansion
  5947. * Log keyword:: Problems with the $@splitrcskeyword{}Log$ keyword.
  5948. @end menu
  5949. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5950. @node Keyword list
  5951. @section Keyword List
  5952. @cindex Keyword List
  5953. @c FIXME: need some kind of example here I think,
  5954. @c perhaps in a
  5955. @c "Keyword intro" node. The intro in the "Keyword
  5956. @c substitution" node itself seems OK, but to launch
  5957. @c into a list of the keywords somehow seems too abrupt.
  5958. This is a list of the keywords:
  5959. @table @code
  5960. @cindex Author keyword
  5961. @item $@splitrcskeyword{Author}$
  5962. The login name of the user who checked in the revision.
  5963. @cindex CVSHeader keyword
  5964. @item $@splitrcskeyword{CVSHeader}
  5965. A standard header (similar to $@splitrcskeyword{Header}$, but with
  5966. the CVS root stripped off). It contains the relative
  5967. pathname of the @sc{rcs} file to the CVS root, the
  5968. revision number, the date (UTC), the author, the state,
  5969. and the locker (if locked). Files will normally never
  5970. be locked when you use @sc{cvs}.
  5971. Note that this keyword has only been recently
  5972. introduced to @sc{cvs} and may cause problems with
  5973. existing installations if $@splitrcskeyword{CVSHeader}$ is already
  5974. in the files for a different purpose. This keyword may
  5975. be excluded using the @code{KeywordExpansion=eCVSHeader}
  5976. in the @file{CVSROOT/config} file.
  5977. See @ref{Configuring keyword expansion} for more details.
  5978. @cindex Date keyword
  5979. @item $@splitrcskeyword{Date}$
  5980. The date and time (UTC) the revision was checked in.
  5981. @cindex Header keyword
  5982. @item $@splitrcskeyword{Header}$
  5983. A standard header containing the full pathname of the
  5984. @sc{rcs} file, the revision number, the date (UTC), the
  5985. author, the state, and the locker (if locked). Files
  5986. will normally never be locked when you use @sc{cvs}.
  5987. @cindex Id keyword
  5988. @item $@splitrcskeyword{Id}$
  5989. Same as @code{$@splitrcskeyword{Header}$}, except that the @sc{rcs}
  5990. filename is without a path.
  5991. @cindex Name keyword
  5992. @item $@splitrcskeyword{Name}$
  5993. Tag name used to check out this file. The keyword is
  5994. expanded only if one checks out with an explicit tag
  5995. name. For example, when running the command @code{cvs
  5996. co -r first}, the keyword expands to @samp{Name: first}.
  5997. @cindex Locker keyword
  5998. @item $@splitrcskeyword{Locker}$
  5999. The login name of the user who locked the revision
  6000. (empty if not locked, which is the normal case unless
  6001. @code{cvs admin -l} is in use).
  6002. @cindex Log keyword
  6003. @item $@splitrcskeyword{Log}$
  6004. The log message supplied during commit, preceded by a
  6005. header containing the @sc{rcs} filename, the revision
  6006. number, the author, and the date (UTC). Existing log
  6007. messages are @emph{not} replaced. Instead, the new log
  6008. message is inserted after @code{$@splitrcskeyword{Log:@dots{}}$}.
  6009. Each new line is prefixed with the same string which
  6010. precedes the @code{$Log} keyword. For example, if the
  6011. file contains:
  6012. @example
  6013. /* Here is what people have been up to:
  6014. *
  6015. * $@splitrcskeyword{}Log: frob.c,v $
  6016. * Revision 1.1 1997/01/03 14:23:51 joe
  6017. * Add the superfrobnicate option
  6018. *
  6019. */
  6020. @end example
  6021. @noindent
  6022. then additional lines which are added when expanding
  6023. the @code{$Log} keyword will be preceded by @samp{ * }.
  6024. Unlike previous versions of @sc{cvs} and @sc{rcs}, the
  6025. @dfn{comment leader} from the @sc{rcs} file is not used.
  6026. The @code{$Log} keyword is useful for
  6027. accumulating a complete change log in a source file,
  6028. but for several reasons it can be problematic.
  6029. @xref{Log keyword}.
  6030. @cindex RCSfile keyword
  6031. @item $@splitrcskeyword{RCSfile}$
  6032. The name of the RCS file without a path.
  6033. @cindex Revision keyword
  6034. @item $@splitrcskeyword{Revision}$
  6035. The revision number assigned to the revision.
  6036. @cindex Source keyword
  6037. @item $@splitrcskeyword{Source}$
  6038. The full pathname of the RCS file.
  6039. @cindex State keyword
  6040. @item $@splitrcskeyword{State}$
  6041. The state assigned to the revision. States can be
  6042. assigned with @code{cvs admin -s}---see @ref{admin options}.
  6043. @cindex Local keyword
  6044. @item Local keyword
  6045. The @code{LocalKeyword} option in the @file{CVSROOT/config} file
  6046. may be used to specify a local keyword which is to be
  6047. used as an alias for one of the other keywords. For
  6048. example, if the @file{CVSROOT/config} file contains
  6049. a line with @code{LocalKeyword=MYBSD=CVSHeader}, then a
  6050. file with the local keyword $@splitrcskeyword{MYBSD}$ will be
  6051. expanded as if it were a $@splitrcskeyword{CVSHeader}$ keyword. If
  6052. the src/frob.c file contained this keyword, it might
  6053. look something like this:
  6054. @example
  6055. /*
  6056. * $@splitrcskeyword{}MYBSD: src/frob.c,v 1.1 2003/05/04 09:27:45 john Exp $
  6057. */
  6058. @end example
  6059. Many repositories make use of a such a ``local
  6060. keyword'' feature. An old patch to @sc{cvs} provided
  6061. the @code{LocalKeyword} feature using a @code{tag=}
  6062. option and called this the ``custom tag'' or ``local
  6063. tag'' feature. It was used in conjunction with the
  6064. what they called the @code{tagexpand=} option. In
  6065. @sc{cvs} this other option is known as the
  6066. @code{KeywordExpand} option.
  6067. See @ref{Configuring keyword expansion} for more
  6068. details.
  6069. Examples from popular projects include:
  6070. $@splitrcskeyword{FreeBSD}$, $@splitrcskeyword{NetBSD}$,
  6071. $@splitrcskeyword{OpenBSD}$, $@splitrcskeyword{XFree86}$,
  6072. $@splitrcskeyword{Xorg}$.
  6073. The advantage of this is that you can include your
  6074. local version information in a file using this local
  6075. keyword without disrupting the upstream version
  6076. information (which may be a different local keyword or
  6077. a standard keyword). Allowing bug reports and the like
  6078. to more properly identify the source of the original
  6079. bug to the third-party and reducing the number of
  6080. conflicts that arise during an import of a new version.
  6081. All keyword expansion except the local keyword may be
  6082. disabled using the @code{KeywordExpansion} option in
  6083. the @file{CVSROOT/config} file---see
  6084. @ref{Configuring keyword expansion} for more details.
  6085. @end table
  6086. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6087. @node Using keywords
  6088. @section Using keywords
  6089. To include a keyword string you simply include the
  6090. relevant text string, such as @code{$@splitrcskeyword{Id}$}, inside the
  6091. file, and commit the file. @sc{cvs} will automatically
  6092. expand the string as part of the commit operation.
  6093. It is common to embed the @code{$@splitrcskeyword{}Id$} string in
  6094. the source files so that it gets passed through to
  6095. generated files. For example, if you are managing
  6096. computer program source code, you might include a
  6097. variable which is initialized to contain that string.
  6098. Or some C compilers may provide a @code{#pragma ident}
  6099. directive. Or a document management system might
  6100. provide a way to pass a string through to generated
  6101. files.
  6102. @c Would be nice to give an example, but doing this in
  6103. @c portable C is not possible and the problem with
  6104. @c picking any one language (VMS HELP files, Ada,
  6105. @c troff, whatever) is that people use CVS for all
  6106. @c kinds of files.
  6107. @cindex Ident (shell command)
  6108. The @code{ident} command (which is part of the @sc{rcs}
  6109. package) can be used to extract keywords and their
  6110. values from a file. This can be handy for text files,
  6111. but it is even more useful for extracting keywords from
  6112. binary files.
  6113. @example
  6114. $ ident samp.c
  6115. samp.c:
  6116. $@splitrcskeyword{}Id: samp.c,v 1.5 1993/10/19 14:57:32 ceder Exp $
  6117. $ gcc samp.c
  6118. $ ident a.out
  6119. a.out:
  6120. $@splitrcskeyword{}Id: samp.c,v 1.5 1993/10/19 14:57:32 ceder Exp $
  6121. @end example
  6122. @cindex What (shell command)
  6123. S@sc{ccs} is another popular revision control system.
  6124. It has a command, @code{what}, which is very similar to
  6125. @code{ident} and used for the same purpose. Many sites
  6126. without @sc{rcs} have @sc{sccs}. Since @code{what}
  6127. looks for the character sequence @code{@@(#)} it is
  6128. easy to include keywords that are detected by either
  6129. command. Simply prefix the keyword with the
  6130. magic @sc{sccs} phrase, like this:
  6131. @example
  6132. static char *id="@@(#) $@splitrcskeyword{}Id: ab.c,v 1.5 1993/10/19 14:57:32 ceder Exp $";
  6133. @end example
  6134. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6135. @node Avoiding substitution
  6136. @section Avoiding substitution
  6137. Keyword substitution has its disadvantages. Sometimes
  6138. you might want the literal text string
  6139. @samp{$@splitrcskeyword{}Author$} to appear inside a file without
  6140. @sc{cvs} interpreting it as a keyword and expanding it
  6141. into something like @samp{$@splitrcskeyword{}Author: ceder $}.
  6142. There is unfortunately no way to selectively turn off
  6143. keyword substitution. You can use @samp{-ko}
  6144. (@pxref{Substitution modes}) to turn off keyword
  6145. substitution entirely.
  6146. In many cases you can avoid using keywords in
  6147. the source, even though they appear in the final
  6148. product. For example, the source for this manual
  6149. contains @samp{$@@asis@{@}Author$} whenever the text
  6150. @samp{$@splitrcskeyword{}Author$} should appear. In @code{nroff}
  6151. and @code{troff} you can embed the null-character
  6152. @code{\&} inside the keyword for a similar effect.
  6153. It is also possible to specify an explicit list of
  6154. keywords to include or exclude using the
  6155. @code{KeywordExpand} option in the
  6156. @file{CVSROOT/config} file--see @ref{Configuring keyword expansion}
  6157. for more details. This feature is intended primarily
  6158. for use with the @code{LocalKeyword} option--see
  6159. @ref{Keyword list}.
  6160. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6161. @node Substitution modes
  6162. @section Substitution modes
  6163. @cindex Keyword substitution, changing modes
  6164. @cindex -k (keyword substitution)
  6165. @cindex Kflag
  6166. @c FIXME: This could be made more coherent, by expanding it
  6167. @c with more examples or something.
  6168. Each file has a stored default substitution mode, and
  6169. each working directory copy of a file also has a
  6170. substitution mode. The former is set by the @samp{-k}
  6171. option to @code{cvs add} and @code{cvs admin}; the
  6172. latter is set by the @samp{-k} or @samp{-A} options to @code{cvs
  6173. checkout} or @code{cvs update}. @code{cvs diff} also
  6174. has a @samp{-k} option. For some examples,
  6175. see @ref{Binary files}, and @ref{Merging and keywords}.
  6176. @c The fact that -A is overloaded to mean both reset
  6177. @c sticky options and reset sticky tags/dates is
  6178. @c somewhat questionable. Perhaps there should be
  6179. @c separate options to reset sticky options (e.g. -k
  6180. @c A") and tags/dates (someone suggested -r HEAD could
  6181. @c do this instead of setting a sticky tag of "HEAD"
  6182. @c as in the status quo but I haven't thought much
  6183. @c about that idea. Of course -r .reset or something
  6184. @c could be coined if this needs to be a new option).
  6185. @c On the other hand, having -A mean "get things back
  6186. @c into the state after a fresh checkout" has a certain
  6187. @c appeal, and maybe there is no sufficient reason for
  6188. @c creeping featurism in this area.
  6189. The modes available are:
  6190. @table @samp
  6191. @item -kkv
  6192. Generate keyword strings using the default form, e.g.
  6193. @code{$@splitrcskeyword{}Revision: 5.7 $} for the @code{Revision}
  6194. keyword.
  6195. @item -kkvl
  6196. Like @samp{-kkv}, except that a locker's name is always
  6197. inserted if the given revision is currently locked.
  6198. The locker's name is only relevant if @code{cvs admin
  6199. -l} is in use.
  6200. @item -kk
  6201. Generate only keyword names in keyword strings; omit
  6202. their values. For example, for the @code{Revision}
  6203. keyword, generate the string @code{$@splitrcskeyword{}Revision$}
  6204. instead of @code{$@splitrcskeyword{}Revision: 5.7 $}. This option
  6205. is useful to ignore differences due to keyword
  6206. substitution when comparing different revisions of a
  6207. file (@pxref{Merging and keywords}).
  6208. @item -ko
  6209. Generate the old keyword string, present in the working
  6210. file just before it was checked in. For example, for
  6211. the @code{Revision} keyword, generate the string
  6212. @code{$@splitrcskeyword{}Revision: 1.1 $} instead of
  6213. @code{$@splitrcskeyword{}Revision: 5.7 $} if that is how the
  6214. string appeared when the file was checked in.
  6215. @item -kb
  6216. Like @samp{-ko}, but also inhibit conversion of line
  6217. endings between the canonical form in which they are
  6218. stored in the repository (linefeed only), and the form
  6219. appropriate to the operating system in use on the
  6220. client. For systems, like unix, which use linefeed
  6221. only to terminate lines, this is very similar to
  6222. @samp{-ko}. For more information on binary files, see
  6223. @ref{Binary files}. In @sc{cvs} version 1.12.2 and later
  6224. @samp{-kb}, as set by @code{cvs add}, @code{cvs admin}, or
  6225. @code{cvs import} may not be overridden by a @samp{-k} option
  6226. specified on the command line.
  6227. @item -kv
  6228. Generate only keyword values for keyword strings. For
  6229. example, for the @code{Revision} keyword, generate the string
  6230. @code{5.7} instead of @code{$@splitrcskeyword{}Revision: 5.7 $}.
  6231. This can help generate files in programming languages
  6232. where it is hard to strip keyword delimiters like
  6233. @code{$@splitrcskeyword{}Revision: $} from a string. However,
  6234. further keyword substitution cannot be performed once
  6235. the keyword names are removed, so this option should be
  6236. used with care.
  6237. One often would like to use @samp{-kv} with @code{cvs
  6238. export}---@pxref{export}. But be aware that doesn't
  6239. handle an export containing binary files correctly.
  6240. @end table
  6241. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6242. @node Configuring keyword expansion
  6243. @section Configuring Keyord Expansion
  6244. @cindex Configuring keyword expansion
  6245. In a repository that includes third-party software on
  6246. vendor branches, it is sometimes helpful to configure
  6247. CVS to use a local keyword instead of the standard
  6248. $@splitrcskeyword{Id}$ or $@splitrcskeyword{Header}$ keywords. Examples from
  6249. real projects includ, $@splitrcskeyword{Xorg}$, $@splitrcskeyword{XFree86}$,
  6250. $@splitrcskeyword{FreeBSD}$, $@splitrcskeyword{NetBSD}$,
  6251. $@splitrcskeyword{OpenBSD}$, and even $@splitrcskeyword{dotat}$.
  6252. The advantage of this is that
  6253. you can include your local version information in a
  6254. file using this local keyword (sometimes called a
  6255. ``custom tag'' or a ``local tag'') without disrupting
  6256. the upstream version information (which may be a
  6257. different local keyword or a standard keyword). In
  6258. these cases, it is typically desirable to disable the
  6259. expansion of all keywords except the configured local
  6260. keyword.
  6261. The @code{KeywordExpansion} option in the
  6262. @file{CVSROOT/config} file is intended to allow for the
  6263. either the explicit exclusion of a keyword or list of
  6264. keywords, or for the explicit inclusion of a keyword or
  6265. a list of keywords. This list may include the
  6266. @code{LocalKeyword} that has been configured.
  6267. The @code{KeywordExpansion} option is followed by
  6268. @code{=} and the next character may either be @code{i}
  6269. to start an inclusion list or @code{e} to start an
  6270. exclusion list. If the following lines were added to
  6271. the @file{CVSROOT/config} file:
  6272. @example
  6273. # Add a "MyBSD" keyword and restrict keyword
  6274. # expansion
  6275. LocalKeyword=MyBSD=CVSHeader
  6276. KeywordExpand=iMyBSD
  6277. @end example
  6278. then only the $@splitrcskeyword{MyBSD}$ keyword would be expanded.
  6279. A list may be used. The this example:
  6280. @example
  6281. # Add a "MyBSD" keyword and restrict keyword
  6282. # expansion to the MyBSD, Name and Date keywords.
  6283. LocalKeyword=MyBSD=CVSHeader
  6284. KeywordExpand=iMyBSD,Name,Date
  6285. @end example
  6286. would allow $@splitrcskeyword{MyBSD}$, $@splitrcskeyword{Name}$, and
  6287. $@splitrcskeyword{Date}$ to be expanded.
  6288. It is also possible to configure an exclusion list
  6289. using the following:
  6290. @example
  6291. # Do not expand the non-RCS keyword CVSHeader
  6292. KeywordExpand=eCVSHeader
  6293. @end example
  6294. This allows @sc{cvs} to ignore the recently introduced
  6295. $@splitrcskeyword{CVSHeader}$ keyword and retain all of the
  6296. others. The exclusion entry could also contain the
  6297. standard RCS keyword list, but this could be confusing
  6298. to users that expect RCS keywords to be expanded, so
  6299. ycare should be taken to properly set user expectations
  6300. for a repository that is configured in that manner.
  6301. If there is a desire to not have any RCS keywords
  6302. expanded and not use the @code{-ko} flags everywhere,
  6303. an administrator may disable all keyword expansion
  6304. using the @file{CVSROOT/config} line:
  6305. @example
  6306. # Do not expand any RCS keywords
  6307. KeywordExpand=i
  6308. @end example
  6309. this could be confusing to users that expect RCS
  6310. keywords like $@splitrcskeyword{Id}$ to be expanded properly,
  6311. so care should be taken to properly set user
  6312. expectations for a repository so configured.
  6313. It should be noted that a patch to provide both the
  6314. @code{KeywordExpand} and @code{LocalKeyword} features
  6315. has been around a long time. However, that patch
  6316. implemented these features using @code{tag=} and
  6317. @code{tagexpand=} keywords and those keywords are NOT
  6318. recognized.
  6319. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6320. @node Log keyword
  6321. @section Problems with the $ @splitrcskeyword{}Log$ keyword.
  6322. The @code{$@splitrcskeyword{}Log$} keyword is somewhat
  6323. controversial. As long as you are working on your
  6324. development system the information is easily accessible
  6325. even if you do not use the @code{$@splitrcskeyword{}Log$}
  6326. keyword---just do a @code{cvs log}. Once you export
  6327. the file the history information might be useless
  6328. anyhow.
  6329. A more serious concern is that @sc{cvs} is not good at
  6330. handling @code{$@splitrcskeyword{}Log$} entries when a branch is
  6331. merged onto the main trunk. Conflicts often result
  6332. from the merging operation.
  6333. @c Might want to check whether the CVS implementation
  6334. @c of RCS_merge has this problem the same way rcsmerge
  6335. @c does. I would assume so....
  6336. People also tend to "fix" the log entries in the file
  6337. (correcting spelling mistakes and maybe even factual
  6338. errors). If that is done the information from
  6339. @code{cvs log} will not be consistent with the
  6340. information inside the file. This may or may not be a
  6341. problem in real life.
  6342. It has been suggested that the @code{$@splitrcskeyword{}Log$}
  6343. keyword should be inserted @emph{last} in the file, and
  6344. not in the files header, if it is to be used at all.
  6345. That way the long list of change messages will not
  6346. interfere with everyday source file browsing.
  6347. @c ---------------------------------------------------------------------
  6348. @node Tracking sources
  6349. @chapter Tracking third-party sources
  6350. @cindex Third-party sources
  6351. @cindex Tracking sources
  6352. @c FIXME: Need discussion of added and removed files.
  6353. @c FIXME: This doesn't really adequately introduce the
  6354. @c concepts of "vendor" and "you". They don't *have*
  6355. @c to be separate organizations or separate people.
  6356. @c We want a description which is somewhat more based on
  6357. @c the technical issues of which sources go where, but
  6358. @c also with enough examples of how this relates to
  6359. @c relationships like customer-supplier, developer-QA,
  6360. @c maintainer-contributor, or whatever, to make it
  6361. @c seem concrete.
  6362. If you modify a program to better fit your site, you
  6363. probably want to include your modifications when the next
  6364. release of the program arrives. @sc{cvs} can help you with
  6365. this task.
  6366. @cindex Vendor
  6367. @cindex Vendor branch
  6368. @cindex Branch, vendor-
  6369. In the terminology used in @sc{cvs}, the supplier of the
  6370. program is called a @dfn{vendor}. The unmodified
  6371. distribution from the vendor is checked in on its own
  6372. branch, the @dfn{vendor branch}. @sc{cvs} reserves branch
  6373. 1.1.1 for this use.
  6374. When you modify the source and commit it, your revision
  6375. will end up on the main trunk. When a new release is
  6376. made by the vendor, you commit it on the vendor branch
  6377. and copy the modifications onto the main trunk.
  6378. Use the @code{import} command to create and update
  6379. the vendor branch. When you import a new file,
  6380. the vendor branch is made the `head' revision, so
  6381. anyone that checks out a copy of the file gets that
  6382. revision. When a local modification is committed it is
  6383. placed on the main trunk, and made the `head'
  6384. revision.
  6385. @menu
  6386. * First import:: Importing for the first time
  6387. * Update imports:: Updating with the import command
  6388. * Reverting local changes:: Reverting to the latest vendor release
  6389. * Binary files in imports:: Binary files require special handling
  6390. * Keywords in imports:: Keyword substitution might be undesirable
  6391. * Multiple vendor branches:: What if you get sources from several places?
  6392. @end menu
  6393. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6394. @node First import
  6395. @section Importing for the first time
  6396. @cindex Importing modules
  6397. @c Should mention naming conventions for vendor tags,
  6398. @c release tags, and perhaps directory names.
  6399. Use the @code{import} command to check in the sources
  6400. for the first time. When you use the @code{import}
  6401. command to track third-party sources, the @dfn{vendor
  6402. tag} and @dfn{release tags} are useful. The
  6403. @dfn{vendor tag} is a symbolic name for the branch
  6404. (which is always 1.1.1, unless you use the @samp{-b
  6405. @var{branch}} flag---see @ref{Multiple vendor branches}.). The
  6406. @dfn{release tags} are symbolic names for a particular
  6407. release, such as @samp{FSF_0_04}.
  6408. @c I'm not completely sure this belongs here. But
  6409. @c we need to say it _somewhere_ reasonably obvious; it
  6410. @c is a common misconception among people first learning CVS
  6411. Note that @code{import} does @emph{not} change the
  6412. directory in which you invoke it. In particular, it
  6413. does not set up that directory as a @sc{cvs} working
  6414. directory; if you want to work with the sources import
  6415. them first and then check them out into a different
  6416. directory (@pxref{Getting the source}).
  6417. @cindex wdiff (import example)
  6418. Suppose you have the sources to a program called
  6419. @code{wdiff} in a directory @file{wdiff-0.04},
  6420. and are going to make private modifications that you
  6421. want to be able to use even when new releases are made
  6422. in the future. You start by importing the source to
  6423. your repository:
  6424. @example
  6425. $ cd wdiff-0.04
  6426. $ cvs import -m "Import of FSF v. 0.04" fsf/wdiff FSF_DIST WDIFF_0_04
  6427. @end example
  6428. The vendor tag is named @samp{FSF_DIST} in the above
  6429. example, and the only release tag assigned is
  6430. @samp{WDIFF_0_04}.
  6431. @c FIXME: Need to say where fsf/wdiff comes from.
  6432. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6433. @node Update imports
  6434. @section Updating with the import command
  6435. When a new release of the source arrives, you import it into the
  6436. repository with the same @code{import} command that you used to set up
  6437. the repository in the first place. The only difference is that you
  6438. specify a different release tag this time:
  6439. @example
  6440. $ tar xfz wdiff-0.05.tar.gz
  6441. $ cd wdiff-0.05
  6442. $ cvs import -m "Import of FSF v. 0.05" fsf/wdiff FSF_DIST WDIFF_0_05
  6443. @end example
  6444. For files that have not been modified locally, the newly created
  6445. revision becomes the head revision. If you have made local
  6446. changes, @code{import} will warn you that you must merge the changes
  6447. into the main trunk, and tell you to use @samp{checkout -j} to do so:
  6448. @c FIXME: why "wdiff" here and "fsf/wdiff" in the
  6449. @c "import"? I think the assumption is that one has
  6450. @c "wdiff fsf/wdiff" or some such in modules, but it
  6451. @c would be better to not use modules in this example.
  6452. @example
  6453. $ cvs checkout -jFSF_DIST:yesterday -jFSF_DIST wdiff
  6454. @end example
  6455. @noindent
  6456. The above command will check out the latest revision of
  6457. @samp{wdiff}, merging the changes made on the vendor branch @samp{FSF_DIST}
  6458. since yesterday into the working copy. If any conflicts arise during
  6459. the merge they should be resolved in the normal way (@pxref{Conflicts
  6460. example}). Then, the modified files may be committed.
  6461. However, it is much better to use the two release tags rather than using
  6462. a date on the branch as suggested above:
  6463. @example
  6464. $ cvs checkout -jWDIFF_0_04 -jWDIFF_0_05 wdiff
  6465. @end example
  6466. @noindent
  6467. The reason this is better is that
  6468. using a date, as suggested above, assumes that you do
  6469. not import more than one release of a product per day.
  6470. More importantly, using the release tags allows @sc{cvs} to detect files
  6471. that were removed between the two vendor releases and mark them for
  6472. removal. Since @code{import} has no way to detect removed files, you
  6473. should do a merge like this even if @code{import} doesn't tell you to.
  6474. @node Reverting local changes
  6475. @section Reverting to the latest vendor release
  6476. You can also revert local changes completely and return
  6477. to the latest vendor release by changing the `head'
  6478. revision back to the vendor branch on all files. For
  6479. example, if you have a checked-out copy of the sources
  6480. in @file{~/work.d/wdiff}, and you want to revert to the
  6481. vendor's version for all the files in that directory,
  6482. you would type:
  6483. @example
  6484. $ cd ~/work.d/wdiff
  6485. $ cvs admin -bWDIFF .
  6486. @end example
  6487. @noindent
  6488. You must specify the @samp{-bWDIFF} without any space
  6489. after the @samp{-b}. @xref{admin options}.
  6490. @node Binary files in imports
  6491. @section How to handle binary files with cvs import
  6492. Use the @samp{-k} wrapper option to tell import which
  6493. files are binary. @xref{Wrappers}.
  6494. @node Keywords in imports
  6495. @section How to handle keyword substitution with cvs import
  6496. The sources which you are importing may contain
  6497. keywords (@pxref{Keyword substitution}). For example,
  6498. the vendor may use @sc{cvs} or some other system
  6499. which uses similar keyword expansion syntax. If you
  6500. just import the files in the default fashion, then
  6501. the keyword expansions supplied by the vendor will
  6502. be replaced by keyword expansions supplied by your
  6503. own copy of @sc{cvs}. It may be more convenient to
  6504. maintain the expansions supplied by the vendor, so
  6505. that this information can supply information about
  6506. the sources that you imported from the vendor.
  6507. To maintain the keyword expansions supplied by the
  6508. vendor, supply the @samp{-ko} option to @code{cvs
  6509. import} the first time you import the file.
  6510. This will turn off keyword expansion
  6511. for that file entirely, so if you want to be more
  6512. selective you'll have to think about what you want
  6513. and use the @samp{-k} option to @code{cvs update} or
  6514. @code{cvs admin} as appropriate.
  6515. @c Supplying -ko to import if the file already existed
  6516. @c has no effect. Not clear to me whether it should
  6517. @c or not.
  6518. @node Multiple vendor branches
  6519. @section Multiple vendor branches
  6520. All the examples so far assume that there is only one
  6521. vendor from which you are getting sources. In some
  6522. situations you might get sources from a variety of
  6523. places. For example, suppose that you are dealing with
  6524. a project where many different people and teams are
  6525. modifying the software. There are a variety of ways to
  6526. handle this, but in some cases you have a bunch of
  6527. source trees lying around and what you want to do more
  6528. than anything else is just to all put them in @sc{cvs} so
  6529. that you at least have them in one place.
  6530. For handling situations in which there may be more than
  6531. one vendor, you may specify the @samp{-b} option to
  6532. @code{cvs import}. It takes as an argument the vendor
  6533. branch to import to. The default is @samp{-b 1.1.1}.
  6534. For example, suppose that there are two teams, the red
  6535. team and the blue team, that are sending you sources.
  6536. You want to import the red team's efforts to branch
  6537. 1.1.1 and use the vendor tag RED. You want to import
  6538. the blue team's efforts to branch 1.1.3 and use the
  6539. vendor tag BLUE. So the commands you might use are:
  6540. @example
  6541. $ cvs import dir RED RED_1-0
  6542. $ cvs import -b 1.1.3 dir BLUE BLUE_1-5
  6543. @end example
  6544. Note that if your vendor tag does not match your
  6545. @samp{-b} option, @sc{cvs} will not detect this case! For
  6546. example,
  6547. @example
  6548. $ cvs import -b 1.1.3 dir RED RED_1-0
  6549. @end example
  6550. @noindent
  6551. Be careful; this kind of mismatch is sure to sow
  6552. confusion or worse. I can't think of a useful purpose
  6553. for the ability to specify a mismatch here, but if you
  6554. discover such a use, don't. @sc{cvs} is likely to make this
  6555. an error in some future release.
  6556. @c Probably should say more about the semantics of
  6557. @c multiple branches. What about the default branch?
  6558. @c What about joining (perhaps not as useful with
  6559. @c multiple branches, or perhaps it is. Either way
  6560. @c should be mentioned).
  6561. @c I'm not sure about the best location for this. In
  6562. @c one sense, it might belong right after we've introduced
  6563. @c CVS's basic version control model, because people need
  6564. @c to figure out builds right away. The current location
  6565. @c is based on the theory that it kind of akin to the
  6566. @c "Revision management" section.
  6567. @node Builds
  6568. @chapter How your build system interacts with CVS
  6569. @cindex Builds
  6570. @cindex make
  6571. As mentioned in the introduction, @sc{cvs} does not
  6572. contain software for building your software from source
  6573. code. This section describes how various aspects of
  6574. your build system might interact with @sc{cvs}.
  6575. @c Is there a way to discuss this without reference to
  6576. @c tools other than CVS? I'm not sure there is; I
  6577. @c wouldn't think that people who learn CVS first would
  6578. @c even have this concern.
  6579. One common question, especially from people who are
  6580. accustomed to @sc{rcs}, is how to make their build get
  6581. an up to date copy of the sources. The answer to this
  6582. with @sc{cvs} is two-fold. First of all, since
  6583. @sc{cvs} itself can recurse through directories, there
  6584. is no need to modify your @file{Makefile} (or whatever
  6585. configuration file your build tool uses) to make sure
  6586. each file is up to date. Instead, just use two
  6587. commands, first @code{cvs -q update} and then
  6588. @code{make} or whatever the command is to invoke your
  6589. build tool. Secondly, you do not necessarily
  6590. @emph{want} to get a copy of a change someone else made
  6591. until you have finished your own work. One suggested
  6592. approach is to first update your sources, then
  6593. implement, build and
  6594. test the change you were thinking of, and then commit
  6595. your sources (updating first if necessary). By
  6596. periodically (in between changes, using the approach
  6597. just described) updating your entire tree, you ensure
  6598. that your sources are sufficiently up to date.
  6599. @cindex Bill of materials
  6600. One common need is to record which versions of which
  6601. source files went into a particular build. This kind
  6602. of functionality is sometimes called @dfn{bill of
  6603. materials} or something similar. The best way to do
  6604. this with @sc{cvs} is to use the @code{tag} command to
  6605. record which versions went into a given build
  6606. (@pxref{Tags}).
  6607. Using @sc{cvs} in the most straightforward manner
  6608. possible, each developer will have a copy of the entire
  6609. source tree which is used in a particular build. If
  6610. the source tree is small, or if developers are
  6611. geographically dispersed, this is the preferred
  6612. solution. In fact one approach for larger projects is
  6613. to break a project down into smaller
  6614. @c I say subsystem instead of module because they may or
  6615. @c may not use the modules file.
  6616. separately-compiled subsystems, and arrange a way of
  6617. releasing them internally so that each developer need
  6618. check out only those subsystems which they are
  6619. actively working on.
  6620. Another approach is to set up a structure which allows
  6621. developers to have their own copies of some files, and
  6622. for other files to access source files from a central
  6623. location. Many people have come up with some such a
  6624. @c two such people are paul@sander.cupertino.ca.us (for
  6625. @c a previous employer)
  6626. @c and gtornblo@senet.abb.se (spicm and related tools),
  6627. @c but as far as I know
  6628. @c no one has nicely packaged or released such a system (or
  6629. @c instructions for constructing one).
  6630. system using features such as the symbolic link feature
  6631. found in many operating systems, or the @code{VPATH}
  6632. feature found in many versions of @code{make}. One build
  6633. tool which is designed to help with this kind of thing
  6634. is Odin (see
  6635. @code{ftp://ftp.cs.colorado.edu/pub/distribs/odin}).
  6636. @c Should we be saying more about Odin? Or how you use
  6637. @c it with CVS? Also, the Prime Time Freeware for Unix
  6638. @c disk (see http://www.ptf.com/) has Odin (with a nice
  6639. @c paragraph summarizing it on the web), so that might be a
  6640. @c semi-"official" place to point people.
  6641. @c
  6642. @c Of course, many non-CVS systems have this kind of
  6643. @c functionality, for example OSF's ODE
  6644. @c (http://www.osf.org/ode/) or mk
  6645. @c (http://www.grin.net/~pzi/mk-3.18.4.docs/mk_toc.html
  6646. @c He has changed providers in the past; a search engine search
  6647. @c for "Peter Ziobrzynski" probably won't get too many
  6648. @c spurious hits :-). A more stable URL might be
  6649. @c ftp://ftp.uu.net/pub/cmvc/mk). But I'm not sure
  6650. @c there is any point in mentioning them here unless they
  6651. @c can work with CVS.
  6652. @c ---------------------------------------------------------------------
  6653. @node Special Files
  6654. @chapter Special Files
  6655. @cindex Special files
  6656. @cindex Device nodes
  6657. @cindex Ownership, saving in CVS
  6658. @cindex Permissions, saving in CVS
  6659. @cindex Hard links
  6660. @cindex Symbolic links
  6661. In normal circumstances, @sc{cvs} works only with regular
  6662. files. Every file in a project is assumed to be
  6663. persistent; it must be possible to open, read and close
  6664. them; and so on. @sc{cvs} also ignores file permissions and
  6665. ownerships, leaving such issues to be resolved by the
  6666. developer at installation time. In other words, it is
  6667. not possible to "check in" a device into a repository;
  6668. if the device file cannot be opened, @sc{cvs} will refuse to
  6669. handle it. Files also lose their ownerships and
  6670. permissions during repository transactions.
  6671. @ignore
  6672. If the configuration variable @code{PreservePermissions}
  6673. (@pxref{config}) is set in the repository, @sc{cvs} will
  6674. save the following file characteristics in the
  6675. repository:
  6676. @itemize @bullet
  6677. @item user and group ownership
  6678. @item permissions
  6679. @item major and minor device numbers
  6680. @item symbolic links
  6681. @item hard link structure
  6682. @end itemize
  6683. Using the @code{PreservePermissions} option affects the
  6684. behavior of @sc{cvs} in several ways. First, some of the
  6685. new operations supported by @sc{cvs} are not accessible to
  6686. all users. In particular, file ownership and special
  6687. file characteristics may only be changed by the
  6688. superuser. When the @code{PreservePermissions}
  6689. configuration variable is set, therefore, users will
  6690. have to be `root' in order to perform @sc{cvs} operations.
  6691. When @code{PreservePermissions} is in use, some @sc{cvs}
  6692. operations (such as @samp{cvs status}) will not
  6693. recognize a file's hard link structure, and so will
  6694. emit spurious warnings about mismatching hard links.
  6695. The reason is that @sc{cvs}'s internal structure does not
  6696. make it easy for these operations to collect all the
  6697. necessary data about hard links, so they check for file
  6698. conflicts with inaccurate data.
  6699. A more subtle difference is that @sc{cvs} considers a file
  6700. to have changed only if its contents have changed
  6701. (specifically, if the modification time of the working
  6702. file does not match that of the repository's file).
  6703. Therefore, if only the permissions, ownership or hard
  6704. linkage have changed, or if a device's major or minor
  6705. numbers have changed, @sc{cvs} will not notice. In order to
  6706. commit such a change to the repository, you must force
  6707. the commit with @samp{cvs commit -f}. This also means
  6708. that if a file's permissions have changed and the
  6709. repository file is newer than the working copy,
  6710. performing @samp{cvs update} will silently change the
  6711. permissions on the working copy.
  6712. Changing hard links in a @sc{cvs} repository is particularly
  6713. delicate. Suppose that file @file{foo} is linked to
  6714. file @file{old}, but is later relinked to file
  6715. @file{new}. You can wind up in the unusual situation
  6716. where, although @file{foo}, @file{old} and @file{new}
  6717. have all had their underlying link patterns changed,
  6718. only @file{foo} and @file{new} have been modified, so
  6719. @file{old} is not considered a candidate for checking
  6720. in. It can be very easy to produce inconsistent
  6721. results this way. Therefore, we recommend that when it
  6722. is important to save hard links in a repository, the
  6723. prudent course of action is to @code{touch} any file
  6724. whose linkage or status has changed since the last
  6725. checkin. Indeed, it may be wise to @code{touch *}
  6726. before each commit in a directory with complex hard
  6727. link structures.
  6728. It is worth noting that only regular files may
  6729. be merged, for reasons that hopefully are obvious. If
  6730. @samp{cvs update} or @samp{cvs checkout -j} attempts to
  6731. merge a symbolic link with a regular file, or two
  6732. device files for different kinds of devices, @sc{cvs} will
  6733. report a conflict and refuse to perform the merge. At
  6734. the same time, @samp{cvs diff} will not report any
  6735. differences between these files, since no meaningful
  6736. textual comparisons can be made on files which contain
  6737. no text.
  6738. The @code{PreservePermissions} features do not work
  6739. with client/server @sc{cvs}. Another limitation is
  6740. that hard links must be to other files within the same
  6741. directory; hard links across directories are not
  6742. supported.
  6743. @end ignore
  6744. @c ---------------------------------------------------------------------
  6745. @node CVS commands
  6746. @appendix Guide to CVS commands
  6747. This appendix describes the overall structure of
  6748. @sc{cvs} commands, and describes some commands in
  6749. detail (others are described elsewhere; for a quick
  6750. reference to @sc{cvs} commands, @pxref{Invoking CVS}).
  6751. @c The idea is that we want to move the commands which
  6752. @c are described here into the main body of the manual,
  6753. @c in the process reorganizing the manual to be
  6754. @c organized around what the user wants to do, not
  6755. @c organized around CVS commands.
  6756. @c
  6757. @c Note that many users do expect a manual which is
  6758. @c organized by command. At least some users do.
  6759. @c One good addition to the "organized by command"
  6760. @c section (if any) would be "see also" links.
  6761. @c The awk manual might be a good example; it has a
  6762. @c reference manual which is more verbose than Invoking
  6763. @c CVS but probably somewhat less verbose than CVS
  6764. @c Commands.
  6765. @menu
  6766. * Structure:: Overall structure of CVS commands
  6767. * Exit status:: Indicating CVS's success or failure
  6768. * ~/.cvsrc:: Default options with the ~/.csvrc file
  6769. * Global options:: Options you give to the left of cvs_command
  6770. * Common options:: Options you give to the right of cvs_command
  6771. * admin:: Administration
  6772. * checkout:: Checkout sources for editing
  6773. * commit:: Check files into the repository
  6774. * diff:: Show differences between revisions
  6775. * export:: Export sources from CVS, similar to checkout
  6776. * history:: Show status of files and users
  6777. * import:: Import sources into CVS, using vendor branches
  6778. * log:: Show log messages for files
  6779. * rdiff:: 'patch' format diffs between releases
  6780. * release:: Indicate that a directory is no longer in use
  6781. * update:: Bring work tree in sync with repository
  6782. @end menu
  6783. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6784. @node Structure
  6785. @appendixsec Overall structure of CVS commands
  6786. @cindex Structure
  6787. @cindex CVS command structure
  6788. @cindex Command structure
  6789. @cindex Format of CVS commands
  6790. The overall format of all @sc{cvs} commands is:
  6791. @example
  6792. cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
  6793. @end example
  6794. @table @code
  6795. @item cvs
  6796. The name of the @sc{cvs} program.
  6797. @item cvs_options
  6798. Some options that affect all sub-commands of @sc{cvs}. These are
  6799. described below.
  6800. @item cvs_command
  6801. One of several different sub-commands. Some of the commands have
  6802. aliases that can be used instead; those aliases are noted in the
  6803. reference manual for that command. There are only two situations
  6804. where you may omit @samp{cvs_command}: @samp{cvs -H} elicits a
  6805. list of available commands, and @samp{cvs -v} displays version
  6806. information on @sc{cvs} itself.
  6807. @item command_options
  6808. Options that are specific for the command.
  6809. @item command_args
  6810. Arguments to the commands.
  6811. @end table
  6812. There is unfortunately some confusion between
  6813. @code{cvs_options} and @code{command_options}.
  6814. @samp{-l}, when given as a @code{cvs_option}, only
  6815. affects some of the commands. When it is given as a
  6816. @code{command_option} is has a different meaning, and
  6817. is accepted by more commands. In other words, do not
  6818. take the above categorization too seriously. Look at
  6819. the documentation instead.
  6820. @node Exit status
  6821. @appendixsec CVS's exit status
  6822. @cindex Exit status, of CVS
  6823. @sc{cvs} can indicate to the calling environment whether it
  6824. succeeded or failed by setting its @dfn{exit status}.
  6825. The exact way of testing the exit status will vary from
  6826. one operating system to another. For example in a unix
  6827. shell script the @samp{$?} variable will be 0 if the
  6828. last command returned a successful exit status, or
  6829. greater than 0 if the exit status indicated failure.
  6830. If @sc{cvs} is successful, it returns a successful status;
  6831. if there is an error, it prints an error message and
  6832. returns a failure status. The one exception to this is
  6833. the @code{cvs diff} command. It will return a
  6834. successful status if it found no differences, or a
  6835. failure status if there were differences or if there
  6836. was an error. Because this behavior provides no good
  6837. way to detect errors, in the future it is possible that
  6838. @code{cvs diff} will be changed to behave like the
  6839. other @sc{cvs} commands.
  6840. @c It might seem like checking whether cvs -q diff
  6841. @c produces empty or non-empty output can tell whether
  6842. @c there were differences or not. But it seems like
  6843. @c there are cases with output but no differences
  6844. @c (testsuite basica-8b). It is not clear to me how
  6845. @c useful it is for a script to be able to check
  6846. @c whether there were differences.
  6847. @c FIXCVS? In previous versions of CVS, cvs diff
  6848. @c returned 0 for no differences, 1 for differences, or
  6849. @c 2 for errors. Is this behavior worth trying to
  6850. @c bring back (but what does it mean for VMS?)?
  6851. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6852. @node ~/.cvsrc
  6853. @appendixsec Default options and the ~/.cvsrc file
  6854. @cindex .cvsrc file
  6855. @cindex Option defaults
  6856. There are some @code{command_options} that are used so
  6857. often that you might have set up an alias or some other
  6858. means to make sure you always specify that option. One
  6859. example (the one that drove the implementation of the
  6860. @file{.cvsrc} support, actually) is that many people find the
  6861. default output of the @samp{diff} command to be very
  6862. hard to read, and that either context diffs or unidiffs
  6863. are much easier to understand.
  6864. The @file{~/.cvsrc} file is a way that you can add
  6865. default options to @code{cvs_commands} within cvs,
  6866. instead of relying on aliases or other shell scripts.
  6867. The format of the @file{~/.cvsrc} file is simple. The
  6868. file is searched for a line that begins with the same
  6869. name as the @code{cvs_command} being executed. If a
  6870. match is found, then the remainder of the line is split
  6871. up (at whitespace characters) into separate options and
  6872. added to the command arguments @emph{before} any
  6873. options from the command line.
  6874. If a command has two names (e.g., @code{checkout} and
  6875. @code{co}), the official name, not necessarily the one
  6876. used on the command line, will be used to match against
  6877. the file. So if this is the contents of the user's
  6878. @file{~/.cvsrc} file:
  6879. @example
  6880. log -N
  6881. diff -uN
  6882. rdiff -u
  6883. update -Pd
  6884. checkout -P
  6885. release -d
  6886. @end example
  6887. @noindent
  6888. the command @samp{cvs checkout foo} would have the
  6889. @samp{-P} option added to the arguments, as well as
  6890. @samp{cvs co foo}.
  6891. With the example file above, the output from @samp{cvs
  6892. diff foobar} will be in unidiff format. @samp{cvs diff
  6893. -c foobar} will provide context diffs, as usual.
  6894. Getting "old" format diffs would be slightly more
  6895. complicated, because @code{diff} doesn't have an option
  6896. to specify use of the "old" format, so you would need
  6897. @samp{cvs -f diff foobar}.
  6898. In place of the command name you can use @code{cvs} to
  6899. specify global options (@pxref{Global options}). For
  6900. example the following line in @file{.cvsrc}
  6901. @example
  6902. cvs -z6
  6903. @end example
  6904. @noindent
  6905. causes @sc{cvs} to use compression level 6.
  6906. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6907. @node Global options
  6908. @appendixsec Global options
  6909. @cindex Options, global
  6910. @cindex Global options
  6911. @cindex Left-hand options
  6912. The available @samp{cvs_options} (that are given to the
  6913. left of @samp{cvs_command}) are:
  6914. @table @code
  6915. @item --allow-root=@var{rootdir}
  6916. Specify legal @sc{cvsroot} directory. See
  6917. @ref{Password authentication server}.
  6918. @cindex Authentication, stream
  6919. @cindex Stream authentication
  6920. @item -a
  6921. Authenticate all communication between the client and
  6922. the server. Only has an effect on the @sc{cvs} client.
  6923. As of this writing, this is only implemented when using
  6924. a GSSAPI connection (@pxref{GSSAPI authenticated}).
  6925. Authentication prevents certain sorts of attacks
  6926. involving hijacking the active @sc{tcp} connection.
  6927. Enabling authentication does not enable encryption.
  6928. @cindex RCSBIN, overriding
  6929. @cindex Overriding RCSBIN
  6930. @item -b @var{bindir}
  6931. In @sc{cvs} 1.9.18 and older, this specified that
  6932. @sc{rcs} programs are in the @var{bindir} directory.
  6933. Current versions of @sc{cvs} do not run @sc{rcs}
  6934. programs; for compatibility this option is accepted,
  6935. but it does nothing.
  6936. @cindex TMPDIR, overriding
  6937. @cindex Overriding TMPDIR
  6938. @item -T @var{tempdir}
  6939. Use @var{tempdir} as the directory where temporary files are
  6940. located. Overrides the setting of the @code{$TMPDIR} environment
  6941. variable and any precompiled directory. This parameter should be
  6942. specified as an absolute pathname.
  6943. (When running client/server, @samp{-T} affects only the local process;
  6944. specifying @samp{-T} for the client has no effect on the server and
  6945. vice versa.)
  6946. @cindex CVSROOT, overriding
  6947. @cindex Overriding CVSROOT
  6948. @item -d @var{cvs_root_directory}
  6949. Use @var{cvs_root_directory} as the root directory
  6950. pathname of the repository. Overrides the setting of
  6951. the @code{$CVSROOT} environment variable. @xref{Repository}.
  6952. @cindex EDITOR, overriding
  6953. @cindex Overriding EDITOR
  6954. @item -e @var{editor}
  6955. Use @var{editor} to enter revision log information. Overrides the
  6956. setting of the @code{$CVSEDITOR} and @code{$EDITOR}
  6957. environment variables. For more information, see
  6958. @ref{Committing your changes}.
  6959. @item -f
  6960. Do not read the @file{~/.cvsrc} file. This
  6961. option is most often used because of the
  6962. non-orthogonality of the @sc{cvs} option set. For
  6963. example, the @samp{cvs log} option @samp{-N} (turn off
  6964. display of tag names) does not have a corresponding
  6965. option to turn the display on. So if you have
  6966. @samp{-N} in the @file{~/.cvsrc} entry for @samp{log},
  6967. you may need to use @samp{-f} to show the tag names.
  6968. @item -H
  6969. @itemx --help
  6970. Display usage information about the specified @samp{cvs_command}
  6971. (but do not actually execute the command). If you don't specify
  6972. a command name, @samp{cvs -H} displays overall help for
  6973. @sc{cvs}, including a list of other help options.
  6974. @c It seems to me it is better to document it this way
  6975. @c rather than trying to update this documentation
  6976. @c every time that we add a --help-foo option. But
  6977. @c perhaps that is confusing...
  6978. @item -l
  6979. Do not log the @samp{cvs_command} in the command history (but execute it
  6980. anyway). @xref{history}, for information on command history.
  6981. @cindex Read-only repository mode
  6982. @item -R
  6983. Turns on read-only repository mode. This allows one to check out from a
  6984. read-only repository, such as within an anoncvs server, or from a CDROM
  6985. repository.
  6986. Same effect as if the @code{CVSREADONLYFS} environment
  6987. variable is set. Using @samp{-R} can also considerably
  6988. speed up checkout's over NFS.
  6989. @cindex Read-only mode
  6990. @item -n
  6991. Do not change any files. Attempt to execute the
  6992. @samp{cvs_command}, but only to issue reports; do not remove,
  6993. update, or merge any existing files, or create any new files.
  6994. Note that @sc{cvs} will not necessarily produce exactly
  6995. the same output as without @samp{-n}. In some cases
  6996. the output will be the same, but in other cases
  6997. @sc{cvs} will skip some of the processing that would
  6998. have been required to produce the exact same output.
  6999. @item -Q
  7000. Cause the command to be really quiet; the command will only
  7001. generate output for serious problems.
  7002. @item -q
  7003. Cause the command to be somewhat quiet; informational messages,
  7004. such as reports of recursion through subdirectories, are
  7005. suppressed.
  7006. @cindex Read-only files, and -r
  7007. @item -r
  7008. Make new working files read-only. Same effect
  7009. as if the @code{$CVSREAD} environment variable is set
  7010. (@pxref{Environment variables}). The default is to
  7011. make working files writable, unless watches are on
  7012. (@pxref{Watches}).
  7013. @item -s @var{variable}=@var{value}
  7014. Set a user variable (@pxref{Variables}).
  7015. @cindex Trace
  7016. @item -t
  7017. Trace program execution; display messages showing the steps of
  7018. @sc{cvs} activity. Particularly useful with @samp{-n} to explore the
  7019. potential impact of an unfamiliar command.
  7020. @item -v
  7021. @item --version
  7022. Display version and copyright information for @sc{cvs}.
  7023. @cindex CVSREAD, overriding
  7024. @cindex Overriding CVSREAD
  7025. @item -w
  7026. Make new working files read-write. Overrides the
  7027. setting of the @code{$CVSREAD} environment variable.
  7028. Files are created read-write by default, unless @code{$CVSREAD} is
  7029. set or @samp{-r} is given.
  7030. @c Note that -w only overrides -r and CVSREAD; it has
  7031. @c no effect on files which are readonly because of
  7032. @c "cvs watch on". My guess is that is the way it
  7033. @c should be (or should "cvs -w get" on a watched file
  7034. @c be the same as a get and a cvs edit?), but I'm not
  7035. @c completely sure whether to document it this way.
  7036. @item -x
  7037. @cindex Encryption
  7038. Encrypt all communication between the client and the
  7039. server. Only has an effect on the @sc{cvs} client. As
  7040. of this writing, this is only implemented when using a
  7041. GSSAPI connection (@pxref{GSSAPI authenticated}) or a
  7042. Kerberos connection (@pxref{Kerberos authenticated}).
  7043. Enabling encryption implies that message traffic is
  7044. also authenticated. Encryption support is not
  7045. available by default; it must be enabled using a
  7046. special configure option, @file{--enable-encryption},
  7047. when you build @sc{cvs}.
  7048. @item -z @var{gzip-level}
  7049. @cindex Compression
  7050. @cindex Gzip
  7051. Set the compression level.
  7052. Valid levels are 1 (high speed, low compression) to
  7053. 9 (low speed, high compression), or 0 to disable
  7054. compression (the default).
  7055. Only has an effect on the @sc{cvs} client.
  7056. @end table
  7057. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7058. @node Common options
  7059. @appendixsec Common command options
  7060. @cindex Common options
  7061. @cindex Right-hand options
  7062. This section describes the @samp{command_options} that
  7063. are available across several @sc{cvs} commands. These
  7064. options are always given to the right of
  7065. @samp{cvs_command}. Not all
  7066. commands support all of these options; each option is
  7067. only supported for commands where it makes sense.
  7068. However, when a command has one of these options you
  7069. can almost always count on the same behavior of the
  7070. option as in other commands. (Other command options,
  7071. which are listed with the individual commands, may have
  7072. different behavior from one @sc{cvs} command to the other).
  7073. @strong{Note: the @samp{history} command is an exception; it supports
  7074. many options that conflict even with these standard options.}
  7075. @table @code
  7076. @cindex Dates
  7077. @cindex Time
  7078. @cindex Specifying dates
  7079. @item -D @var{date_spec}
  7080. Use the most recent revision no later than @var{date_spec}.
  7081. @var{date_spec} is a single argument, a date description
  7082. specifying a date in the past.
  7083. The specification is @dfn{sticky} when you use it to make a
  7084. private copy of a source file; that is, when you get a working
  7085. file using @samp{-D}, @sc{cvs} records the date you specified, so that
  7086. further updates in the same directory will use the same date
  7087. (for more information on sticky tags/dates, @pxref{Sticky tags}).
  7088. @samp{-D} is available with the @code{annotate}, @code{checkout},
  7089. @code{diff}, @code{export}, @code{history},
  7090. @code{rdiff}, @code{rtag}, @code{tag}, and @code{update} commands.
  7091. (The @code{history} command uses this option in a
  7092. slightly different way; @pxref{history options}).
  7093. @c What other formats should we accept? I don't want
  7094. @c to start accepting a whole mess of non-standard
  7095. @c new formats (there are a lot which are in wide use in
  7096. @c one context or another), but practicality does
  7097. @c dictate some level of flexibility.
  7098. @c * POSIX.2 (e.g. touch, ls output, date) and other
  7099. @c POSIX and/or de facto unix standards (e.g. at). The
  7100. @c practice here is too inconsistent to be of any use.
  7101. @c * VMS dates. This is not a formal standard, but
  7102. @c there is a published specification (see SYS$ASCTIM
  7103. @c and SYS$BINTIM in the _VMS System Services Reference
  7104. @c Manual_), it is implemented consistently in VMS
  7105. @c utilities, and VMS users will expect CVS running on
  7106. @c VMS to support this format (and if we're going to do
  7107. @c that, better to make CVS support it on all
  7108. @c platforms. Maybe).
  7109. @c
  7110. @c NOTE: The tar manual has some documentation for
  7111. @c getdate.y (just for our info; we don't want to
  7112. @c attempt to document all the formats accepted by
  7113. @c getdate.y).
  7114. @c
  7115. @c One more note: In output, CVS should consistently
  7116. @c use one date format, and that format should be one that
  7117. @c it accepts in input as well. The former isn't
  7118. @c really true (see survey below), and I'm not
  7119. @c sure that either of those formats is accepted in
  7120. @c input.
  7121. @c
  7122. @c cvs log
  7123. @c current 1996/01/02 13:45:31
  7124. @c Internet 02 Jan 1996 13:45:31 UT
  7125. @c ISO 1996-01-02 13:45:31
  7126. @c cvs ann
  7127. @c current 02-Jan-96
  7128. @c Internet-like 02 Jan 96
  7129. @c ISO 96-01-02
  7130. @c cvs status
  7131. @c current Tue Jun 11 02:54:53 1996
  7132. @c Internet [Tue,] 11 Jun 1996 02:54:53
  7133. @c ISO 1996-06-11 02:54:53
  7134. @c note: date possibly should be omitted entirely for
  7135. @c other reasons.
  7136. @c cvs editors
  7137. @c current Tue Jun 11 02:54:53 1996 GMT
  7138. @c cvs history
  7139. @c current 06/11 02:54 +0000
  7140. @c any others?
  7141. @c There is a good chance the proper solution has to
  7142. @c involve at least some level of letting the user
  7143. @c decide which format (with the default being the
  7144. @c formats CVS has always used; changing these might be
  7145. @c _very_ disruptive since scripts may very well be
  7146. @c parsing them).
  7147. @c
  7148. @c Another random bit of prior art concerning dates is
  7149. @c the strptime function which takes templates such as
  7150. @c "%m/%d/%y", and apparent a variant of getdate()
  7151. @c which also honors them. See
  7152. @c X/Open CAE Specification, System Interfaces and
  7153. @c Headers Issue 4, Version 2 (September 1994), in the
  7154. @c entry for getdate() on page 231
  7155. @cindex Timezone, in input
  7156. @cindex Zone, time, in input
  7157. A wide variety of date formats are supported by
  7158. @sc{cvs}. The most standard ones are ISO8601 (from the
  7159. International Standards Organization) and the Internet
  7160. e-mail standard (specified in RFC822 as amended by
  7161. RFC1123).
  7162. @c Probably should be doing more to spell out just what
  7163. @c the rules are, rather than just giving examples.
  7164. @c But I want to keep this simple too.
  7165. @c So I don't know....
  7166. @c A few specific issues: (1) Maybe should reassure
  7167. @c people that years after 2000
  7168. @c work (they are in the testsuite, so they do indeed
  7169. @c work). (2) What do two digit years
  7170. @c mean? Where do we accept them? (3) Local times can
  7171. @c be ambiguous or nonexistent if they fall during the
  7172. @c hour when daylight savings time goes into or out of
  7173. @c effect. Pretty obscure, so I'm not at all sure we
  7174. @c should be documenting the behavior in that case.
  7175. ISO8601 dates have many variants but a few examples
  7176. are:
  7177. @example
  7178. 1972-09-24
  7179. 1972-09-24 20:05
  7180. @end example
  7181. @c I doubt we really accept all ISO8601 format dates
  7182. @c (for example, decimal hours like 1972-09-24 20,2)
  7183. @c I'm not sure we should, many of them are pretty
  7184. @c bizarre and it has lots of gratuitous multiple ways
  7185. @c to specify the same thing.
  7186. There are a lot more ISO8601 date formats, and @sc{cvs}
  7187. accepts many of them, but you probably don't want to
  7188. hear the @emph{whole} long story :-).
  7189. @c Citing a URL here is kind of problematic given how
  7190. @c much they change and people who have old versions of
  7191. @c this manual, but in case we want to reinstate an
  7192. @c ISO8601 URL, a few are:
  7193. @c http://www.saqqara.demon.co.uk/datefmt.htm
  7194. @c http://www.cl.cam.ac.uk/~mgk25/iso-time.html
  7195. @c Citing some other ISO8601 source is probably even
  7196. @c worse :-).
  7197. In addition to the dates allowed in Internet e-mail
  7198. itself, @sc{cvs} also allows some of the fields to be
  7199. omitted. For example:
  7200. @c FIXME: Need to figure out better, and document,
  7201. @c what we want to allow the user to omit.
  7202. @c NOTE: "omit" does not imply "reorder".
  7203. @c FIXME: Need to cite a web page describing how to get
  7204. @c RFC's.
  7205. @example
  7206. 24 Sep 1972 20:05
  7207. 24 Sep
  7208. @end example
  7209. The date is interpreted as being in the
  7210. local timezone, unless a specific timezone is
  7211. specified.
  7212. These two date formats are preferred. However,
  7213. @sc{cvs} currently accepts a wide variety of other date
  7214. formats. They are intentionally not documented here in
  7215. any detail, and future versions of @sc{cvs} might not
  7216. accept all of them.
  7217. @c We should document and testsuite "now" and
  7218. @c "yesterday". "now" is mentioned in the FAQ and
  7219. @c "yesterday" is mentioned in this document (and the
  7220. @c message from "cvs import" suggesting a merge
  7221. @c command). What else? Probably some/all of the "3
  7222. @c weeks ago" family.
  7223. @c
  7224. @c Maybe at
  7225. @c some point have CVS start give warnings on "unofficial"
  7226. @c formats (many of which might be typos or user
  7227. @c misunderstandings, and/or formats people never/rarely
  7228. @c use to specify dates)?
  7229. One such format is
  7230. @code{@var{month}/@var{day}/@var{year}}. This may
  7231. confuse people who are accustomed to having the month
  7232. and day in the other order; @samp{1/4/96} is January 4,
  7233. not April 1.
  7234. Remember to quote the argument to the @samp{-D}
  7235. flag so that your shell doesn't interpret spaces as
  7236. argument separators. A command using the @samp{-D}
  7237. flag can look like this:
  7238. @example
  7239. $ cvs diff -D "1 hour ago" cvs.texinfo
  7240. @end example
  7241. @cindex Forcing a tag match
  7242. @item -f
  7243. When you specify a particular date or tag to @sc{cvs} commands, they
  7244. normally ignore files that do not contain the tag (or did not
  7245. exist prior to the date) that you specified. Use the @samp{-f} option
  7246. if you want files retrieved even when there is no match for the
  7247. tag or date. (The most recent revision of the file
  7248. will be used).
  7249. Note that even with @samp{-f}, a tag that you specify
  7250. must exist (that is, in some file, not necessary in
  7251. every file). This is so that @sc{cvs} will continue to
  7252. give an error if you mistype a tag name.
  7253. @need 800
  7254. @samp{-f} is available with these commands:
  7255. @code{annotate}, @code{checkout}, @code{export},
  7256. @code{rdiff}, @code{rtag}, and @code{update}.
  7257. @strong{WARNING: The @code{commit} and @code{remove}
  7258. commands also have a
  7259. @samp{-f} option, but it has a different behavior for
  7260. those commands. See @ref{commit options}, and
  7261. @ref{Removing files}.}
  7262. @item -k @var{kflag}
  7263. Override the default processing of RCS keywords other than
  7264. @samp{-kb}. @xref{Keyword substitution}, for the meaning of
  7265. @var{kflag}. Used with the @code{checkout} and @code{update}
  7266. commands, your @var{kflag} specification is
  7267. @dfn{sticky}; that is, when you use this option
  7268. with a @code{checkout} or @code{update} command,
  7269. @sc{cvs} associates your selected @var{kflag} with any files
  7270. it operates on, and continues to use that @var{kflag} with future
  7271. commands on the same files until you specify otherwise.
  7272. The @samp{-k} option is available with the @code{add},
  7273. @code{checkout}, @code{diff}, @code{export}, @code{import} and
  7274. @code{update} commands.
  7275. @strong{WARNING: Prior to CVS version 1.12.2, the @samp{-k} flag
  7276. overrode the @samp{-kb} indication for a binary file. This could
  7277. sometimes corrupt binary files. @xref{Merging and keywords}, for
  7278. more.}
  7279. @item -l
  7280. Local; run only in current working directory, rather than
  7281. recursing through subdirectories.
  7282. Available with the following commands: @code{annotate}, @code{checkout},
  7283. @code{commit}, @code{diff}, @code{edit}, @code{editors}, @code{export},
  7284. @code{log}, @code{rdiff}, @code{remove}, @code{rtag},
  7285. @code{status}, @code{tag}, @code{unedit}, @code{update}, @code{watch},
  7286. and @code{watchers}.
  7287. @cindex Editor, avoiding invocation of
  7288. @cindex Avoiding editor invocation
  7289. @item -m @var{message}
  7290. Use @var{message} as log information, instead of
  7291. invoking an editor.
  7292. Available with the following commands: @code{add},
  7293. @code{commit} and @code{import}.
  7294. @item -n
  7295. Do not run any tag program. (A program can be
  7296. specified to run in the modules
  7297. database (@pxref{modules}); this option bypasses it).
  7298. @strong{Note: this is not the same as the @samp{cvs -n}
  7299. program option, which you can specify to the left of a cvs command!}
  7300. Available with the @code{checkout}, @code{commit}, @code{export},
  7301. and @code{rtag} commands.
  7302. @item -P
  7303. Prune empty directories. See @ref{Removing directories}.
  7304. @item -p
  7305. Pipe the files retrieved from the repository to standard output,
  7306. rather than writing them in the current directory. Available
  7307. with the @code{checkout} and @code{update} commands.
  7308. @item -R
  7309. Process directories recursively. This is on by default.
  7310. Available with the following commands: @code{annotate}, @code{checkout},
  7311. @code{commit}, @code{diff}, @code{edit}, @code{editors}, @code{export},
  7312. @code{rdiff}, @code{remove}, @code{rtag},
  7313. @code{status}, @code{tag}, @code{unedit}, @code{update}, @code{watch},
  7314. and @code{watchers}.
  7315. @item -r @var{tag}
  7316. @cindex HEAD, special tag
  7317. @cindex BASE, special tag
  7318. Use the revision specified by the @var{tag} argument instead of the
  7319. default @dfn{head} revision. As well as arbitrary tags defined
  7320. with the @code{tag} or @code{rtag} command, two special tags are
  7321. always available: @samp{HEAD} refers to the most recent version
  7322. available in the repository, and @samp{BASE} refers to the
  7323. revision you last checked out into the current working directory.
  7324. @c FIXME: What does HEAD really mean? I believe that
  7325. @c the current answer is the head of the default branch
  7326. @c for all cvs commands except diff. For diff, it
  7327. @c seems to be (a) the head of the trunk (or the default
  7328. @c branch?) if there is no sticky tag, (b) the head of the
  7329. @c branch for the sticky tag, if there is a sticky tag.
  7330. @c (b) is ugly as it differs
  7331. @c from what HEAD means for other commands, but people
  7332. @c and/or scripts are quite possibly used to it.
  7333. @c See "head" tests in sanity.sh.
  7334. @c Probably the best fix is to introduce two new
  7335. @c special tags, ".thead" for the head of the trunk,
  7336. @c and ".bhead" for the head of the current branch.
  7337. @c Then deprecate HEAD. This has the advantage of
  7338. @c not surprising people with a change to HEAD, and a
  7339. @c side benefit of also phasing out the poorly-named
  7340. @c HEAD (see discussion of reserved tag names in node
  7341. @c "Tags"). Of course, .thead and .bhead should be
  7342. @c carefully implemented (with the implementation the
  7343. @c same for "diff" as for everyone else), test cases
  7344. @c written (similar to the ones in "head"), new tests
  7345. @c cases written for things like default branches, &c.
  7346. The tag specification is sticky when you use this
  7347. @c option
  7348. with @code{checkout} or @code{update} to make your own
  7349. copy of a file: @sc{cvs} remembers the tag and continues to use it on
  7350. future update commands, until you specify otherwise (for more information
  7351. on sticky tags/dates, @pxref{Sticky tags}).
  7352. The tag can be either a symbolic or numeric tag, as
  7353. described in @ref{Tags}, or the name of a branch, as
  7354. described in @ref{Branching and merging}.
  7355. Specifying the @samp{-q} global option along with the
  7356. @samp{-r} command option is often useful, to suppress
  7357. the warning messages when the @sc{rcs} file
  7358. does not contain the specified tag.
  7359. @strong{Note: this is not the same as the overall @samp{cvs -r} option,
  7360. which you can specify to the left of a @sc{cvs} command!}
  7361. @samp{-r} is available with the @code{checkout}, @code{commit},
  7362. @code{diff}, @code{history}, @code{export}, @code{rdiff},
  7363. @code{rtag}, and @code{update} commands.
  7364. @item -W
  7365. Specify file names that should be filtered. You can
  7366. use this option repeatedly. The spec can be a file
  7367. name pattern of the same type that you can specify in
  7368. the @file{.cvswrappers} file.
  7369. Available with the following commands: @code{import},
  7370. and @code{update}.
  7371. @end table
  7372. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7373. @node admin
  7374. @appendixsec admin---Administration
  7375. @cindex Admin (subcommand)
  7376. @itemize @bullet
  7377. @item
  7378. Requires: repository, working directory.
  7379. @item
  7380. Changes: repository.
  7381. @item
  7382. Synonym: rcs
  7383. @end itemize
  7384. This is the @sc{cvs} interface to assorted
  7385. administrative facilities. Some of them have
  7386. questionable usefulness for @sc{cvs} but exist for
  7387. historical purposes. Some of the questionable options
  7388. are likely to disappear in the future. This command
  7389. @emph{does} work recursively, so extreme care should be
  7390. used.
  7391. @cindex cvsadmin
  7392. @cindex UserAdminOptions, in CVSROOT/config
  7393. On unix, if there is a group named @code{cvsadmin},
  7394. only members of that group can run @code{cvs admin}
  7395. commands, except for those specified using the
  7396. @code{UserAdminOptions} configuration option in the
  7397. @file{CVSROOT/config} file. Options specified using
  7398. @code{UserAdminOptions} can be run by any user. See
  7399. @ref{config} for more on @code{UserAdminOptions}.
  7400. The @code{cvsadmin} group should exist on the server,
  7401. or any system running the non-client/server @sc{cvs}.
  7402. To disallow @code{cvs admin} for all users, create a
  7403. group with no users in it. On NT, the @code{cvsadmin}
  7404. feature does not exist and all users
  7405. can run @code{cvs admin}.
  7406. @menu
  7407. * admin options:: admin options
  7408. @end menu
  7409. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  7410. @node admin options
  7411. @appendixsubsec admin options
  7412. Some of these options have questionable usefulness for
  7413. @sc{cvs} but exist for historical purposes. Some even
  7414. make it impossible to use @sc{cvs} until you undo the
  7415. effect!
  7416. @table @code
  7417. @item -A@var{oldfile}
  7418. Might not work together with @sc{cvs}. Append the
  7419. access list of @var{oldfile} to the access list of the
  7420. @sc{rcs} file.
  7421. @item -a@var{logins}
  7422. Might not work together with @sc{cvs}. Append the
  7423. login names appearing in the comma-separated list
  7424. @var{logins} to the access list of the @sc{rcs} file.
  7425. @item -b[@var{rev}]
  7426. Set the default branch to @var{rev}. In @sc{cvs}, you
  7427. normally do not manipulate default branches; sticky
  7428. tags (@pxref{Sticky tags}) are a better way to decide
  7429. which branch you want to work on. There is one reason
  7430. to run @code{cvs admin -b}: to revert to the vendor's
  7431. version when using vendor branches (@pxref{Reverting
  7432. local changes}).
  7433. There can be no space between @samp{-b} and its argument.
  7434. @c Hmm, we don't document the usage where rev is
  7435. @c omitted. Maybe that usage can/should be deprecated
  7436. @c (and replaced with -bHEAD or something?) (so we can toss
  7437. @c the optional argument). Note that -bHEAD does not
  7438. @c work, as of 17 Sep 1997, but probably will once "cvs
  7439. @c admin" is internal to CVS.
  7440. @cindex Comment leader
  7441. @item -c@var{string}
  7442. Sets the comment leader to @var{string}. The comment
  7443. leader is not used by current versions of @sc{cvs} or
  7444. @sc{rcs} 5.7. Therefore, you can almost surely not
  7445. worry about it. @xref{Keyword substitution}.
  7446. @item -e[@var{logins}]
  7447. Might not work together with @sc{cvs}. Erase the login
  7448. names appearing in the comma-separated list
  7449. @var{logins} from the access list of the RCS file. If
  7450. @var{logins} is omitted, erase the entire access list.
  7451. There can be no space between @samp{-e} and its argument.
  7452. @item -I
  7453. Run interactively, even if the standard input is not a
  7454. terminal. This option does not work with the
  7455. client/server @sc{cvs} and is likely to disappear in
  7456. a future release of @sc{cvs}.
  7457. @item -i
  7458. Useless with @sc{cvs}. This creates and initializes a
  7459. new @sc{rcs} file, without depositing a revision. With
  7460. @sc{cvs}, add files with the @code{cvs add} command
  7461. (@pxref{Adding files}).
  7462. @item -k@var{subst}
  7463. Set the default keyword
  7464. substitution to @var{subst}. @xref{Keyword
  7465. substitution}. Giving an explicit @samp{-k} option to
  7466. @code{cvs update}, @code{cvs export}, or @code{cvs
  7467. checkout} overrides this default.
  7468. @item -l[@var{rev}]
  7469. Lock the revision with number @var{rev}. If a branch
  7470. is given, lock the latest revision on that branch. If
  7471. @var{rev} is omitted, lock the latest revision on the
  7472. default branch. There can be no space between
  7473. @samp{-l} and its argument.
  7474. This can be used in conjunction with the
  7475. @file{rcslock.pl} script in the @file{contrib}
  7476. directory of the @sc{cvs} source distribution to
  7477. provide reserved checkouts (where only one user can be
  7478. editing a given file at a time). See the comments in
  7479. that file for details (and see the @file{README} file
  7480. in that directory for disclaimers about the unsupported
  7481. nature of contrib). According to comments in that
  7482. file, locking must set to strict (which is the default).
  7483. @item -L
  7484. Set locking to strict. Strict locking means that the
  7485. owner of an RCS file is not exempt from locking for
  7486. checkin. For use with @sc{cvs}, strict locking must be
  7487. set; see the discussion under the @samp{-l} option above.
  7488. @cindex Changing a log message
  7489. @cindex Replacing a log message
  7490. @cindex Correcting a log message
  7491. @cindex Fixing a log message
  7492. @cindex Log message, correcting
  7493. @item -m@var{rev}:@var{msg}
  7494. Replace the log message of revision @var{rev} with
  7495. @var{msg}.
  7496. @c The rcs -M option, to suppress sending mail, has never been
  7497. @c documented as a cvs admin option.
  7498. @item -N@var{name}[:[@var{rev}]]
  7499. Act like @samp{-n}, except override any previous
  7500. assignment of @var{name}. For use with magic branches,
  7501. see @ref{Magic branch numbers}.
  7502. @item -n@var{name}[:[@var{rev}]]
  7503. Associate the symbolic name @var{name} with the branch
  7504. or revision @var{rev}. It is normally better to use
  7505. @samp{cvs tag} or @samp{cvs rtag} instead. Delete the
  7506. symbolic name if both @samp{:} and @var{rev} are
  7507. omitted; otherwise, print an error message if
  7508. @var{name} is already associated with another number.
  7509. If @var{rev} is symbolic, it is expanded before
  7510. association. A @var{rev} consisting of a branch number
  7511. followed by a @samp{.} stands for the current latest
  7512. revision in the branch. A @samp{:} with an empty
  7513. @var{rev} stands for the current latest revision on the
  7514. default branch, normally the trunk. For example,
  7515. @samp{cvs admin -n@var{name}:} associates @var{name} with the
  7516. current latest revision of all the RCS files;
  7517. this contrasts with @samp{cvs admin -n@var{name}:$} which
  7518. associates @var{name} with the revision numbers
  7519. extracted from keyword strings in the corresponding
  7520. working files.
  7521. @cindex Deleting revisions
  7522. @cindex Outdating revisions
  7523. @cindex Saving space
  7524. @item -o@var{range}
  7525. Deletes (@dfn{outdates}) the revisions given by
  7526. @var{range}.
  7527. Note that this command can be quite dangerous unless
  7528. you know @emph{exactly} what you are doing (for example
  7529. see the warnings below about how the
  7530. @var{rev1}:@var{rev2} syntax is confusing).
  7531. If you are short on disc this option might help you.
  7532. But think twice before using it---there is no way short
  7533. of restoring the latest backup to undo this command!
  7534. If you delete different revisions than you planned,
  7535. either due to carelessness or (heaven forbid) a @sc{cvs}
  7536. bug, there is no opportunity to correct the error
  7537. before the revisions are deleted. It probably would be
  7538. a good idea to experiment on a copy of the repository
  7539. first.
  7540. Specify @var{range} in one of the following ways:
  7541. @table @code
  7542. @item @var{rev1}::@var{rev2}
  7543. Collapse all revisions between rev1 and rev2, so that
  7544. @sc{cvs} only stores the differences associated with going
  7545. from rev1 to rev2, not intermediate steps. For
  7546. example, after @samp{-o 1.3::1.5} one can retrieve
  7547. revision 1.3, revision 1.5, or the differences to get
  7548. from 1.3 to 1.5, but not the revision 1.4, or the
  7549. differences between 1.3 and 1.4. Other examples:
  7550. @samp{-o 1.3::1.4} and @samp{-o 1.3::1.3} have no
  7551. effect, because there are no intermediate revisions to
  7552. remove.
  7553. @item ::@var{rev}
  7554. Collapse revisions between the beginning of the branch
  7555. containing @var{rev} and @var{rev} itself. The
  7556. branchpoint and @var{rev} are left intact. For
  7557. example, @samp{-o ::1.3.2.6} deletes revision 1.3.2.1,
  7558. revision 1.3.2.5, and everything in between, but leaves
  7559. 1.3 and 1.3.2.6 intact.
  7560. @item @var{rev}::
  7561. Collapse revisions between @var{rev} and the end of the
  7562. branch containing @var{rev}. Revision @var{rev} is
  7563. left intact but the head revision is deleted.
  7564. @item @var{rev}
  7565. Delete the revision @var{rev}. For example, @samp{-o
  7566. 1.3} is equivalent to @samp{-o 1.2::1.4}.
  7567. @item @var{rev1}:@var{rev2}
  7568. Delete the revisions from @var{rev1} to @var{rev2},
  7569. inclusive, on the same branch. One will not be able to
  7570. retrieve @var{rev1} or @var{rev2} or any of the
  7571. revisions in between. For example, the command
  7572. @samp{cvs admin -oR_1_01:R_1_02 .} is rarely useful.
  7573. It means to delete revisions up to, and including, the
  7574. tag R_1_02. But beware! If there are files that have not
  7575. changed between R_1_02 and R_1_03 the file will have
  7576. @emph{the same} numerical revision number assigned to
  7577. the tags R_1_02 and R_1_03. So not only will it be
  7578. impossible to retrieve R_1_02; R_1_03 will also have to
  7579. be restored from the tapes! In most cases you want to
  7580. specify @var{rev1}::@var{rev2} instead.
  7581. @item :@var{rev}
  7582. Delete revisions from the beginning of the
  7583. branch containing @var{rev} up to and including
  7584. @var{rev}.
  7585. @item @var{rev}:
  7586. Delete revisions from revision @var{rev}, including
  7587. @var{rev} itself, to the end of the branch containing
  7588. @var{rev}.
  7589. @end table
  7590. None of the revisions to be deleted may have
  7591. branches or locks.
  7592. If any of the revisions to be deleted have symbolic
  7593. names, and one specifies one of the @samp{::} syntaxes,
  7594. then @sc{cvs} will give an error and not delete any
  7595. revisions. If you really want to delete both the
  7596. symbolic names and the revisions, first delete the
  7597. symbolic names with @code{cvs tag -d}, then run
  7598. @code{cvs admin -o}. If one specifies the
  7599. non-@samp{::} syntaxes, then @sc{cvs} will delete the
  7600. revisions but leave the symbolic names pointing to
  7601. nonexistent revisions. This behavior is preserved for
  7602. compatibility with previous versions of @sc{cvs}, but
  7603. because it isn't very useful, in the future it may
  7604. change to be like the @samp{::} case.
  7605. Due to the way @sc{cvs} handles branches @var{rev}
  7606. cannot be specified symbolically if it is a branch.
  7607. @xref{Magic branch numbers}, for an explanation.
  7608. @c FIXME: is this still true? I suspect not.
  7609. Make sure that no-one has checked out a copy of the
  7610. revision you outdate. Strange things will happen if he
  7611. starts to edit it and tries to check it back in. For
  7612. this reason, this option is not a good way to take back
  7613. a bogus commit; commit a new revision undoing the bogus
  7614. change instead (@pxref{Merging two revisions}).
  7615. @item -q
  7616. Run quietly; do not print diagnostics.
  7617. @item -s@var{state}[:@var{rev}]
  7618. Useful with @sc{cvs}. Set the state attribute of the
  7619. revision @var{rev} to @var{state}. If @var{rev} is a
  7620. branch number, assume the latest revision on that
  7621. branch. If @var{rev} is omitted, assume the latest
  7622. revision on the default branch. Any identifier is
  7623. acceptable for @var{state}. A useful set of states is
  7624. @samp{Exp} (for experimental), @samp{Stab} (for
  7625. stable), and @samp{Rel} (for released). By default,
  7626. the state of a new revision is set to @samp{Exp} when
  7627. it is created. The state is visible in the output from
  7628. @var{cvs log} (@pxref{log}), and in the
  7629. @samp{$@splitrcskeyword{}Log$} and @samp{$@splitrcskeyword{}State$} keywords
  7630. (@pxref{Keyword substitution}). Note that @sc{cvs}
  7631. uses the @code{dead} state for its own purposes; to
  7632. take a file to or from the @code{dead} state use
  7633. commands like @code{cvs remove} and @code{cvs add}, not
  7634. @code{cvs admin -s}.
  7635. @item -t[@var{file}]
  7636. Useful with @sc{cvs}. Write descriptive text from the
  7637. contents of the named @var{file} into the RCS file,
  7638. deleting the existing text. The @var{file} pathname
  7639. may not begin with @samp{-}. The descriptive text can be seen in the
  7640. output from @samp{cvs log} (@pxref{log}).
  7641. There can be no space between @samp{-t} and its argument.
  7642. If @var{file} is omitted,
  7643. obtain the text from standard input, terminated by
  7644. end-of-file or by a line containing @samp{.} by itself.
  7645. Prompt for the text if interaction is possible; see
  7646. @samp{-I}.
  7647. @item -t-@var{string}
  7648. Similar to @samp{-t@var{file}}. Write descriptive text
  7649. from the @var{string} into the @sc{rcs} file, deleting
  7650. the existing text.
  7651. There can be no space between @samp{-t} and its argument.
  7652. @c The rcs -T option, do not update last-mod time for
  7653. @c minor changes, has never been documented as a
  7654. @c cvs admin option.
  7655. @item -U
  7656. Set locking to non-strict. Non-strict locking means
  7657. that the owner of a file need not lock a revision for
  7658. checkin. For use with @sc{cvs}, strict locking must be
  7659. set; see the discussion under the @samp{-l} option
  7660. above.
  7661. @item -u[@var{rev}]
  7662. See the option @samp{-l} above, for a discussion of
  7663. using this option with @sc{cvs}. Unlock the revision
  7664. with number @var{rev}. If a branch is given, unlock
  7665. the latest revision on that branch. If @var{rev} is
  7666. omitted, remove the latest lock held by the caller.
  7667. Normally, only the locker of a revision may unlock it;
  7668. somebody else unlocking a revision breaks the lock.
  7669. This causes the original locker to be sent a @code{commit}
  7670. notification (@pxref{Getting Notified}).
  7671. There can be no space between @samp{-u} and its argument.
  7672. @item -V@var{n}
  7673. In previous versions of @sc{cvs}, this option meant to
  7674. write an @sc{rcs} file which would be acceptable to
  7675. @sc{rcs} version @var{n}, but it is now obsolete and
  7676. specifying it will produce an error.
  7677. @c Note that -V without an argument has never been
  7678. @c documented as a cvs admin option.
  7679. @item -x@var{suffixes}
  7680. In previous versions of @sc{cvs}, this was documented
  7681. as a way of specifying the names of the @sc{rcs}
  7682. files. However, @sc{cvs} has always required that the
  7683. @sc{rcs} files used by @sc{cvs} end in @samp{,v}, so
  7684. this option has never done anything useful.
  7685. @c The rcs -z option, to specify the timezone, has
  7686. @c never been documented as a cvs admin option.
  7687. @end table
  7688. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7689. @node checkout
  7690. @appendixsec checkout---Check out sources for editing
  7691. @cindex checkout (subcommand)
  7692. @cindex co (subcommand)
  7693. @itemize @bullet
  7694. @item
  7695. Synopsis: checkout [options] modules@dots{}
  7696. @item
  7697. Requires: repository.
  7698. @item
  7699. Changes: working directory.
  7700. @item
  7701. Synonyms: co, get
  7702. @end itemize
  7703. Create or update a working directory containing copies of the
  7704. source files specified by @var{modules}. You must execute
  7705. @code{checkout} before using most of the other @sc{cvs}
  7706. commands, since most of them operate on your working
  7707. directory.
  7708. The @var{modules} are either
  7709. symbolic names for some
  7710. collection of source directories and files, or paths to
  7711. directories or files in the repository. The symbolic
  7712. names are defined in the @samp{modules} file.
  7713. @xref{modules}.
  7714. @c Needs an example, particularly of the non-"modules"
  7715. @c case but probably of both.
  7716. @c FIXME: this seems like a very odd place to introduce
  7717. @c people to how CVS works. The bit about unreserved
  7718. @c checkouts is also misleading as it depends on how
  7719. @c things are set up.
  7720. Depending on the modules you specify, @code{checkout} may
  7721. recursively create directories and populate them with
  7722. the appropriate source files. You can then edit these
  7723. source files at any time (regardless of whether other
  7724. software developers are editing their own copies of the
  7725. sources); update them to include new changes applied by
  7726. others to the source repository; or commit your work as
  7727. a permanent change to the source repository.
  7728. Note that @code{checkout} is used to create
  7729. directories. The top-level directory created is always
  7730. added to the directory where @code{checkout} is
  7731. invoked, and usually has the same name as the specified
  7732. module. In the case of a module alias, the created
  7733. sub-directory may have a different name, but you can be
  7734. sure that it will be a sub-directory, and that
  7735. @code{checkout} will show the relative path leading to
  7736. each file as it is extracted into your private work
  7737. area (unless you specify the @samp{-Q} global option).
  7738. The files created by @code{checkout} are created
  7739. read-write, unless the @samp{-r} option to @sc{cvs}
  7740. (@pxref{Global options}) is specified, the
  7741. @code{CVSREAD} environment variable is specified
  7742. (@pxref{Environment variables}), or a watch is in
  7743. effect for that file (@pxref{Watches}).
  7744. Note that running @code{checkout} on a directory that was already
  7745. built by a prior @code{checkout} is also permitted.
  7746. This is similar to specifying the @samp{-d} option
  7747. to the @code{update} command in the sense that new
  7748. directories that have been created in the repository
  7749. will appear in your work area.
  7750. However, @code{checkout} takes a module name whereas
  7751. @code{update} takes a directory name. Also
  7752. to use @code{checkout} this way it must be run from the
  7753. top level directory (where you originally ran
  7754. @code{checkout} from), so before you run
  7755. @code{checkout} to update an existing directory, don't
  7756. forget to change your directory to the top level
  7757. directory.
  7758. For the output produced by the @code{checkout} command
  7759. see @ref{update output}.
  7760. @menu
  7761. * checkout options:: checkout options
  7762. * checkout examples:: checkout examples
  7763. @end menu
  7764. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  7765. @node checkout options
  7766. @appendixsubsec checkout options
  7767. These standard options are supported by @code{checkout}
  7768. (@pxref{Common options}, for a complete description of
  7769. them):
  7770. @table @code
  7771. @item -D @var{date}
  7772. Use the most recent revision no later than @var{date}.
  7773. This option is sticky, and implies @samp{-P}. See
  7774. @ref{Sticky tags}, for more information on sticky tags/dates.
  7775. @item -f
  7776. Only useful with the @samp{-D @var{date}} or @samp{-r
  7777. @var{tag}} flags. If no matching revision is found,
  7778. retrieve the most recent revision (instead of ignoring
  7779. the file).
  7780. @item -k @var{kflag}
  7781. Process keywords according to @var{kflag}. See
  7782. @ref{Keyword substitution}.
  7783. This option is sticky; future updates of
  7784. this file in this working directory will use the same
  7785. @var{kflag}. The @code{status} command can be viewed
  7786. to see the sticky options. See @ref{Invoking CVS}, for
  7787. more information on the @code{status} command.
  7788. @item -l
  7789. Local; run only in current working directory.
  7790. @item -n
  7791. Do not run any checkout program (as specified
  7792. with the @samp{-o} option in the modules file;
  7793. @pxref{modules}).
  7794. @item -P
  7795. Prune empty directories. See @ref{Moving directories}.
  7796. @item -p
  7797. Pipe files to the standard output.
  7798. @item -R
  7799. Checkout directories recursively. This option is on by default.
  7800. @item -r @var{tag}
  7801. Use revision @var{tag}. This option is sticky, and implies @samp{-P}.
  7802. See @ref{Sticky tags}, for more information on sticky tags/dates.
  7803. @end table
  7804. In addition to those, you can use these special command
  7805. options with @code{checkout}:
  7806. @table @code
  7807. @item -A
  7808. Reset any sticky tags, dates, or @samp{-k} options.
  7809. See @ref{Sticky tags}, for more information on sticky tags/dates.
  7810. @item -c
  7811. Copy the module file, sorted, to the standard output,
  7812. instead of creating or modifying any files or
  7813. directories in your working directory.
  7814. @item -d @var{dir}
  7815. Create a directory called @var{dir} for the working
  7816. files, instead of using the module name. In general,
  7817. using this flag is equivalent to using @samp{mkdir
  7818. @var{dir}; cd @var{dir}} followed by the checkout
  7819. command without the @samp{-d} flag.
  7820. There is an important exception, however. It is very
  7821. convenient when checking out a single item to have the
  7822. output appear in a directory that doesn't contain empty
  7823. intermediate directories. In this case @emph{only},
  7824. @sc{cvs} tries to ``shorten'' pathnames to avoid those empty
  7825. directories.
  7826. For example, given a module @samp{foo} that contains
  7827. the file @samp{bar.c}, the command @samp{cvs co -d dir
  7828. foo} will create directory @samp{dir} and place
  7829. @samp{bar.c} inside. Similarly, given a module
  7830. @samp{bar} which has subdirectory @samp{baz} wherein
  7831. there is a file @samp{quux.c}, the command @samp{cvs co
  7832. -d dir bar/baz} will create directory @samp{dir} and
  7833. place @samp{quux.c} inside.
  7834. Using the @samp{-N} flag will defeat this behavior.
  7835. Given the same module definitions above, @samp{cvs co
  7836. -N -d dir foo} will create directories @samp{dir/foo}
  7837. and place @samp{bar.c} inside, while @samp{cvs co -N -d
  7838. dir bar/baz} will create directories @samp{dir/bar/baz}
  7839. and place @samp{quux.c} inside.
  7840. @item -j @var{tag}
  7841. With two @samp{-j} options, merge changes from the
  7842. revision specified with the first @samp{-j} option to
  7843. the revision specified with the second @samp{j} option,
  7844. into the working directory.
  7845. With one @samp{-j} option, merge changes from the
  7846. ancestor revision to the revision specified with the
  7847. @samp{-j} option, into the working directory. The
  7848. ancestor revision is the common ancestor of the
  7849. revision which the working directory is based on, and
  7850. the revision specified in the @samp{-j} option.
  7851. In addition, each -j option can contain an optional
  7852. date specification which, when used with branches, can
  7853. limit the chosen revision to one within a specific
  7854. date. An optional date is specified by adding a colon
  7855. (:) to the tag:
  7856. @samp{-j@var{Symbolic_Tag}:@var{Date_Specifier}}.
  7857. @xref{Branching and merging}.
  7858. @item -N
  7859. Only useful together with @samp{-d @var{dir}}. With
  7860. this option, @sc{cvs} will not ``shorten'' module paths
  7861. in your working directory when you check out a single
  7862. module. See the @samp{-d} flag for examples and a
  7863. discussion.
  7864. @item -s
  7865. Like @samp{-c}, but include the status of all modules,
  7866. and sort it by the status string. @xref{modules}, for
  7867. info about the @samp{-s} option that is used inside the
  7868. modules file to set the module status.
  7869. @end table
  7870. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  7871. @node checkout examples
  7872. @appendixsubsec checkout examples
  7873. Get a copy of the module @samp{tc}:
  7874. @example
  7875. $ cvs checkout tc
  7876. @end example
  7877. Get a copy of the module @samp{tc} as it looked one day
  7878. ago:
  7879. @example
  7880. $ cvs checkout -D yesterday tc
  7881. @end example
  7882. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7883. @node commit
  7884. @appendixsec commit---Check files into the repository
  7885. @cindex commit (subcommand)
  7886. @itemize @bullet
  7887. @item
  7888. Synopsis: commit [-lnRf] [-m 'log_message' |
  7889. -F file] [-r revision] [files@dots{}]
  7890. @item
  7891. Requires: working directory, repository.
  7892. @item
  7893. Changes: repository.
  7894. @item
  7895. Synonym: ci
  7896. @end itemize
  7897. Use @code{commit} when you want to incorporate changes
  7898. from your working source files into the source
  7899. repository.
  7900. If you don't specify particular files to commit, all of
  7901. the files in your working current directory are
  7902. examined. @code{commit} is careful to change in the
  7903. repository only those files that you have really
  7904. changed. By default (or if you explicitly specify the
  7905. @samp{-R} option), files in subdirectories are also
  7906. examined and committed if they have changed; you can
  7907. use the @samp{-l} option to limit @code{commit} to the
  7908. current directory only.
  7909. @code{commit} verifies that the selected files are up
  7910. to date with the current revisions in the source
  7911. repository; it will notify you, and exit without
  7912. committing, if any of the specified files must be made
  7913. current first with @code{update} (@pxref{update}).
  7914. @code{commit} does not call the @code{update} command
  7915. for you, but rather leaves that for you to do when the
  7916. time is right.
  7917. When all is well, an editor is invoked to allow you to
  7918. enter a log message that will be written to one or more
  7919. logging programs (@pxref{modules}, and @pxref{loginfo})
  7920. and placed in the @sc{rcs} file inside the
  7921. repository. This log message can be retrieved with the
  7922. @code{log} command; see @ref{log}. You can specify the
  7923. log message on the command line with the @samp{-m
  7924. @var{message}} option, and thus avoid the editor invocation,
  7925. or use the @samp{-F @var{file}} option to specify
  7926. that the argument file contains the log message.
  7927. @menu
  7928. * commit options:: commit options
  7929. * commit examples:: commit examples
  7930. @end menu
  7931. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  7932. @node commit options
  7933. @appendixsubsec commit options
  7934. These standard options are supported by @code{commit}
  7935. (@pxref{Common options}, for a complete description of
  7936. them):
  7937. @table @code
  7938. @item -l
  7939. Local; run only in current working directory.
  7940. @item -R
  7941. Commit directories recursively. This is on by default.
  7942. @item -r @var{revision}
  7943. Commit to @var{revision}. @var{revision} must be
  7944. either a branch, or a revision on the main trunk that
  7945. is higher than any existing revision number
  7946. (@pxref{Assigning revisions}). You
  7947. cannot commit to a specific revision on a branch.
  7948. @c FIXME: Need xref for branch case.
  7949. @end table
  7950. @code{commit} also supports these options:
  7951. @table @code
  7952. @item -F @var{file}
  7953. Read the log message from @var{file}, instead
  7954. of invoking an editor.
  7955. @item -f
  7956. Note that this is not the standard behavior of
  7957. the @samp{-f} option as defined in @ref{Common options}.
  7958. Force @sc{cvs} to commit a new revision even if you haven't
  7959. made any changes to the file. If the current revision
  7960. of @var{file} is 1.7, then the following two commands
  7961. are equivalent:
  7962. @example
  7963. $ cvs commit -f @var{file}
  7964. $ cvs commit -r 1.8 @var{file}
  7965. @end example
  7966. @c This is odd, but it's how CVS has worked for some
  7967. @c time.
  7968. The @samp{-f} option disables recursion (i.e., it
  7969. implies @samp{-l}). To force @sc{cvs} to commit a new
  7970. revision for all files in all subdirectories, you must
  7971. use @samp{-f -R}.
  7972. @item -m @var{message}
  7973. Use @var{message} as the log message, instead of
  7974. invoking an editor.
  7975. @end table
  7976. @need 2000
  7977. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  7978. @node commit examples
  7979. @appendixsubsec commit examples
  7980. @c FIXME: this material wants to be somewhere
  7981. @c in "Branching and merging".
  7982. @appendixsubsubsec Committing to a branch
  7983. You can commit to a branch revision (one that has an
  7984. even number of dots) with the @samp{-r} option. To
  7985. create a branch revision, use the @samp{-b} option
  7986. of the @code{rtag} or @code{tag} commands
  7987. (@pxref{Branching and merging}). Then, either @code{checkout} or
  7988. @code{update} can be used to base your sources on the
  7989. newly created branch. From that point on, all
  7990. @code{commit} changes made within these working sources
  7991. will be automatically added to a branch revision,
  7992. thereby not disturbing main-line development in any
  7993. way. For example, if you had to create a patch to the
  7994. 1.2 version of the product, even though the 2.0 version
  7995. is already under development, you might do:
  7996. @example
  7997. $ cvs rtag -b -r FCS1_2 FCS1_2_Patch product_module
  7998. $ cvs checkout -r FCS1_2_Patch product_module
  7999. $ cd product_module
  8000. [[ hack away ]]
  8001. $ cvs commit
  8002. @end example
  8003. @noindent
  8004. This works automatically since the @samp{-r} option is
  8005. sticky.
  8006. @appendixsubsubsec Creating the branch after editing
  8007. Say you have been working on some extremely
  8008. experimental software, based on whatever revision you
  8009. happened to checkout last week. If others in your
  8010. group would like to work on this software with you, but
  8011. without disturbing main-line development, you could
  8012. commit your change to a new branch. Others can then
  8013. checkout your experimental stuff and utilize the full
  8014. benefit of @sc{cvs} conflict resolution. The scenario might
  8015. look like:
  8016. @c FIXME: Should we be recommending tagging the branchpoint?
  8017. @example
  8018. [[ hacked sources are present ]]
  8019. $ cvs tag -b EXPR1
  8020. $ cvs update -r EXPR1
  8021. $ cvs commit
  8022. @end example
  8023. The @code{update} command will make the @samp{-r
  8024. EXPR1} option sticky on all files. Note that your
  8025. changes to the files will never be removed by the
  8026. @code{update} command. The @code{commit} will
  8027. automatically commit to the correct branch, because the
  8028. @samp{-r} is sticky. You could also do like this:
  8029. @c FIXME: Should we be recommending tagging the branchpoint?
  8030. @example
  8031. [[ hacked sources are present ]]
  8032. $ cvs tag -b EXPR1
  8033. $ cvs commit -r EXPR1
  8034. @end example
  8035. @noindent
  8036. but then, only those files that were changed by you
  8037. will have the @samp{-r EXPR1} sticky flag. If you hack
  8038. away, and commit without specifying the @samp{-r EXPR1}
  8039. flag, some files may accidentally end up on the main
  8040. trunk.
  8041. To work with you on the experimental change, others
  8042. would simply do
  8043. @example
  8044. $ cvs checkout -r EXPR1 whatever_module
  8045. @end example
  8046. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8047. @node diff
  8048. @appendixsec diff---Show differences between revisions
  8049. @cindex diff (subcommand)
  8050. @itemize @bullet
  8051. @item
  8052. Synopsis: diff [-lR] [-k kflag] [format_options] [[-r rev1 | -D date1] [-r rev2 | -D date2]] [files@dots{}]
  8053. @item
  8054. Requires: working directory, repository.
  8055. @item
  8056. Changes: nothing.
  8057. @end itemize
  8058. The @code{diff} command is used to compare different
  8059. revisions of files. The default action is to compare
  8060. your working files with the revisions they were based
  8061. on, and report any differences that are found.
  8062. If any file names are given, only those files are
  8063. compared. If any directories are given, all files
  8064. under them will be compared.
  8065. The exit status for diff is different than for other
  8066. @sc{cvs} commands; for details @ref{Exit status}.
  8067. @menu
  8068. * diff options:: diff options
  8069. * diff examples:: diff examples
  8070. @end menu
  8071. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8072. @node diff options
  8073. @appendixsubsec diff options
  8074. These standard options are supported by @code{diff}
  8075. (@pxref{Common options}, for a complete description of
  8076. them):
  8077. @table @code
  8078. @item -D @var{date}
  8079. Use the most recent revision no later than @var{date}.
  8080. See @samp{-r} for how this affects the comparison.
  8081. @item -k @var{kflag}
  8082. Process keywords according to @var{kflag}. See
  8083. @ref{Keyword substitution}.
  8084. @item -l
  8085. Local; run only in current working directory.
  8086. @item -R
  8087. Examine directories recursively. This option is on by
  8088. default.
  8089. @item -r @var{tag}
  8090. Compare with revision @var{tag}. Zero, one or two
  8091. @samp{-r} options can be present. With no @samp{-r}
  8092. option, the working file will be compared with the
  8093. revision it was based on. With one @samp{-r}, that
  8094. revision will be compared to your current working file.
  8095. With two @samp{-r} options those two revisions will be
  8096. compared (and your working file will not affect the
  8097. outcome in any way).
  8098. @c We should be a lot more explicit, with examples,
  8099. @c about the difference between "cvs diff" and "cvs
  8100. @c diff -r HEAD". This often confuses new users.
  8101. One or both @samp{-r} options can be replaced by a
  8102. @samp{-D @var{date}} option, described above.
  8103. @end table
  8104. @c Conceptually, this is a disaster. There are 3
  8105. @c zillion diff formats that we support via the diff
  8106. @c library. It is not obvious to me that we should
  8107. @c document them all. Maybe just the most common ones
  8108. @c like -c and -u, and think about phasing out the
  8109. @c obscure ones.
  8110. @c FIXCVS: also should be a way to specify an external
  8111. @c diff program (which can be different for different
  8112. @c file types) and pass through
  8113. @c arbitrary options, so that the user can do
  8114. @c "--pass=-Z --pass=foo" or something even if CVS
  8115. @c doesn't know about the "-Z foo" option to diff.
  8116. @c This would fit nicely with deprecating/eliminating
  8117. @c the obscure options of the diff library, because it
  8118. @c would let people specify an external GNU diff if
  8119. @c they are into that sort of thing.
  8120. The following options specify the format of the
  8121. output. They have the same meaning as in GNU diff.
  8122. Most options have two equivalent names, one of which is a single letter
  8123. preceded by @samp{-}, and the other of which is a long name preceded by
  8124. @samp{--}.
  8125. @table @samp
  8126. @item -@var{lines}
  8127. Show @var{lines} (an integer) lines of context. This option does not
  8128. specify an output format by itself; it has no effect unless it is
  8129. combined with @samp{-c} or @samp{-u}. This option is obsolete. For proper
  8130. operation, @code{patch} typically needs at least two lines of context.
  8131. @item -a
  8132. Treat all files as text and compare them line-by-line, even if they
  8133. do not seem to be text.
  8134. @item -b
  8135. Ignore trailing white space and consider all other sequences of one or
  8136. more white space characters to be equivalent.
  8137. @item -B
  8138. Ignore changes that just insert or delete blank lines.
  8139. @item --binary
  8140. Read and write data in binary mode.
  8141. @item --brief
  8142. Report only whether the files differ, not the details of the
  8143. differences.
  8144. @item -c
  8145. Use the context output format.
  8146. @item -C @var{lines}
  8147. @itemx --context@r{[}=@var{lines}@r{]}
  8148. Use the context output format, showing @var{lines} (an integer) lines of
  8149. context, or three if @var{lines} is not given.
  8150. For proper operation, @code{patch} typically needs at least two lines of
  8151. context.
  8152. @item --changed-group-format=@var{format}
  8153. Use @var{format} to output a line group containing differing lines from
  8154. both files in if-then-else format. @xref{Line group formats}.
  8155. @item -d
  8156. Change the algorithm to perhaps find a smaller set of changes. This makes
  8157. @code{diff} slower (sometimes much slower).
  8158. @item -e
  8159. @itemx --ed
  8160. Make output that is a valid @code{ed} script.
  8161. @item --expand-tabs
  8162. Expand tabs to spaces in the output, to preserve the alignment of tabs
  8163. in the input files.
  8164. @item -f
  8165. Make output that looks vaguely like an @code{ed} script but has changes
  8166. in the order they appear in the file.
  8167. @item -F @var{regexp}
  8168. In context and unified format, for each hunk of differences, show some
  8169. of the last preceding line that matches @var{regexp}.
  8170. @item --forward-ed
  8171. Make output that looks vaguely like an @code{ed} script but has changes
  8172. in the order they appear in the file.
  8173. @item -H
  8174. Use heuristics to speed handling of large files that have numerous
  8175. scattered small changes.
  8176. @item --horizon-lines=@var{lines}
  8177. Do not discard the last @var{lines} lines of the common prefix
  8178. and the first @var{lines} lines of the common suffix.
  8179. @item -i
  8180. Ignore changes in case; consider upper- and lower-case letters
  8181. equivalent.
  8182. @item -I @var{regexp}
  8183. Ignore changes that just insert or delete lines that match @var{regexp}.
  8184. @item --ifdef=@var{name}
  8185. Make merged if-then-else output using @var{name}.
  8186. @item --ignore-all-space
  8187. Ignore white space when comparing lines.
  8188. @item --ignore-blank-lines
  8189. Ignore changes that just insert or delete blank lines.
  8190. @item --ignore-case
  8191. Ignore changes in case; consider upper- and lower-case to be the same.
  8192. @item --ignore-matching-lines=@var{regexp}
  8193. Ignore changes that just insert or delete lines that match @var{regexp}.
  8194. @item --ignore-space-change
  8195. Ignore trailing white space and consider all other sequences of one or
  8196. more white space characters to be equivalent.
  8197. @item --initial-tab
  8198. Output a tab rather than a space before the text of a line in normal or
  8199. context format. This causes the alignment of tabs in the line to look
  8200. normal.
  8201. @item -L @var{label}
  8202. Use @var{label} instead of the file name in the context format
  8203. and unified format headers.
  8204. @item --label=@var{label}
  8205. Use @var{label} instead of the file name in the context format
  8206. and unified format headers.
  8207. @item --left-column
  8208. Print only the left column of two common lines in side by side format.
  8209. @item --line-format=@var{format}
  8210. Use @var{format} to output all input lines in if-then-else format.
  8211. @xref{Line formats}.
  8212. @item --minimal
  8213. Change the algorithm to perhaps find a smaller set of changes. This
  8214. makes @code{diff} slower (sometimes much slower).
  8215. @item -n
  8216. Output RCS-format diffs; like @samp{-f} except that each command
  8217. specifies the number of lines affected.
  8218. @item -N
  8219. @itemx --new-file
  8220. In directory comparison, if a file is found in only one directory,
  8221. treat it as present but empty in the other directory.
  8222. @item --new-group-format=@var{format}
  8223. Use @var{format} to output a group of lines taken from just the second
  8224. file in if-then-else format. @xref{Line group formats}.
  8225. @item --new-line-format=@var{format}
  8226. Use @var{format} to output a line taken from just the second file in
  8227. if-then-else format. @xref{Line formats}.
  8228. @item --old-group-format=@var{format}
  8229. Use @var{format} to output a group of lines taken from just the first
  8230. file in if-then-else format. @xref{Line group formats}.
  8231. @item --old-line-format=@var{format}
  8232. Use @var{format} to output a line taken from just the first file in
  8233. if-then-else format. @xref{Line formats}.
  8234. @item -p
  8235. Show which C function each change is in.
  8236. @item --rcs
  8237. Output RCS-format diffs; like @samp{-f} except that each command
  8238. specifies the number of lines affected.
  8239. @item --report-identical-files
  8240. @itemx -s
  8241. Report when two files are the same.
  8242. @item --show-c-function
  8243. Show which C function each change is in.
  8244. @item --show-function-line=@var{regexp}
  8245. In context and unified format, for each hunk of differences, show some
  8246. of the last preceding line that matches @var{regexp}.
  8247. @item --side-by-side
  8248. Use the side by side output format.
  8249. @item --speed-large-files
  8250. Use heuristics to speed handling of large files that have numerous
  8251. scattered small changes.
  8252. @item --suppress-common-lines
  8253. Do not print common lines in side by side format.
  8254. @item -t
  8255. Expand tabs to spaces in the output, to preserve the alignment of tabs
  8256. in the input files.
  8257. @item -T
  8258. Output a tab rather than a space before the text of a line in normal or
  8259. context format. This causes the alignment of tabs in the line to look
  8260. normal.
  8261. @item --text
  8262. Treat all files as text and compare them line-by-line, even if they
  8263. do not appear to be text.
  8264. @item -u
  8265. Use the unified output format.
  8266. @item --unchanged-group-format=@var{format}
  8267. Use @var{format} to output a group of common lines taken from both files
  8268. in if-then-else format. @xref{Line group formats}.
  8269. @item --unchanged-line-format=@var{format}
  8270. Use @var{format} to output a line common to both files in if-then-else
  8271. format. @xref{Line formats}.
  8272. @item -U @var{lines}
  8273. @itemx --unified@r{[}=@var{lines}@r{]}
  8274. Use the unified output format, showing @var{lines} (an integer) lines of
  8275. context, or three if @var{lines} is not given.
  8276. For proper operation, @code{patch} typically needs at least two lines of
  8277. context.
  8278. @item -w
  8279. Ignore white space when comparing lines.
  8280. @item -W @var{columns}
  8281. @itemx --width=@var{columns}
  8282. Use an output width of @var{columns} in side by side format.
  8283. @item -y
  8284. Use the side by side output format.
  8285. @end table
  8286. @menu
  8287. * Line group formats:: Line group formats
  8288. * Line formats:: Line formats
  8289. @end menu
  8290. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8291. @node Line group formats
  8292. @appendixsubsubsec Line group formats
  8293. Line group formats let you specify formats suitable for many
  8294. applications that allow if-then-else input, including programming
  8295. languages and text formatting languages. A line group format specifies
  8296. the output format for a contiguous group of similar lines.
  8297. For example, the following command compares the TeX file @file{myfile}
  8298. with the original version from the repository,
  8299. and outputs a merged file in which old regions are
  8300. surrounded by @samp{\begin@{em@}}-@samp{\end@{em@}} lines, and new
  8301. regions are surrounded by @samp{\begin@{bf@}}-@samp{\end@{bf@}} lines.
  8302. @example
  8303. cvs diff \
  8304. --old-group-format='\begin@{em@}
  8305. %<\end@{em@}
  8306. ' \
  8307. --new-group-format='\begin@{bf@}
  8308. %>\end@{bf@}
  8309. ' \
  8310. myfile
  8311. @end example
  8312. The following command is equivalent to the above example, but it is a
  8313. little more verbose, because it spells out the default line group formats.
  8314. @example
  8315. cvs diff \
  8316. --old-group-format='\begin@{em@}
  8317. %<\end@{em@}
  8318. ' \
  8319. --new-group-format='\begin@{bf@}
  8320. %>\end@{bf@}
  8321. ' \
  8322. --unchanged-group-format='%=' \
  8323. --changed-group-format='\begin@{em@}
  8324. %<\end@{em@}
  8325. \begin@{bf@}
  8326. %>\end@{bf@}
  8327. ' \
  8328. myfile
  8329. @end example
  8330. Here is a more advanced example, which outputs a diff listing with
  8331. headers containing line numbers in a ``plain English'' style.
  8332. @example
  8333. cvs diff \
  8334. --unchanged-group-format='' \
  8335. --old-group-format='-------- %dn line%(n=1?:s) deleted at %df:
  8336. %<' \
  8337. --new-group-format='-------- %dN line%(N=1?:s) added after %de:
  8338. %>' \
  8339. --changed-group-format='-------- %dn line%(n=1?:s) changed at %df:
  8340. %<-------- to:
  8341. %>' \
  8342. myfile
  8343. @end example
  8344. To specify a line group format, use one of the options
  8345. listed below. You can specify up to four line group formats, one for
  8346. each kind of line group. You should quote @var{format}, because it
  8347. typically contains shell metacharacters.
  8348. @table @samp
  8349. @item --old-group-format=@var{format}
  8350. These line groups are hunks containing only lines from the first file.
  8351. The default old group format is the same as the changed group format if
  8352. it is specified; otherwise it is a format that outputs the line group as-is.
  8353. @item --new-group-format=@var{format}
  8354. These line groups are hunks containing only lines from the second
  8355. file. The default new group format is same as the changed group
  8356. format if it is specified; otherwise it is a format that outputs the
  8357. line group as-is.
  8358. @item --changed-group-format=@var{format}
  8359. These line groups are hunks containing lines from both files. The
  8360. default changed group format is the concatenation of the old and new
  8361. group formats.
  8362. @item --unchanged-group-format=@var{format}
  8363. These line groups contain lines common to both files. The default
  8364. unchanged group format is a format that outputs the line group as-is.
  8365. @end table
  8366. In a line group format, ordinary characters represent themselves;
  8367. conversion specifications start with @samp{%} and have one of the
  8368. following forms.
  8369. @table @samp
  8370. @item %<
  8371. stands for the lines from the first file, including the trailing newline.
  8372. Each line is formatted according to the old line format (@pxref{Line formats}).
  8373. @item %>
  8374. stands for the lines from the second file, including the trailing newline.
  8375. Each line is formatted according to the new line format.
  8376. @item %=
  8377. stands for the lines common to both files, including the trailing newline.
  8378. Each line is formatted according to the unchanged line format.
  8379. @item %%
  8380. stands for @samp{%}.
  8381. @item %c'@var{C}'
  8382. where @var{C} is a single character, stands for @var{C}.
  8383. @var{C} may not be a backslash or an apostrophe.
  8384. For example, @samp{%c':'} stands for a colon, even inside
  8385. the then-part of an if-then-else format, which a colon would
  8386. normally terminate.
  8387. @item %c'\@var{O}'
  8388. where @var{O} is a string of 1, 2, or 3 octal digits,
  8389. stands for the character with octal code @var{O}.
  8390. For example, @samp{%c'\0'} stands for a null character.
  8391. @item @var{F}@var{n}
  8392. where @var{F} is a @code{printf} conversion specification and @var{n} is one
  8393. of the following letters, stands for @var{n}'s value formatted with @var{F}.
  8394. @table @samp
  8395. @item e
  8396. The line number of the line just before the group in the old file.
  8397. @item f
  8398. The line number of the first line in the group in the old file;
  8399. equals @var{e} + 1.
  8400. @item l
  8401. The line number of the last line in the group in the old file.
  8402. @item m
  8403. The line number of the line just after the group in the old file;
  8404. equals @var{l} + 1.
  8405. @item n
  8406. The number of lines in the group in the old file; equals @var{l} - @var{f} + 1.
  8407. @item E, F, L, M, N
  8408. Likewise, for lines in the new file.
  8409. @end table
  8410. The @code{printf} conversion specification can be @samp{%d},
  8411. @samp{%o}, @samp{%x}, or @samp{%X}, specifying decimal, octal,
  8412. lower case hexadecimal, or upper case hexadecimal output
  8413. respectively. After the @samp{%} the following options can appear in
  8414. sequence: a @samp{-} specifying left-justification; an integer
  8415. specifying the minimum field width; and a period followed by an
  8416. optional integer specifying the minimum number of digits.
  8417. For example, @samp{%5dN} prints the number of new lines in the group
  8418. in a field of width 5 characters, using the @code{printf} format @code{"%5d"}.
  8419. @item (@var{A}=@var{B}?@var{T}:@var{E})
  8420. If @var{A} equals @var{B} then @var{T} else @var{E}.
  8421. @var{A} and @var{B} are each either a decimal constant
  8422. or a single letter interpreted as above.
  8423. This format spec is equivalent to @var{T} if
  8424. @var{A}'s value equals @var{B}'s; otherwise it is equivalent to @var{E}.
  8425. For example, @samp{%(N=0?no:%dN) line%(N=1?:s)} is equivalent to
  8426. @samp{no lines} if @var{N} (the number of lines in the group in the
  8427. new file) is 0, to @samp{1 line} if @var{N} is 1, and to @samp{%dN lines}
  8428. otherwise.
  8429. @end table
  8430. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8431. @node Line formats
  8432. @appendixsubsubsec Line formats
  8433. Line formats control how each line taken from an input file is
  8434. output as part of a line group in if-then-else format.
  8435. For example, the following command outputs text with a one-column
  8436. change indicator to the left of the text. The first column of output
  8437. is @samp{-} for deleted lines, @samp{|} for added lines, and a space
  8438. for unchanged lines. The formats contain newline characters where
  8439. newlines are desired on output.
  8440. @example
  8441. cvs diff \
  8442. --old-line-format='-%l
  8443. ' \
  8444. --new-line-format='|%l
  8445. ' \
  8446. --unchanged-line-format=' %l
  8447. ' \
  8448. myfile
  8449. @end example
  8450. To specify a line format, use one of the following options. You should
  8451. quote @var{format}, since it often contains shell metacharacters.
  8452. @table @samp
  8453. @item --old-line-format=@var{format}
  8454. formats lines just from the first file.
  8455. @item --new-line-format=@var{format}
  8456. formats lines just from the second file.
  8457. @item --unchanged-line-format=@var{format}
  8458. formats lines common to both files.
  8459. @item --line-format=@var{format}
  8460. formats all lines; in effect, it sets all three above options simultaneously.
  8461. @end table
  8462. In a line format, ordinary characters represent themselves;
  8463. conversion specifications start with @samp{%} and have one of the
  8464. following forms.
  8465. @table @samp
  8466. @item %l
  8467. stands for the contents of the line, not counting its trailing
  8468. newline (if any). This format ignores whether the line is incomplete.
  8469. @item %L
  8470. stands for the contents of the line, including its trailing newline
  8471. (if any). If a line is incomplete, this format preserves its
  8472. incompleteness.
  8473. @item %%
  8474. stands for @samp{%}.
  8475. @item %c'@var{C}'
  8476. where @var{C} is a single character, stands for @var{C}.
  8477. @var{C} may not be a backslash or an apostrophe.
  8478. For example, @samp{%c':'} stands for a colon.
  8479. @item %c'\@var{O}'
  8480. where @var{O} is a string of 1, 2, or 3 octal digits,
  8481. stands for the character with octal code @var{O}.
  8482. For example, @samp{%c'\0'} stands for a null character.
  8483. @item @var{F}n
  8484. where @var{F} is a @code{printf} conversion specification,
  8485. stands for the line number formatted with @var{F}.
  8486. For example, @samp{%.5dn} prints the line number using the
  8487. @code{printf} format @code{"%.5d"}. @xref{Line group formats}, for
  8488. more about printf conversion specifications.
  8489. @end table
  8490. The default line format is @samp{%l} followed by a newline character.
  8491. If the input contains tab characters and it is important that they line
  8492. up on output, you should ensure that @samp{%l} or @samp{%L} in a line
  8493. format is just after a tab stop (e.g.@: by preceding @samp{%l} or
  8494. @samp{%L} with a tab character), or you should use the @samp{-t} or
  8495. @samp{--expand-tabs} option.
  8496. Taken together, the line and line group formats let you specify many
  8497. different formats. For example, the following command uses a format
  8498. similar to @code{diff}'s normal format. You can tailor this command
  8499. to get fine control over @code{diff}'s output.
  8500. @example
  8501. cvs diff \
  8502. --old-line-format='< %l
  8503. ' \
  8504. --new-line-format='> %l
  8505. ' \
  8506. --old-group-format='%df%(f=l?:,%dl)d%dE
  8507. %<' \
  8508. --new-group-format='%dea%dF%(F=L?:,%dL)
  8509. %>' \
  8510. --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)
  8511. %<---
  8512. %>' \
  8513. --unchanged-group-format='' \
  8514. myfile
  8515. @end example
  8516. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8517. @node diff examples
  8518. @appendixsubsec diff examples
  8519. The following line produces a Unidiff (@samp{-u} flag)
  8520. between revision 1.14 and 1.19 of
  8521. @file{backend.c}. Due to the @samp{-kk} flag no
  8522. keywords are substituted, so differences that only depend
  8523. on keyword substitution are ignored.
  8524. @example
  8525. $ cvs diff -kk -u -r 1.14 -r 1.19 backend.c
  8526. @end example
  8527. Suppose the experimental branch EXPR1 was based on a
  8528. set of files tagged RELEASE_1_0. To see what has
  8529. happened on that branch, the following can be used:
  8530. @example
  8531. $ cvs diff -r RELEASE_1_0 -r EXPR1
  8532. @end example
  8533. A command like this can be used to produce a context
  8534. diff between two releases:
  8535. @example
  8536. $ cvs diff -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs
  8537. @end example
  8538. If you are maintaining ChangeLogs, a command like the following
  8539. just before you commit your changes may help you write
  8540. the ChangeLog entry. All local modifications that have
  8541. not yet been committed will be printed.
  8542. @example
  8543. $ cvs diff -u | less
  8544. @end example
  8545. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8546. @node export
  8547. @appendixsec export---Export sources from CVS, similar to checkout
  8548. @cindex export (subcommand)
  8549. @itemize @bullet
  8550. @item
  8551. Synopsis: export [-flNnR] [-r rev|-D date] [-k subst] [-d dir] module@dots{}
  8552. @item
  8553. Requires: repository.
  8554. @item
  8555. Changes: current directory.
  8556. @end itemize
  8557. This command is a variant of @code{checkout}; use it
  8558. when you want a copy of the source for module without
  8559. the @sc{cvs} administrative directories. For example, you
  8560. might use @code{export} to prepare source for shipment
  8561. off-site. This command requires that you specify a
  8562. date or tag (with @samp{-D} or @samp{-r}), so that you
  8563. can count on reproducing the source you ship to others
  8564. (and thus it always prunes empty directories).
  8565. One often would like to use @samp{-kv} with @code{cvs
  8566. export}. This causes any keywords to be
  8567. expanded such that an import done at some other site
  8568. will not lose the keyword revision information. But be
  8569. aware that doesn't handle an export containing binary
  8570. files correctly. Also be aware that after having used
  8571. @samp{-kv}, one can no longer use the @code{ident}
  8572. command (which is part of the @sc{rcs} suite---see
  8573. ident(1)) which looks for keyword strings. If
  8574. you want to be able to use @code{ident} you must not
  8575. use @samp{-kv}.
  8576. @menu
  8577. * export options:: export options
  8578. @end menu
  8579. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8580. @node export options
  8581. @appendixsubsec export options
  8582. These standard options are supported by @code{export}
  8583. (@pxref{Common options}, for a complete description of
  8584. them):
  8585. @table @code
  8586. @item -D @var{date}
  8587. Use the most recent revision no later than @var{date}.
  8588. @item -f
  8589. If no matching revision is found, retrieve the most
  8590. recent revision (instead of ignoring the file).
  8591. @item -l
  8592. Local; run only in current working directory.
  8593. @item -n
  8594. Do not run any checkout program.
  8595. @item -R
  8596. Export directories recursively. This is on by default.
  8597. @item -r @var{tag}
  8598. Use revision @var{tag}.
  8599. @end table
  8600. In addition, these options (that are common to
  8601. @code{checkout} and @code{export}) are also supported:
  8602. @table @code
  8603. @item -d @var{dir}
  8604. Create a directory called @var{dir} for the working
  8605. files, instead of using the module name.
  8606. @xref{checkout options}, for complete details on how
  8607. @sc{cvs} handles this flag.
  8608. @item -k @var{subst}
  8609. Set keyword expansion mode (@pxref{Substitution modes}).
  8610. @item -N
  8611. Only useful together with @samp{-d @var{dir}}.
  8612. @xref{checkout options}, for complete details on how
  8613. @sc{cvs} handles this flag.
  8614. @end table
  8615. @ignore
  8616. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8617. @c @node export examples
  8618. @appendixsubsec export examples
  8619. Contributed examples are gratefully accepted.
  8620. @c -- Examples here!!
  8621. @end ignore
  8622. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8623. @node history
  8624. @appendixsec history---Show status of files and users
  8625. @cindex history (subcommand)
  8626. @itemize @bullet
  8627. @item
  8628. Synopsis: history [-report] [-flags] [-options args] [files@dots{}]
  8629. @item
  8630. Requires: the file @file{$CVSROOT/CVSROOT/history}
  8631. @item
  8632. Changes: nothing.
  8633. @end itemize
  8634. @sc{cvs} can keep a history file that tracks each use of the
  8635. @code{checkout}, @code{commit}, @code{rtag},
  8636. @code{update}, and @code{release} commands. You can
  8637. use @code{history} to display this information in
  8638. various formats.
  8639. Logging must be enabled by creating the file
  8640. @file{$CVSROOT/CVSROOT/history}.
  8641. @strong{Note: @code{history} uses @samp{-f}, @samp{-l},
  8642. @samp{-n}, and @samp{-p} in ways that conflict with the
  8643. normal use inside @sc{cvs} (@pxref{Common options}).}
  8644. @menu
  8645. * history options:: history options
  8646. @end menu
  8647. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8648. @node history options
  8649. @appendixsubsec history options
  8650. Several options (shown above as @samp{-report}) control what
  8651. kind of report is generated:
  8652. @table @code
  8653. @item -c
  8654. Report on each time commit was used (i.e., each time
  8655. the repository was modified).
  8656. @item -e
  8657. Everything (all record types). Equivalent to
  8658. specifying @samp{-x} with all record types. Of course,
  8659. @samp{-e} will also include record types which are
  8660. added in a future version of @sc{cvs}; if you are
  8661. writing a script which can only handle certain record
  8662. types, you'll want to specify @samp{-x}.
  8663. @item -m @var{module}
  8664. Report on a particular module. (You can meaningfully
  8665. use @samp{-m} more than once on the command line.)
  8666. @item -o
  8667. Report on checked-out modules. This is the default report type.
  8668. @item -T
  8669. Report on all tags.
  8670. @item -x @var{type}
  8671. Extract a particular set of record types @var{type} from the @sc{cvs}
  8672. history. The types are indicated by single letters,
  8673. which you may specify in combination.
  8674. Certain commands have a single record type:
  8675. @table @code
  8676. @item F
  8677. release
  8678. @item O
  8679. checkout
  8680. @item E
  8681. export
  8682. @item T
  8683. rtag
  8684. @end table
  8685. @noindent
  8686. One of four record types may result from an update:
  8687. @table @code
  8688. @item C
  8689. A merge was necessary but collisions were
  8690. detected (requiring manual merging).
  8691. @item G
  8692. A merge was necessary and it succeeded.
  8693. @item U
  8694. A working file was copied from the repository.
  8695. @item W
  8696. The working copy of a file was deleted during
  8697. update (because it was gone from the repository).
  8698. @end table
  8699. @noindent
  8700. One of three record types results from commit:
  8701. @table @code
  8702. @item A
  8703. A file was added for the first time.
  8704. @item M
  8705. A file was modified.
  8706. @item R
  8707. A file was removed.
  8708. @end table
  8709. @end table
  8710. The options shown as @samp{-flags} constrain or expand
  8711. the report without requiring option arguments:
  8712. @table @code
  8713. @item -a
  8714. Show data for all users (the default is to show data
  8715. only for the user executing @code{history}).
  8716. @item -l
  8717. Show last modification only.
  8718. @item -w
  8719. Show only the records for modifications done from the
  8720. same working directory where @code{history} is
  8721. executing.
  8722. @end table
  8723. The options shown as @samp{-options @var{args}} constrain the report
  8724. based on an argument:
  8725. @table @code
  8726. @item -b @var{str}
  8727. Show data back to a record containing the string
  8728. @var{str} in either the module name, the file name, or
  8729. the repository path.
  8730. @item -D @var{date}
  8731. Show data since @var{date}. This is slightly different
  8732. from the normal use of @samp{-D @var{date}}, which
  8733. selects the newest revision older than @var{date}.
  8734. @item -f @var{file}
  8735. Show data for a particular file
  8736. (you can specify several @samp{-f} options on the same command line).
  8737. This is equivalent to specifying the file on the command line.
  8738. @item -n @var{module}
  8739. Show data for a particular module
  8740. (you can specify several @samp{-n} options on the same command line).
  8741. @item -p @var{repository}
  8742. Show data for a particular source repository (you
  8743. can specify several @samp{-p} options on the same command
  8744. line).
  8745. @item -r @var{rev}
  8746. Show records referring to revisions since the revision
  8747. or tag named @var{rev} appears in individual @sc{rcs}
  8748. files. Each @sc{rcs} file is searched for the revision or
  8749. tag.
  8750. @item -t @var{tag}
  8751. Show records since tag @var{tag} was last added to the
  8752. history file. This differs from the @samp{-r} flag
  8753. above in that it reads only the history file, not the
  8754. @sc{rcs} files, and is much faster.
  8755. @item -u @var{name}
  8756. Show records for user @var{name}.
  8757. @item -z @var{timezone}
  8758. Show times in the selected records using the specified
  8759. time zone instead of UTC.
  8760. @end table
  8761. @ignore
  8762. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8763. @c @node history examples
  8764. @appendixsubsec history examples
  8765. Contributed examples will gratefully be accepted.
  8766. @c -- Examples here!
  8767. @end ignore
  8768. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8769. @node import
  8770. @appendixsec import---Import sources into CVS, using vendor branches
  8771. @cindex import (subcommand)
  8772. @c FIXME: This node is way too long for one which has subnodes.
  8773. @itemize @bullet
  8774. @item
  8775. Synopsis: import [-options] repository vendortag releasetag@dots{}
  8776. @item
  8777. Requires: Repository, source distribution directory.
  8778. @item
  8779. Changes: repository.
  8780. @end itemize
  8781. Use @code{import} to incorporate an entire source
  8782. distribution from an outside source (e.g., a source
  8783. vendor) into your source repository directory. You can
  8784. use this command both for initial creation of a
  8785. repository, and for wholesale updates to the module
  8786. from the outside source. @xref{Tracking sources}, for
  8787. a discussion on this subject.
  8788. The @var{repository} argument gives a directory name
  8789. (or a path to a directory) under the @sc{cvs} root directory
  8790. for repositories; if the directory did not exist,
  8791. import creates it.
  8792. When you use import for updates to source that has been
  8793. modified in your source repository (since a prior
  8794. import), it will notify you of any files that conflict
  8795. in the two branches of development; use @samp{checkout
  8796. -j} to reconcile the differences, as import instructs
  8797. you to do.
  8798. If @sc{cvs} decides a file should be ignored
  8799. (@pxref{cvsignore}), it does not import it and prints
  8800. @samp{I } followed by the filename (@pxref{import output}, for a
  8801. complete description of the output).
  8802. If the file @file{$CVSROOT/CVSROOT/cvswrappers} exists,
  8803. any file whose names match the specifications in that
  8804. file will be treated as packages and the appropriate
  8805. filtering will be performed on the file/directory
  8806. before being imported. @xref{Wrappers}.
  8807. The outside source is saved in a first-level
  8808. branch, by default 1.1.1. Updates are leaves of this
  8809. branch; for example, files from the first imported
  8810. collection of source will be revision 1.1.1.1, then
  8811. files from the first imported update will be revision
  8812. 1.1.1.2, and so on.
  8813. At least three arguments are required.
  8814. @var{repository} is needed to identify the collection
  8815. of source. @var{vendortag} is a tag for the entire
  8816. branch (e.g., for 1.1.1). You must also specify at
  8817. least one @var{releasetag} to identify the files at
  8818. the leaves created each time you execute @code{import}.
  8819. @c I'm not completely sure this belongs here. But
  8820. @c we need to say it _somewhere_ reasonably obvious; it
  8821. @c is a common misconception among people first learning CVS
  8822. Note that @code{import} does @emph{not} change the
  8823. directory in which you invoke it. In particular, it
  8824. does not set up that directory as a @sc{cvs} working
  8825. directory; if you want to work with the sources import
  8826. them first and then check them out into a different
  8827. directory (@pxref{Getting the source}).
  8828. @menu
  8829. * import options:: import options
  8830. * import output:: import output
  8831. * import examples:: import examples
  8832. @end menu
  8833. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8834. @node import options
  8835. @appendixsubsec import options
  8836. This standard option is supported by @code{import}
  8837. (@pxref{Common options}, for a complete description):
  8838. @table @code
  8839. @item -m @var{message}
  8840. Use @var{message} as log information, instead of
  8841. invoking an editor.
  8842. @end table
  8843. There are the following additional special options.
  8844. @table @code
  8845. @item -b @var{branch}
  8846. See @ref{Multiple vendor branches}.
  8847. @item -k @var{subst}
  8848. Indicate the keyword expansion mode desired. This
  8849. setting will apply to all files created during the
  8850. import, but not to any files that previously existed in
  8851. the repository. See @ref{Substitution modes}, for a
  8852. list of valid @samp{-k} settings.
  8853. @item -I @var{name}
  8854. Specify file names that should be ignored during
  8855. import. You can use this option repeatedly. To avoid
  8856. ignoring any files at all (even those ignored by
  8857. default), specify `-I !'.
  8858. @var{name} can be a file name pattern of the same type
  8859. that you can specify in the @file{.cvsignore} file.
  8860. @xref{cvsignore}.
  8861. @c -- Is this really true?
  8862. @item -W @var{spec}
  8863. Specify file names that should be filtered during
  8864. import. You can use this option repeatedly.
  8865. @var{spec} can be a file name pattern of the same type
  8866. that you can specify in the @file{.cvswrappers}
  8867. file. @xref{Wrappers}.
  8868. @end table
  8869. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8870. @node import output
  8871. @appendixsubsec import output
  8872. @code{import} keeps you informed of its progress by printing a line
  8873. for each file, preceded by one character indicating the status of the file:
  8874. @table @code
  8875. @item U @var{file}
  8876. The file already exists in the repository and has not been locally
  8877. modified; a new revision has been created (if necessary).
  8878. @item N @var{file}
  8879. The file is a new file which has been added to the repository.
  8880. @item C @var{file}
  8881. The file already exists in the repository but has been locally modified;
  8882. you will have to merge the changes.
  8883. @item I @var{file}
  8884. The file is being ignored (@pxref{cvsignore}).
  8885. @cindex Symbolic link, importing
  8886. @cindex Link, symbolic, importing
  8887. @c FIXME: also (somewhere else) probably
  8888. @c should be documenting what happens if you "cvs add"
  8889. @c a symbolic link. Also maybe what happens if
  8890. @c you manually create symbolic links within the
  8891. @c repository (? - not sure why we'd want to suggest
  8892. @c doing that).
  8893. @item L @var{file}
  8894. The file is a symbolic link; @code{cvs import} ignores symbolic links.
  8895. People periodically suggest that this behavior should
  8896. be changed, but if there is a consensus on what it
  8897. should be changed to, it is not apparent.
  8898. (Various options in the @file{modules} file can be used
  8899. to recreate symbolic links on checkout, update, etc.;
  8900. @pxref{modules}.)
  8901. @end table
  8902. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8903. @node import examples
  8904. @appendixsubsec import examples
  8905. See @ref{Tracking sources}, and @ref{From files}.
  8906. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8907. @node log
  8908. @appendixsec log---Print out log information for files
  8909. @cindex log (subcommand)
  8910. @itemize @bullet
  8911. @item
  8912. Synopsis: log [options] [files@dots{}]
  8913. @item
  8914. Requires: repository, working directory.
  8915. @item
  8916. Changes: nothing.
  8917. @end itemize
  8918. Display log information for files. @code{log} used to
  8919. call the @sc{rcs} utility @code{rlog}. Although this
  8920. is no longer true in the current sources, this history
  8921. determines the format of the output and the options,
  8922. which are not quite in the style of the other @sc{cvs}
  8923. commands.
  8924. @cindex Timezone, in output
  8925. @cindex Zone, time, in output
  8926. @c Kind of a funny place to document the timezone used
  8927. @c in output from commands other than @code{log}.
  8928. @c There is also more we need to say about this,
  8929. @c including what happens in a client/server environment.
  8930. The output includes the location of the @sc{rcs} file,
  8931. the @dfn{head} revision (the latest revision on the
  8932. trunk), all symbolic names (tags) and some other
  8933. things. For each revision, the revision number, the
  8934. author, the number of lines added/deleted and the log
  8935. message are printed. All times are displayed in
  8936. Coordinated Universal Time (UTC). (Other parts of
  8937. @sc{cvs} print times in the local timezone).
  8938. @c FIXCVS: need a better way to control the timezone
  8939. @c used in output. Previous/current versions of CVS did/do
  8940. @c sometimes support -z in RCSINIT, and/or an
  8941. @c undocumented (except by reference to 'rlog') -z option
  8942. @c to cvs log, but this has not been a consistent,
  8943. @c documented feature. Perhaps a new global option,
  8944. @c where LT means the client's timezone, which the
  8945. @c client then communicates to the server, is the
  8946. @c right solution.
  8947. @strong{Note: @code{log} uses @samp{-R} in a way that conflicts
  8948. with the normal use inside @sc{cvs} (@pxref{Common options}).}
  8949. @menu
  8950. * log options:: log options
  8951. * log examples:: log examples
  8952. @end menu
  8953. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8954. @node log options
  8955. @appendixsubsec log options
  8956. By default, @code{log} prints all information that is
  8957. available. All other options restrict the output.
  8958. @table @code
  8959. @item -b
  8960. Print information about the revisions on the default
  8961. branch, normally the highest branch on the trunk.
  8962. @item -d @var{dates}
  8963. Print information about revisions with a checkin
  8964. date/time in the range given by the
  8965. semicolon-separated list of dates. The date formats
  8966. accepted are those accepted by the @samp{-D} option to
  8967. many other @sc{cvs} commands (@pxref{Common options}).
  8968. Dates can be combined into ranges as follows:
  8969. @c Should we be thinking about accepting ISO8601
  8970. @c ranges? For example "1972-09-10/1972-09-12".
  8971. @table @code
  8972. @item @var{d1}<@var{d2}
  8973. @itemx @var{d2}>@var{d1}
  8974. Select the revisions that were deposited between
  8975. @var{d1} and @var{d2}.
  8976. @item <@var{d}
  8977. @itemx @var{d}>
  8978. Select all revisions dated @var{d} or earlier.
  8979. @item @var{d}<
  8980. @itemx >@var{d}
  8981. Select all revisions dated @var{d} or later.
  8982. @item @var{d}
  8983. Select the single, latest revision dated @var{d} or
  8984. earlier.
  8985. @end table
  8986. The @samp{>} or @samp{<} characters may be followed by
  8987. @samp{=} to indicate an inclusive range rather than an
  8988. exclusive one.
  8989. Note that the separator is a semicolon (;).
  8990. @item -h
  8991. Print only the name of the @sc{rcs} file, name
  8992. of the file in the working directory, head,
  8993. default branch, access list, locks, symbolic names, and
  8994. suffix.
  8995. @item -l
  8996. Local; run only in current working directory. (Default
  8997. is to run recursively).
  8998. @item -N
  8999. Do not print the list of tags for this file. This
  9000. option can be very useful when your site uses a lot of
  9001. tags, so rather than "more"'ing over 3 pages of tag
  9002. information, the log information is presented without
  9003. tags at all.
  9004. @item -R
  9005. Print only the name of the @sc{rcs} file.
  9006. @c Note that using a bare revision (in addition to not
  9007. @c being explicitly documented here) is potentially
  9008. @c confusing; it shows the log message to get from the
  9009. @c previous revision to that revision. "-r1.3 -r1.6"
  9010. @c (equivalent to "-r1.3,1.6") is even worse; it
  9011. @c prints the messages to get from 1.2 to 1.3 and 1.5
  9012. @c to 1.6. By analogy with "cvs diff", users might
  9013. @c expect that it is more like specifying a range.
  9014. @c It is not 100% clear to me how much of this should
  9015. @c be documented (for example, multiple -r options
  9016. @c perhaps could/should be deprecated given the false
  9017. @c analogy with "cvs diff").
  9018. @c In general, this section should be rewritten to talk
  9019. @c about messages to get from revision rev1 to rev2,
  9020. @c rather than messages for revision rev2 (that is, the
  9021. @c messages are associated with a change not a static
  9022. @c revision and failing to make this distinction causes
  9023. @c much confusion).
  9024. @item -r@var{revisions}
  9025. Print information about revisions given in the
  9026. comma-separated list @var{revisions} of revisions and
  9027. ranges. The following table explains the available
  9028. range formats:
  9029. @table @code
  9030. @item @var{rev1}:@var{rev2}
  9031. Revisions @var{rev1} to @var{rev2} (which must be on
  9032. the same branch).
  9033. @item @var{rev1}::@var{rev2}
  9034. The same, but excluding @var{rev1}.
  9035. @item :@var{rev}
  9036. @itemx ::@var{rev}
  9037. Revisions from the beginning of the branch up to
  9038. and including @var{rev}.
  9039. @item @var{rev}:
  9040. Revisions starting with @var{rev} to the end of the
  9041. branch containing @var{rev}.
  9042. @item @var{rev}::
  9043. Revisions starting just after @var{rev} to the end of the
  9044. branch containing @var{rev}.
  9045. @item @var{branch}
  9046. An argument that is a branch means all revisions on
  9047. that branch.
  9048. @item @var{branch1}:@var{branch2}
  9049. @itemx @var{branch1}::@var{branch2}
  9050. A range of branches means all revisions
  9051. on the branches in that range.
  9052. @item @var{branch}.
  9053. The latest revision in @var{branch}.
  9054. @end table
  9055. A bare @samp{-r} with no revisions means the latest
  9056. revision on the default branch, normally the trunk.
  9057. There can be no space between the @samp{-r} option and
  9058. its argument.
  9059. @item -S
  9060. Suppress the header if no revisions are selected.
  9061. @item -s @var{states}
  9062. Print information about revisions whose state
  9063. attributes match one of the states given in the
  9064. comma-separated list @var{states}.
  9065. @item -t
  9066. Print the same as @samp{-h}, plus the descriptive text.
  9067. @item -w@var{logins}
  9068. Print information about revisions checked in by users
  9069. with login names appearing in the comma-separated list
  9070. @var{logins}. If @var{logins} is omitted, the user's
  9071. login is assumed. There can be no space between the
  9072. @samp{-w} option and its argument.
  9073. @end table
  9074. @code{log} prints the intersection of the revisions
  9075. selected with the options @samp{-d}, @samp{-s}, and
  9076. @samp{-w}, intersected with the union of the revisions
  9077. selected by @samp{-b} and @samp{-r}.
  9078. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9079. @node log examples
  9080. @appendixsubsec log examples
  9081. Contributed examples are gratefully accepted.
  9082. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9083. @node rdiff
  9084. @appendixsec rdiff---'patch' format diffs between releases
  9085. @cindex rdiff (subcommand)
  9086. @itemize @bullet
  9087. @item
  9088. rdiff [-flags] [-V vn] [-r t|-D d [-r t2|-D d2]] modules@dots{}
  9089. @item
  9090. Requires: repository.
  9091. @item
  9092. Changes: nothing.
  9093. @item
  9094. Synonym: patch
  9095. @end itemize
  9096. Builds a Larry Wall format patch(1) file between two
  9097. releases, that can be fed directly into the @code{patch}
  9098. program to bring an old release up-to-date with the new
  9099. release. (This is one of the few @sc{cvs} commands that
  9100. operates directly from the repository, and doesn't
  9101. require a prior checkout.) The diff output is sent to
  9102. the standard output device.
  9103. You can specify (using the standard @samp{-r} and
  9104. @samp{-D} options) any combination of one or two
  9105. revisions or dates. If only one revision or date is
  9106. specified, the patch file reflects differences between
  9107. that revision or date and the current head revisions in
  9108. the @sc{rcs} file.
  9109. Note that if the software release affected is contained
  9110. in more than one directory, then it may be necessary to
  9111. specify the @samp{-p} option to the @code{patch} command when
  9112. patching the old sources, so that @code{patch} is able to find
  9113. the files that are located in other directories.
  9114. @menu
  9115. * rdiff options:: rdiff options
  9116. * rdiff examples:: rdiff examples
  9117. @end menu
  9118. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9119. @node rdiff options
  9120. @appendixsubsec rdiff options
  9121. These standard options are supported by @code{rdiff}
  9122. (@pxref{Common options}, for a complete description of
  9123. them):
  9124. @table @code
  9125. @item -D @var{date}
  9126. Use the most recent revision no later than @var{date}.
  9127. @item -f
  9128. If no matching revision is found, retrieve the most
  9129. recent revision (instead of ignoring the file).
  9130. @item -l
  9131. Local; don't descend subdirectories.
  9132. @item -R
  9133. Examine directories recursively. This option is on by default.
  9134. @item -r @var{tag}
  9135. Use revision @var{tag}.
  9136. @end table
  9137. In addition to the above, these options are available:
  9138. @table @code
  9139. @item -c
  9140. Use the context diff format. This is the default format.
  9141. @item -s
  9142. Create a summary change report instead of a patch. The
  9143. summary includes information about files that were
  9144. changed or added between the releases. It is sent to
  9145. the standard output device. This is useful for finding
  9146. out, for example, which files have changed between two
  9147. dates or revisions.
  9148. @item -t
  9149. A diff of the top two revisions is sent to the standard
  9150. output device. This is most useful for seeing what the
  9151. last change to a file was.
  9152. @item -u
  9153. Use the unidiff format for the context diffs.
  9154. Remember that old versions
  9155. of the @code{patch} program can't handle the unidiff
  9156. format, so if you plan to post this patch to the net
  9157. you should probably not use @samp{-u}.
  9158. @item -V @var{vn}
  9159. Expand keywords according to the rules current in
  9160. @sc{rcs} version @var{vn} (the expansion format changed with
  9161. @sc{rcs} version 5). Note that this option is no
  9162. longer accepted. @sc{cvs} will always expand keywords the
  9163. way that @sc{rcs} version 5 does.
  9164. @end table
  9165. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9166. @node rdiff examples
  9167. @appendixsubsec rdiff examples
  9168. Suppose you receive mail from @t{foo@@example.net} asking for an
  9169. update from release 1.2 to 1.4 of the tc compiler. You
  9170. have no such patches on hand, but with @sc{cvs} that can
  9171. easily be fixed with a command such as this:
  9172. @example
  9173. $ cvs rdiff -c -r FOO1_2 -r FOO1_4 tc | \
  9174. $$ Mail -s 'The patches you asked for' foo@@example.net
  9175. @end example
  9176. Suppose you have made release 1.3, and forked a branch
  9177. called @samp{R_1_3fix} for bugfixes. @samp{R_1_3_1}
  9178. corresponds to release 1.3.1, which was made some time
  9179. ago. Now, you want to see how much development has been
  9180. done on the branch. This command can be used:
  9181. @example
  9182. $ cvs patch -s -r R_1_3_1 -r R_1_3fix module-name
  9183. cvs rdiff: Diffing module-name
  9184. File ChangeLog,v changed from revision 1.52.2.5 to 1.52.2.6
  9185. File foo.c,v changed from revision 1.52.2.3 to 1.52.2.4
  9186. File bar.h,v changed from revision 1.29.2.1 to 1.2
  9187. @end example
  9188. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9189. @node release
  9190. @appendixsec release---Indicate that a Module is no longer in use
  9191. @cindex release (subcommand)
  9192. @itemize @bullet
  9193. @item
  9194. release [-d] directories@dots{}
  9195. @item
  9196. Requires: Working directory.
  9197. @item
  9198. Changes: Working directory, history log.
  9199. @end itemize
  9200. This command is meant to safely cancel the effect of
  9201. @samp{cvs checkout}. Since @sc{cvs} doesn't lock files, it
  9202. isn't strictly necessary to use this command. You can
  9203. always simply delete your working directory, if you
  9204. like; but you risk losing changes you may have
  9205. forgotten, and you leave no trace in the @sc{cvs} history
  9206. file (@pxref{history file}) that you've abandoned your
  9207. checkout.
  9208. Use @samp{cvs release} to avoid these problems. This
  9209. command checks that no uncommitted changes are
  9210. present; that you are executing it from immediately
  9211. above a @sc{cvs} working directory; and that the repository
  9212. recorded for your files is the same as the repository
  9213. defined in the module database.
  9214. If all these conditions are true, @samp{cvs release}
  9215. leaves a record of its execution (attesting to your
  9216. intentionally abandoning your checkout) in the @sc{cvs}
  9217. history log.
  9218. @menu
  9219. * release options:: release options
  9220. * release output:: release output
  9221. * release examples:: release examples
  9222. @end menu
  9223. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9224. @node release options
  9225. @appendixsubsec release options
  9226. The @code{release} command supports one command option:
  9227. @table @code
  9228. @item -d
  9229. Delete your working copy of the file if the release
  9230. succeeds. If this flag is not given your files will
  9231. remain in your working directory.
  9232. @strong{WARNING: The @code{release} command deletes
  9233. all directories and files recursively. This
  9234. has the very serious side-effect that any directory
  9235. that you have created inside your checked-out sources,
  9236. and not added to the repository (using the @code{add}
  9237. command; @pxref{Adding files}) will be silently deleted---even
  9238. if it is non-empty!}
  9239. @end table
  9240. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9241. @node release output
  9242. @appendixsubsec release output
  9243. Before @code{release} releases your sources it will
  9244. print a one-line message for any file that is not
  9245. up-to-date.
  9246. @table @code
  9247. @item U @var{file}
  9248. @itemx P @var{file}
  9249. There exists a newer revision of this file in the
  9250. repository, and you have not modified your local copy
  9251. of the file (@samp{U} and @samp{P} mean the same thing).
  9252. @item A @var{file}
  9253. The file has been added to your private copy of the
  9254. sources, but has not yet been committed to the
  9255. repository. If you delete your copy of the sources
  9256. this file will be lost.
  9257. @item R @var{file}
  9258. The file has been removed from your private copy of the
  9259. sources, but has not yet been removed from the
  9260. repository, since you have not yet committed the
  9261. removal. @xref{commit}.
  9262. @item M @var{file}
  9263. The file is modified in your working directory. There
  9264. might also be a newer revision inside the repository.
  9265. @item ? @var{file}
  9266. @var{file} is in your working directory, but does not
  9267. correspond to anything in the source repository, and is
  9268. not in the list of files for @sc{cvs} to ignore (see the
  9269. description of the @samp{-I} option, and
  9270. @pxref{cvsignore}). If you remove your working
  9271. sources, this file will be lost.
  9272. @end table
  9273. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9274. @node release examples
  9275. @appendixsubsec release examples
  9276. Release the @file{tc} directory, and delete your local working copy
  9277. of the files.
  9278. @example
  9279. $ cd .. # @r{You must stand immediately above the}
  9280. # @r{sources when you issue @samp{cvs release}.}
  9281. $ cvs release -d tc
  9282. You have [0] altered files in this repository.
  9283. Are you sure you want to release (and delete) directory `tc': y
  9284. $
  9285. @end example
  9286. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9287. @node update
  9288. @appendixsec update---Bring work tree in sync with repository
  9289. @cindex update (subcommand)
  9290. @itemize @bullet
  9291. @item
  9292. update [-ACdflPpR] [-I name] [-j rev [-j rev]] [-k kflag] [-r tag|-D date] [-W spec] files@dots{}
  9293. @item
  9294. Requires: repository, working directory.
  9295. @item
  9296. Changes: working directory.
  9297. @end itemize
  9298. After you've run checkout to create your private copy
  9299. of source from the common repository, other developers
  9300. will continue changing the central source. From time
  9301. to time, when it is convenient in your development
  9302. process, you can use the @code{update} command from
  9303. within your working directory to reconcile your work
  9304. with any revisions applied to the source repository
  9305. since your last checkout or update. Without the @code{-C}
  9306. option, @code{update} will also merge any differences
  9307. between the local copy of files and their base revisions
  9308. into any destination revisions specified with @code{-r},
  9309. @code{-D}, or @code{-A}.
  9310. @menu
  9311. * update options:: update options
  9312. * update output:: update output
  9313. @end menu
  9314. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9315. @node update options
  9316. @appendixsubsec update options
  9317. These standard options are available with @code{update}
  9318. (@pxref{Common options}, for a complete description of
  9319. them):
  9320. @table @code
  9321. @item -D date
  9322. Use the most recent revision no later than @var{date}.
  9323. This option is sticky, and implies @samp{-P}.
  9324. See @ref{Sticky tags}, for more information on sticky tags/dates.
  9325. @item -f
  9326. Only useful with the @samp{-D @var{date}} or @samp{-r
  9327. @var{tag}} flags. If no matching revision is found,
  9328. retrieve the most recent revision (instead of ignoring
  9329. the file).
  9330. @item -k @var{kflag}
  9331. Process keywords according to @var{kflag}. See
  9332. @ref{Keyword substitution}.
  9333. This option is sticky; future updates of
  9334. this file in this working directory will use the same
  9335. @var{kflag}. The @code{status} command can be viewed
  9336. to see the sticky options. See @ref{Invoking CVS}, for
  9337. more information on the @code{status} command.
  9338. @item -l
  9339. Local; run only in current working directory. @xref{Recursive behavior}.
  9340. @item -P
  9341. Prune empty directories. See @ref{Moving directories}.
  9342. @item -p
  9343. Pipe files to the standard output.
  9344. @item -R
  9345. Update directories recursively (default). @xref{Recursive
  9346. behavior}.
  9347. @item -r rev
  9348. Retrieve revision/tag @var{rev}. This option is sticky,
  9349. and implies @samp{-P}.
  9350. See @ref{Sticky tags}, for more information on sticky tags/dates.
  9351. @end table
  9352. @need 800
  9353. These special options are also available with
  9354. @code{update}.
  9355. @table @code
  9356. @item -A
  9357. Reset any sticky tags, dates, or @samp{-k} options.
  9358. See @ref{Sticky tags}, for more information on sticky tags/dates.
  9359. @item -C
  9360. Overwrite locally modified files with clean copies from
  9361. the repository (the modified file is saved in
  9362. @file{.#@var{file}.@var{revision}}, however).
  9363. @item -d
  9364. Create any directories that exist in the repository if
  9365. they're missing from the working directory. Normally,
  9366. @code{update} acts only on directories and files that
  9367. were already enrolled in your working directory.
  9368. This is useful for updating directories that were
  9369. created in the repository since the initial checkout;
  9370. but it has an unfortunate side effect. If you
  9371. deliberately avoided certain directories in the
  9372. repository when you created your working directory
  9373. (either through use of a module name or by listing
  9374. explicitly the files and directories you wanted on the
  9375. command line), then updating with @samp{-d} will create
  9376. those directories, which may not be what you want.
  9377. @item -I @var{name}
  9378. Ignore files whose names match @var{name} (in your
  9379. working directory) during the update. You can specify
  9380. @samp{-I} more than once on the command line to specify
  9381. several files to ignore. Use @samp{-I !} to avoid
  9382. ignoring any files at all. @xref{cvsignore}, for other
  9383. ways to make @sc{cvs} ignore some files.
  9384. @item -W@var{spec}
  9385. Specify file names that should be filtered during
  9386. update. You can use this option repeatedly.
  9387. @var{spec} can be a file name pattern of the same type
  9388. that you can specify in the @file{.cvswrappers}
  9389. file. @xref{Wrappers}.
  9390. @item -j@var{revision}
  9391. With two @samp{-j} options, merge changes from the
  9392. revision specified with the first @samp{-j} option to
  9393. the revision specified with the second @samp{j} option,
  9394. into the working directory.
  9395. With one @samp{-j} option, merge changes from the
  9396. ancestor revision to the revision specified with the
  9397. @samp{-j} option, into the working directory. The
  9398. ancestor revision is the common ancestor of the
  9399. revision which the working directory is based on, and
  9400. the revision specified in the @samp{-j} option.
  9401. Note that using a single @samp{-j @var{tagname}} option rather than
  9402. @samp{-j @var{branchname}} to merge changes from a branch will
  9403. often not remove files which were removed on the branch.
  9404. @xref{Merging adds and removals}, for more.
  9405. In addition, each @samp{-j} option can contain an optional
  9406. date specification which, when used with branches, can
  9407. limit the chosen revision to one within a specific
  9408. date. An optional date is specified by adding a colon
  9409. (:) to the tag:
  9410. @samp{-j@var{Symbolic_Tag}:@var{Date_Specifier}}.
  9411. @xref{Branching and merging}.
  9412. @end table
  9413. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9414. @node update output
  9415. @appendixsubsec update output
  9416. @code{update} and @code{checkout} keep you informed of
  9417. their progress by printing a line for each file, preceded
  9418. by one character indicating the status of the file:
  9419. @table @code
  9420. @item U @var{file}
  9421. The file was brought up to date with respect to the
  9422. repository. This is done for any file that exists in
  9423. the repository but not in your source, and for files
  9424. that you haven't changed but are not the most recent
  9425. versions available in the repository.
  9426. @item P @var{file}
  9427. Like @samp{U}, but the @sc{cvs} server sends a patch instead of an entire
  9428. file. This accomplishes the same thing as @samp{U} using less bandwidth.
  9429. @item A @var{file}
  9430. The file has been added to your private copy of the
  9431. sources, and will be added to the source repository
  9432. when you run @code{commit} on the file. This is a
  9433. reminder to you that the file needs to be committed.
  9434. @item R @var{file}
  9435. The file has been removed from your private copy of the
  9436. sources, and will be removed from the source repository
  9437. when you run @code{commit} on the file. This is a
  9438. reminder to you that the file needs to be committed.
  9439. @item M @var{file}
  9440. The file is modified in your working directory.
  9441. @samp{M} can indicate one of two states for a file
  9442. you're working on: either there were no modifications
  9443. to the same file in the repository, so that your file
  9444. remains as you last saw it; or there were modifications
  9445. in the repository as well as in your copy, but they
  9446. were merged successfully, without conflict, in your
  9447. working directory.
  9448. @sc{cvs} will print some messages if it merges your work,
  9449. and a backup copy of your working file (as it looked
  9450. before you ran @code{update}) will be made. The exact
  9451. name of that file is printed while @code{update} runs.
  9452. @item C @var{file}
  9453. @cindex .# files
  9454. @cindex __ files (VMS)
  9455. A conflict was detected while trying to merge your
  9456. changes to @var{file} with changes from the source
  9457. repository. @var{file} (the copy in your working
  9458. directory) is now the result of attempting to merge
  9459. the two revisions; an unmodified copy of your file
  9460. is also in your working directory, with the name
  9461. @file{.#@var{file}.@var{revision}} where @var{revision}
  9462. is the revision that your modified file started
  9463. from. Resolve the conflict as described in
  9464. @ref{Conflicts example}.
  9465. @c "some systems" as in out-of-the-box OSes? Not as
  9466. @c far as I know. We need to advise sysadmins as well
  9467. @c as users how to set up this kind of purge, if that is
  9468. @c what they want.
  9469. @c We also might want to think about cleaner solutions,
  9470. @c like having CVS remove the .# file once the conflict
  9471. @c has been resolved or something like that.
  9472. (Note that some systems automatically purge
  9473. files that begin with @file{.#} if they have not been
  9474. accessed for a few days. If you intend to keep a copy
  9475. of your original file, it is a very good idea to rename
  9476. it.) Under @sc{vms}, the file name starts with
  9477. @file{__} rather than @file{.#}.
  9478. @item ? @var{file}
  9479. @var{file} is in your working directory, but does not
  9480. correspond to anything in the source repository, and is
  9481. not in the list of files for @sc{cvs} to ignore (see the
  9482. description of the @samp{-I} option, and
  9483. @pxref{cvsignore}).
  9484. @end table
  9485. @node Invoking CVS
  9486. @appendix Quick reference to CVS commands
  9487. @cindex Command reference
  9488. @cindex Reference, commands
  9489. @cindex Invoking CVS
  9490. This appendix describes how to invoke @sc{cvs}, with
  9491. references to where each command or feature is
  9492. described in detail. For other references run the
  9493. @code{cvs --help} command, or see @ref{Index}.
  9494. A @sc{cvs} command looks like:
  9495. @example
  9496. cvs [ @var{global_options} ] @var{command} [ @var{command_options} ] [ @var{command_args} ]
  9497. @end example
  9498. Global options:
  9499. @table @code
  9500. @item --allow-root=@var{rootdir}
  9501. Specify legal @sc{cvsroot} directory (server only) (not
  9502. in @sc{cvs} 1.9 and older). See @ref{Password
  9503. authentication server}.
  9504. @item -a
  9505. Authenticate all communication (client only) (not in @sc{cvs}
  9506. 1.9 and older). See @ref{Global options}.
  9507. @item -b
  9508. Specify RCS location (@sc{cvs} 1.9 and older). See
  9509. @ref{Global options}.
  9510. @item -d @var{root}
  9511. Specify the @sc{cvsroot}. See @ref{Repository}.
  9512. @item -e @var{editor}
  9513. Edit messages with @var{editor}. See @ref{Committing
  9514. your changes}.
  9515. @item -f
  9516. Do not read the @file{~/.cvsrc} file. See @ref{Global
  9517. options}.
  9518. @item -H
  9519. @itemx --help
  9520. Print a help message. See @ref{Global options}.
  9521. @item -l
  9522. Do not log in @file{$CVSROOT/CVSROOT/history} file. See @ref{Global
  9523. options}.
  9524. @item -n
  9525. Do not change any files. See @ref{Global options}.
  9526. @item -Q
  9527. Be really quiet. See @ref{Global options}.
  9528. @item -q
  9529. Be somewhat quiet. See @ref{Global options}.
  9530. @item -r
  9531. Make new working files read-only. See @ref{Global options}.
  9532. @item -s @var{variable}=@var{value}
  9533. Set a user variable. See @ref{Variables}.
  9534. @item -T @var{tempdir}
  9535. Put temporary files in @var{tempdir}. See @ref{Global
  9536. options}.
  9537. @item -t
  9538. Trace @sc{cvs} execution. See @ref{Global options}.
  9539. @item -v
  9540. @item --version
  9541. Display version and copyright information for @sc{cvs}.
  9542. @item -w
  9543. Make new working files read-write. See @ref{Global
  9544. options}.
  9545. @item -x
  9546. Encrypt all communication (client only).
  9547. See @ref{Global options}.
  9548. @item -z @var{gzip-level}
  9549. @cindex Compression
  9550. @cindex Gzip
  9551. Set the compression level (client only).
  9552. See @ref{Global options}.
  9553. @end table
  9554. Keyword expansion modes (@pxref{Substitution modes}):
  9555. @example
  9556. -kkv $@splitrcskeyword{}Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp $
  9557. -kkvl $@splitrcskeyword{}Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
  9558. -kk $@splitrcskeyword{}Id$
  9559. -kv file1,v 1.1 1993/12/09 03:21:13 joe Exp
  9560. -ko @i{no expansion}
  9561. -kb @i{no expansion, file is binary}
  9562. @end example
  9563. Keywords (@pxref{Keyword list}):
  9564. @example
  9565. $@splitrcskeyword{}Author: joe $
  9566. $@splitrcskeyword{}Date: 1993/12/09 03:21:13 $
  9567. $@splitrcskeyword{}CVSHeader: files/file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
  9568. $@splitrcskeyword{}Header: /home/files/file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
  9569. $@splitrcskeyword{}Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
  9570. $@splitrcskeyword{}Locker: harry $
  9571. $@splitrcskeyword{}Name: snapshot_1_14 $
  9572. $@splitrcskeyword{}RCSfile: file1,v $
  9573. $@splitrcskeyword{}Revision: 1.1 $
  9574. $@splitrcskeyword{}Source: /home/files/file1,v $
  9575. $@splitrcskeyword{}State: Exp $
  9576. $@splitrcskeyword{}Log: file1,v $
  9577. Revision 1.1 1993/12/09 03:30:17 joe
  9578. Initial revision
  9579. @end example
  9580. @c The idea behind this table is that we want each item
  9581. @c to be a sentence or two at most. Preferably a
  9582. @c single line.
  9583. @c
  9584. @c In some cases refs to "foo options" are just to get
  9585. @c this thing written quickly, not because the "foo
  9586. @c options" node is really the best place to point.
  9587. Commands, command options, and command arguments:
  9588. @table @code
  9589. @c ------------------------------------------------------------
  9590. @item add [@var{options}] [@var{files}@dots{}]
  9591. Add a new file/directory. See @ref{Adding files}.
  9592. @table @code
  9593. @item -k @var{kflag}
  9594. Set keyword expansion.
  9595. @item -m @var{msg}
  9596. Set file description.
  9597. @end table
  9598. @c ------------------------------------------------------------
  9599. @item admin [@var{options}] [@var{files}@dots{}]
  9600. Administration of history files in the repository. See
  9601. @ref{admin}.
  9602. @c This list omits those options which are not
  9603. @c documented as being useful with CVS. That might be
  9604. @c a mistake...
  9605. @table @code
  9606. @item -b[@var{rev}]
  9607. Set default branch. See @ref{Reverting local changes}.
  9608. @item -c@var{string}
  9609. Set comment leader.
  9610. @item -k@var{subst}
  9611. Set keyword substitution. See @ref{Keyword
  9612. substitution}.
  9613. @item -l[@var{rev}]
  9614. Lock revision @var{rev}, or latest revision.
  9615. @item -m@var{rev}:@var{msg}
  9616. Replace the log message of revision @var{rev} with
  9617. @var{msg}.
  9618. @item -o@var{range}
  9619. Delete revisions from the repository. See
  9620. @ref{admin options}.
  9621. @item -q
  9622. Run quietly; do not print diagnostics.
  9623. @item -s@var{state}[:@var{rev}]
  9624. Set the state.
  9625. @c Does not work for client/server CVS
  9626. @item -t
  9627. Set file description from standard input.
  9628. @item -t@var{file}
  9629. Set file description from @var{file}.
  9630. @item -t-@var{string}
  9631. Set file description to @var{string}.
  9632. @item -u[@var{rev}]
  9633. Unlock revision @var{rev}, or latest revision.
  9634. @end table
  9635. @c ------------------------------------------------------------
  9636. @item annotate [@var{options}] [@var{files}@dots{}]
  9637. Show last revision where each line was modified. See
  9638. @ref{annotate}.
  9639. @table @code
  9640. @item -D @var{date}
  9641. Annotate the most recent revision no later than
  9642. @var{date}. See @ref{Common options}.
  9643. @item -F
  9644. Force annotation of binary files. (Without this option,
  9645. binary files are skipped with a message.)
  9646. @item -f
  9647. Use head revision if tag/date not found. See
  9648. @ref{Common options}.
  9649. @item -l
  9650. Local; run only in current working directory. @xref{Recursive behavior}.
  9651. @item -R
  9652. Operate recursively (default). @xref{Recursive
  9653. behavior}.
  9654. @item -r @var{tag}
  9655. Annotate revision @var{tag}. See @ref{Common options}.
  9656. @end table
  9657. @c ------------------------------------------------------------
  9658. @item checkout [@var{options}] @var{modules}@dots{}
  9659. Get a copy of the sources. See @ref{checkout}.
  9660. @table @code
  9661. @item -A
  9662. Reset any sticky tags/date/options. See @ref{Sticky
  9663. tags} and @ref{Keyword substitution}.
  9664. @item -c
  9665. Output the module database. See @ref{checkout options}.
  9666. @item -D @var{date}
  9667. Check out revisions as of @var{date} (is sticky). See
  9668. @ref{Common options}.
  9669. @item -d @var{dir}
  9670. Check out into @var{dir}. See @ref{checkout options}.
  9671. @item -f
  9672. Use head revision if tag/date not found. See
  9673. @ref{Common options}.
  9674. @c Probably want to use rev1/rev2 style like for diff
  9675. @c -r. Here and in on-line help.
  9676. @item -j @var{rev}
  9677. Merge in changes. See @ref{checkout options}.
  9678. @item -k @var{kflag}
  9679. Use @var{kflag} keyword expansion. See
  9680. @ref{Substitution modes}.
  9681. @item -l
  9682. Local; run only in current working directory. @xref{Recursive behavior}.
  9683. @item -N
  9684. Don't ``shorten'' module paths if -d specified. See
  9685. @ref{checkout options}.
  9686. @item -n
  9687. Do not run module program (if any). See @ref{checkout options}.
  9688. @item -P
  9689. Prune empty directories. See @ref{Moving directories}.
  9690. @item -p
  9691. Check out files to standard output (avoids
  9692. stickiness). See @ref{checkout options}.
  9693. @item -R
  9694. Operate recursively (default). @xref{Recursive
  9695. behavior}.
  9696. @item -r @var{tag}
  9697. Checkout revision @var{tag} (is sticky). See @ref{Common options}.
  9698. @item -s
  9699. Like -c, but include module status. See @ref{checkout options}.
  9700. @end table
  9701. @c ------------------------------------------------------------
  9702. @item commit [@var{options}] [@var{files}@dots{}]
  9703. Check changes into the repository. See @ref{commit}.
  9704. @table @code
  9705. @item -F @var{file}
  9706. Read log message from @var{file}. See @ref{commit options}.
  9707. @item -f
  9708. @c What is this "disables recursion"? It is from the
  9709. @c on-line help; is it documented in this manual?
  9710. Force the file to be committed; disables recursion.
  9711. See @ref{commit options}.
  9712. @item -l
  9713. Local; run only in current working directory. See @ref{Recursive behavior}.
  9714. @item -m @var{msg}
  9715. Use @var{msg} as log message. See @ref{commit options}.
  9716. @item -n
  9717. Do not run module program (if any). See @ref{commit options}.
  9718. @item -R
  9719. Operate recursively (default). @xref{Recursive
  9720. behavior}.
  9721. @item -r @var{rev}
  9722. Commit to @var{rev}. See @ref{commit options}.
  9723. @c FIXME: should be dragging over text from
  9724. @c commit options, especially if it can be cleaned up
  9725. @c and made concise enough.
  9726. @end table
  9727. @c ------------------------------------------------------------
  9728. @item diff [@var{options}] [@var{files}@dots{}]
  9729. Show differences between revisions. See @ref{diff}.
  9730. In addition to the options shown below, accepts a wide
  9731. variety of options to control output style, for example
  9732. @samp{-c} for context diffs.
  9733. @table @code
  9734. @item -D @var{date1}
  9735. Diff revision for date against working file. See
  9736. @ref{diff options}.
  9737. @item -D @var{date2}
  9738. Diff @var{rev1}/@var{date1} against @var{date2}. See
  9739. @ref{diff options}.
  9740. @item -l
  9741. Local; run only in current working directory. See @ref{Recursive behavior}.
  9742. @item -N
  9743. Include diffs for added and removed files. See
  9744. @ref{diff options}.
  9745. @item -R
  9746. Operate recursively (default). @xref{Recursive
  9747. behavior}.
  9748. @item -r @var{rev1}
  9749. Diff revision for @var{rev1} against working file. See
  9750. @ref{diff options}.
  9751. @item -r @var{rev2}
  9752. Diff @var{rev1}/@var{date1} against @var{rev2}. See @ref{diff options}.
  9753. @end table
  9754. @c ------------------------------------------------------------
  9755. @item edit [@var{options}] [@var{files}@dots{}]
  9756. Get ready to edit a watched file. See @ref{Editing files}.
  9757. @table @code
  9758. @item -a @var{actions}
  9759. Specify actions for temporary watch, where
  9760. @var{actions} is @code{edit}, @code{unedit},
  9761. @code{commit}, @code{all}, or @code{none}. See
  9762. @ref{Editing files}.
  9763. @item -l
  9764. Local; run only in current working directory. See @ref{Recursive behavior}.
  9765. @item -R
  9766. Operate recursively (default). @xref{Recursive
  9767. behavior}.
  9768. @end table
  9769. @c ------------------------------------------------------------
  9770. @item editors [@var{options}] [@var{files}@dots{}]
  9771. See who is editing a watched file. See @ref{Watch information}.
  9772. @table @code
  9773. @item -l
  9774. Local; run only in current working directory. See @ref{Recursive behavior}.
  9775. @item -R
  9776. Operate recursively (default). @xref{Recursive
  9777. behavior}.
  9778. @end table
  9779. @c ------------------------------------------------------------
  9780. @item export [@var{options}] @var{modules}@dots{}
  9781. Export files from @sc{cvs}. See @ref{export}.
  9782. @table @code
  9783. @item -D @var{date}
  9784. Check out revisions as of @var{date}. See
  9785. @ref{Common options}.
  9786. @item -d @var{dir}
  9787. Check out into @var{dir}. See @ref{export options}.
  9788. @item -f
  9789. Use head revision if tag/date not found. See
  9790. @ref{Common options}.
  9791. @item -k @var{kflag}
  9792. Use @var{kflag} keyword expansion. See
  9793. @ref{Substitution modes}.
  9794. @item -l
  9795. Local; run only in current working directory. @xref{Recursive behavior}.
  9796. @item -N
  9797. Don't ``shorten'' module paths if -d specified. See
  9798. @ref{export options}.
  9799. @item -n
  9800. Do not run module program (if any). See @ref{export options}.
  9801. @item -R
  9802. Operate recursively (default). @xref{Recursive
  9803. behavior}.
  9804. @item -r @var{tag}
  9805. Checkout revision @var{tag}. See @ref{Common options}.
  9806. @end table
  9807. @c ------------------------------------------------------------
  9808. @item history [@var{options}] [@var{files}@dots{}]
  9809. Show repository access history. See @ref{history}.
  9810. @table @code
  9811. @item -a
  9812. All users (default is self). See @ref{history options}.
  9813. @item -b @var{str}
  9814. Back to record with @var{str} in module/file/repos
  9815. field. See @ref{history options}.
  9816. @item -c
  9817. Report on committed (modified) files. See @ref{history options}.
  9818. @item -D @var{date}
  9819. Since @var{date}. See @ref{history options}.
  9820. @item -e
  9821. Report on all record types. See @ref{history options}.
  9822. @item -l
  9823. Last modified (committed or modified report). See @ref{history options}.
  9824. @item -m @var{module}
  9825. Report on @var{module} (repeatable). See @ref{history options}.
  9826. @item -n @var{module}
  9827. In @var{module}. See @ref{history options}.
  9828. @item -o
  9829. Report on checked out modules. See @ref{history options}.
  9830. @item -p @var{repository}
  9831. In @var{repository}. See @ref{history options}.
  9832. @item -r @var{rev}
  9833. Since revision @var{rev}. See @ref{history options}.
  9834. @item -T
  9835. @c What the @#$@# is a TAG? Same as a tag? This
  9836. @c wording is also in the online-line help.
  9837. Produce report on all TAGs. See @ref{history options}.
  9838. @item -t @var{tag}
  9839. Since tag record placed in history file (by anyone).
  9840. See @ref{history options}.
  9841. @item -u @var{user}
  9842. For user @var{user} (repeatable). See @ref{history options}.
  9843. @item -w
  9844. Working directory must match. See @ref{history options}.
  9845. @item -x @var{types}
  9846. Report on @var{types}, one or more of
  9847. @code{TOEFWUCGMAR}. See @ref{history options}.
  9848. @item -z @var{zone}
  9849. Output for time zone @var{zone}. See @ref{history options}.
  9850. @end table
  9851. @c ------------------------------------------------------------
  9852. @item import [@var{options}] @var{repository} @var{vendor-tag} @var{release-tags}@dots{}
  9853. Import files into @sc{cvs}, using vendor branches. See
  9854. @ref{import}.
  9855. @table @code
  9856. @item -b @var{bra}
  9857. Import to vendor branch @var{bra}. See
  9858. @ref{Multiple vendor branches}.
  9859. @item -d
  9860. Use the file's modification time as the time of
  9861. import. See @ref{import options}.
  9862. @item -k @var{kflag}
  9863. Set default keyword substitution mode. See
  9864. @ref{import options}.
  9865. @item -m @var{msg}
  9866. Use @var{msg} for log message. See
  9867. @ref{import options}.
  9868. @item -I @var{ign}
  9869. More files to ignore (! to reset). See
  9870. @ref{import options}.
  9871. @item -W @var{spec}
  9872. More wrappers. See @ref{import options}.
  9873. @end table
  9874. @c ------------------------------------------------------------
  9875. @item init
  9876. Create a @sc{cvs} repository if it doesn't exist. See
  9877. @ref{Creating a repository}.
  9878. @c ------------------------------------------------------------
  9879. @item kserver
  9880. Kerberos authenticated server.
  9881. See @ref{Kerberos authenticated}.
  9882. @c ------------------------------------------------------------
  9883. @item log [@var{options}] [@var{files}@dots{}]
  9884. Print out history information for files. See @ref{log}.
  9885. @table @code
  9886. @item -b
  9887. Only list revisions on the default branch. See @ref{log options}.
  9888. @item -d @var{dates}
  9889. Specify dates (@var{d1}<@var{d2} for range, @var{d} for
  9890. latest before). See @ref{log options}.
  9891. @item -h
  9892. Only print header. See @ref{log options}.
  9893. @item -l
  9894. Local; run only in current working directory. See @ref{Recursive behavior}.
  9895. @item -N
  9896. Do not list tags. See @ref{log options}.
  9897. @item -R
  9898. Only print name of RCS file. See @ref{log options}.
  9899. @item -r@var{revs}
  9900. Only list revisions @var{revs}. See @ref{log options}.
  9901. @item -s @var{states}
  9902. Only list revisions with specified states. See @ref{log options}.
  9903. @item -t
  9904. Only print header and descriptive text. See @ref{log
  9905. options}.
  9906. @item -w@var{logins}
  9907. Only list revisions checked in by specified logins. See @ref{log options}.
  9908. @end table
  9909. @c ------------------------------------------------------------
  9910. @item login
  9911. Prompt for password for authenticating server. See
  9912. @ref{Password authentication client}.
  9913. @c ------------------------------------------------------------
  9914. @item logout
  9915. Remove stored password for authenticating server. See
  9916. @ref{Password authentication client}.
  9917. @c ------------------------------------------------------------
  9918. @item pserver
  9919. Password authenticated server.
  9920. See @ref{Password authentication server}.
  9921. @c ------------------------------------------------------------
  9922. @item rannotate [@var{options}] [@var{modules}@dots{}]
  9923. Show last revision where each line was modified. See
  9924. @ref{annotate}.
  9925. @table @code
  9926. @item -D @var{date}
  9927. Annotate the most recent revision no later than
  9928. @var{date}. See @ref{Common options}.
  9929. @item -F
  9930. Force annotation of binary files. (Without this option,
  9931. binary files are skipped with a message.)
  9932. @item -f
  9933. Use head revision if tag/date not found. See
  9934. @ref{Common options}.
  9935. @item -l
  9936. Local; run only in current working directory. @xref{Recursive behavior}.
  9937. @item -R
  9938. Operate recursively (default). @xref{Recursive behavior}.
  9939. @item -r @var{tag}
  9940. Annotate revision @var{tag}. See @ref{Common options}.
  9941. @end table
  9942. @c ------------------------------------------------------------
  9943. @item rdiff [@var{options}] @var{modules}@dots{}
  9944. Show differences between releases. See @ref{rdiff}.
  9945. @table @code
  9946. @item -c
  9947. Context diff output format (default). See @ref{rdiff options}.
  9948. @item -D @var{date}
  9949. Select revisions based on @var{date}. See @ref{Common options}.
  9950. @item -f
  9951. Use head revision if tag/date not found. See
  9952. @ref{Common options}.
  9953. @item -l
  9954. Local; run only in current working directory. See @ref{Recursive behavior}.
  9955. @item -R
  9956. Operate recursively (default). @xref{Recursive
  9957. behavior}.
  9958. @item -r @var{rev}
  9959. Select revisions based on @var{rev}. See @ref{Common options}.
  9960. @item -s
  9961. Short patch - one liner per file. See @ref{rdiff options}.
  9962. @item -t
  9963. Top two diffs - last change made to the file. See
  9964. @ref{diff options}.
  9965. @item -u
  9966. Unidiff output format. See @ref{rdiff options}.
  9967. @item -V @var{vers}
  9968. Use RCS Version @var{vers} for keyword expansion (obsolete). See
  9969. @ref{rdiff options}.
  9970. @end table
  9971. @c ------------------------------------------------------------
  9972. @item release [@var{options}] @var{directory}
  9973. Indicate that a directory is no longer in use. See
  9974. @ref{release}.
  9975. @table @code
  9976. @item -d
  9977. Delete the given directory. See @ref{release options}.
  9978. @end table
  9979. @c ------------------------------------------------------------
  9980. @item remove [@var{options}] [@var{files}@dots{}]
  9981. Remove an entry from the repository. See @ref{Removing files}.
  9982. @table @code
  9983. @item -f
  9984. Delete the file before removing it. See @ref{Removing files}.
  9985. @item -l
  9986. Local; run only in current working directory. See @ref{Recursive behavior}.
  9987. @item -R
  9988. Operate recursively (default). @xref{Recursive
  9989. behavior}.
  9990. @end table
  9991. @c ------------------------------------------------------------
  9992. @item rlog [@var{options}] [@var{files}@dots{}]
  9993. Print out history information for modules. See @ref{log}.
  9994. @table @code
  9995. @item -b
  9996. Only list revisions on the default branch. See @ref{log options}.
  9997. @item -d @var{dates}
  9998. Specify dates (@var{d1}<@var{d2} for range, @var{d} for
  9999. latest before). See @ref{log options}.
  10000. @item -h
  10001. Only print header. See @ref{log options}.
  10002. @item -l
  10003. Local; run only in current working directory. See @ref{Recursive behavior}.
  10004. @item -N
  10005. Do not list tags. See @ref{log options}.
  10006. @item -R
  10007. Only print name of RCS file. See @ref{log options}.
  10008. @item -r@var{revs}
  10009. Only list revisions @var{revs}. See @ref{log options}.
  10010. @item -s @var{states}
  10011. Only list revisions with specified states. See @ref{log options}.
  10012. @item -t
  10013. Only print header and descriptive text. See @ref{log options}.
  10014. @item -w@var{logins}
  10015. Only list revisions checked in by specified logins. See @ref{log options}.
  10016. @end table
  10017. @c ------------------------------------------------------------
  10018. @item rtag [@var{options}] @var{tag} @var{modules}@dots{}
  10019. Add a symbolic tag to a module.
  10020. See @ref{Revisions} and @ref{Branching and merging}.
  10021. @table @code
  10022. @item -a
  10023. Clear tag from removed files that would not otherwise
  10024. be tagged. See @ref{Tagging add/remove}.
  10025. @item -b
  10026. Create a branch named @var{tag}. See @ref{Branching and merging}.
  10027. @item -B
  10028. Used in conjunction with -F or -d, enables movement and deletion of
  10029. branch tags. Use with extreme caution.
  10030. @item -D @var{date}
  10031. Tag revisions as of @var{date}. See @ref{Tagging by date/tag}.
  10032. @item -d
  10033. Delete @var{tag}. See @ref{Modifying tags}.
  10034. @item -F
  10035. Move @var{tag} if it already exists. See @ref{Modifying tags}.
  10036. @item -f
  10037. Force a head revision match if tag/date not found.
  10038. See @ref{Tagging by date/tag}.
  10039. @item -l
  10040. Local; run only in current working directory. See @ref{Recursive behavior}.
  10041. @item -n
  10042. No execution of tag program. See @ref{Common options}.
  10043. @item -R
  10044. Operate recursively (default). @xref{Recursive
  10045. behavior}.
  10046. @item -r @var{rev}
  10047. Tag existing tag @var{rev}. See @ref{Tagging by date/tag}.
  10048. @end table
  10049. @c ------------------------------------------------------------
  10050. @item server
  10051. Rsh server. See @ref{Connecting via rsh}.
  10052. @c ------------------------------------------------------------
  10053. @item status [@var{options}] @var{files}@dots{}
  10054. Display status information in a working directory. See
  10055. @ref{File status}.
  10056. @table @code
  10057. @item -l
  10058. Local; run only in current working directory. See @ref{Recursive behavior}.
  10059. @item -R
  10060. Operate recursively (default). @xref{Recursive
  10061. behavior}.
  10062. @item -v
  10063. Include tag information for file. See @ref{Tags}.
  10064. @end table
  10065. @c ------------------------------------------------------------
  10066. @item tag [@var{options}] @var{tag} [@var{files}@dots{}]
  10067. Add a symbolic tag to checked out version of files.
  10068. See @ref{Revisions} and @ref{Branching and merging}.
  10069. @table @code
  10070. @item -b
  10071. Create a branch named @var{tag}. See @ref{Branching and merging}.
  10072. @item -c
  10073. Check that working files are unmodified. See
  10074. @ref{Tagging the working directory}.
  10075. @item -D @var{date}
  10076. Tag revisions as of @var{date}. See @ref{Tagging by date/tag}.
  10077. @item -d
  10078. Delete @var{tag}. See @ref{Modifying tags}.
  10079. @item -F
  10080. Move @var{tag} if it already exists. See @ref{Modifying tags}.
  10081. @item -f
  10082. Force a head revision match if tag/date not found.
  10083. See @ref{Tagging by date/tag}.
  10084. @item -l
  10085. Local; run only in current working directory. See @ref{Recursive behavior}.
  10086. @item -R
  10087. Operate recursively (default). @xref{Recursive
  10088. behavior}.
  10089. @item -r @var{rev}
  10090. Tag existing tag @var{rev}. See @ref{Tagging by date/tag}.
  10091. @end table
  10092. @c ------------------------------------------------------------
  10093. @item unedit [@var{options}] [@var{files}@dots{}]
  10094. Undo an edit command. See @ref{Editing files}.
  10095. @table @code
  10096. @item -l
  10097. Local; run only in current working directory. See @ref{Recursive behavior}.
  10098. @item -R
  10099. Operate recursively (default). @xref{Recursive behavior}.
  10100. @end table
  10101. @c ------------------------------------------------------------
  10102. @item update [@var{options}] [@var{files}@dots{}]
  10103. Bring work tree in sync with repository. See
  10104. @ref{update}.
  10105. @table @code
  10106. @item -A
  10107. Reset any sticky tags/date/options. See @ref{Sticky
  10108. tags} and @ref{Keyword substitution}.
  10109. @item -C
  10110. Overwrite locally modified files with clean copies from
  10111. the repository (the modified file is saved in
  10112. @file{.#@var{file}.@var{revision}}, however).
  10113. @item -D @var{date}
  10114. Check out revisions as of @var{date} (is sticky). See
  10115. @ref{Common options}.
  10116. @item -d
  10117. Create directories. See @ref{update options}.
  10118. @item -f
  10119. Use head revision if tag/date not found. See
  10120. @ref{Common options}.
  10121. @item -I @var{ign}
  10122. More files to ignore (! to reset). See
  10123. @ref{import options}.
  10124. @c Probably want to use rev1/rev2 style like for diff
  10125. @c -r. Here and in on-line help.
  10126. @item -j @var{rev}
  10127. Merge in changes. See @ref{update options}.
  10128. @item -k @var{kflag}
  10129. Use @var{kflag} keyword expansion. See
  10130. @ref{Substitution modes}.
  10131. @item -l
  10132. Local; run only in current working directory. @xref{Recursive behavior}.
  10133. @item -P
  10134. Prune empty directories. See @ref{Moving directories}.
  10135. @item -p
  10136. Check out files to standard output (avoids
  10137. stickiness). See @ref{update options}.
  10138. @item -R
  10139. Operate recursively (default). @xref{Recursive
  10140. behavior}.
  10141. @item -r @var{tag}
  10142. Checkout revision @var{tag} (is sticky). See @ref{Common options}.
  10143. @item -W @var{spec}
  10144. More wrappers. See @ref{import options}.
  10145. @end table
  10146. @c ------------------------------------------------------------
  10147. @item version
  10148. @cindex version (subcommand)
  10149. Display the version of @sc{cvs} being used. If the repository
  10150. is remote, display both the client and server versions.
  10151. @c ------------------------------------------------------------
  10152. @item watch [on|off|add|remove] [@var{options}] [@var{files}@dots{}]
  10153. on/off: turn on/off read-only checkouts of files. See
  10154. @ref{Setting a watch}.
  10155. add/remove: add or remove notification on actions. See
  10156. @ref{Getting Notified}.
  10157. @table @code
  10158. @item -a @var{actions}
  10159. Specify actions for temporary watch, where
  10160. @var{actions} is @code{edit}, @code{unedit},
  10161. @code{commit}, @code{all}, or @code{none}. See
  10162. @ref{Editing files}.
  10163. @item -l
  10164. Local; run only in current working directory. See @ref{Recursive behavior}.
  10165. @item -R
  10166. Operate recursively (default). @xref{Recursive
  10167. behavior}.
  10168. @end table
  10169. @c ------------------------------------------------------------
  10170. @item watchers [@var{options}] [@var{files}@dots{}]
  10171. See who is watching a file. See @ref{Watch information}.
  10172. @table @code
  10173. @item -l
  10174. Local; run only in current working directory. See @ref{Recursive behavior}.
  10175. @item -R
  10176. Operate recursively (default). @xref{Recursive
  10177. behavior}.
  10178. @end table
  10179. @end table
  10180. @c ---------------------------------------------------------------------
  10181. @node Administrative files
  10182. @appendix Reference manual for Administrative files
  10183. @cindex Administrative files (reference)
  10184. @cindex Files, reference manual
  10185. @cindex Reference manual (files)
  10186. @cindex CVSROOT (file)
  10187. @c FIXME? Somewhere there needs to be a more "how-to"
  10188. @c guide to writing these. I think the triggers
  10189. @c (commitinfo, loginfo, taginfo, &c) are perhaps a
  10190. @c different case than files like modules. One
  10191. @c particular issue that people sometimes are
  10192. @c (unnecessarily?) worried about is performance, and
  10193. @c the impact of writing in perl or sh or ____.
  10194. Inside the repository, in the directory
  10195. @file{$CVSROOT/CVSROOT}, there are a number of
  10196. supportive files for @sc{cvs}. You can use @sc{cvs} in a limited
  10197. fashion without any of them, but if they are set up
  10198. properly they can help make life easier. For a
  10199. discussion of how to edit them, see @ref{Intro
  10200. administrative files}.
  10201. The most important of these files is the @file{modules}
  10202. file, which defines the modules inside the repository.
  10203. @menu
  10204. * modules:: Defining modules
  10205. * Wrappers:: Specify binary-ness based on file name
  10206. * commit files:: The commit support files (commitinfo,
  10207. verifymsg, editinfo, loginfo)
  10208. * rcsinfo:: Templates for the log messages
  10209. * cvsignore:: Ignoring files via cvsignore
  10210. * checkoutlist:: Adding your own administrative files
  10211. * history file:: History information
  10212. * Variables:: Various variables are expanded
  10213. * config:: Miscellaneous CVS configuration
  10214. @end menu
  10215. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10216. @node modules
  10217. @appendixsec The modules file
  10218. @cindex Modules (admin file)
  10219. @cindex Defining modules (reference manual)
  10220. The @file{modules} file records your definitions of
  10221. names for collections of source code. @sc{cvs} will
  10222. use these definitions if you use @sc{cvs} to update the
  10223. modules file (use normal commands like @code{add},
  10224. @code{commit}, etc).
  10225. The @file{modules} file may contain blank lines and
  10226. comments (lines beginning with @samp{#}) as well as
  10227. module definitions. Long lines can be continued on the
  10228. next line by specifying a backslash (@samp{\}) as the
  10229. last character on the line.
  10230. There are three basic types of modules: alias modules,
  10231. regular modules, and ampersand modules. The difference
  10232. between them is the way that they map files in the
  10233. repository to files in the working directory. In all
  10234. of the following examples, the top-level repository
  10235. contains a directory called @file{first-dir}, which
  10236. contains two files, @file{file1} and @file{file2}, and a
  10237. directory @file{sdir}. @file{first-dir/sdir} contains
  10238. a file @file{sfile}.
  10239. @c FIXME: should test all the examples in this section.
  10240. @menu
  10241. * Alias modules:: The simplest kind of module
  10242. * Regular modules::
  10243. * Ampersand modules::
  10244. * Excluding directories:: Excluding directories from a module
  10245. * Module options:: Regular and ampersand modules can take options
  10246. * Module program options:: How the modules ``program options'' programs
  10247. are run.
  10248. @end menu
  10249. @node Alias modules
  10250. @appendixsubsec Alias modules
  10251. @cindex Alias modules
  10252. @cindex -a, in modules file
  10253. Alias modules are the simplest kind of module:
  10254. @table @code
  10255. @item @var{mname} -a @var{aliases}@dots{}
  10256. This represents the simplest way of defining a module
  10257. @var{mname}. The @samp{-a} flags the definition as a
  10258. simple alias: @sc{cvs} will treat any use of @var{mname} (as
  10259. a command argument) as if the list of names
  10260. @var{aliases} had been specified instead.
  10261. @var{aliases} may contain either other module names or
  10262. paths. When you use paths in aliases, @code{checkout}
  10263. creates all intermediate directories in the working
  10264. directory, just as if the path had been specified
  10265. explicitly in the @sc{cvs} arguments.
  10266. @end table
  10267. For example, if the modules file contains:
  10268. @example
  10269. amodule -a first-dir
  10270. @end example
  10271. @noindent
  10272. then the following two commands are equivalent:
  10273. @example
  10274. $ cvs co amodule
  10275. $ cvs co first-dir
  10276. @end example
  10277. @noindent
  10278. and they each would provide output such as:
  10279. @example
  10280. cvs checkout: Updating first-dir
  10281. U first-dir/file1
  10282. U first-dir/file2
  10283. cvs checkout: Updating first-dir/sdir
  10284. U first-dir/sdir/sfile
  10285. @end example
  10286. @node Regular modules
  10287. @appendixsubsec Regular modules
  10288. @cindex Regular modules
  10289. @table @code
  10290. @item @var{mname} [ options ] @var{dir} [ @var{files}@dots{} ]
  10291. In the simplest case, this form of module definition
  10292. reduces to @samp{@var{mname} @var{dir}}. This defines
  10293. all the files in directory @var{dir} as module mname.
  10294. @var{dir} is a relative path (from @code{$CVSROOT}) to a
  10295. directory of source in the source repository. In this
  10296. case, on checkout, a single directory called
  10297. @var{mname} is created as a working directory; no
  10298. intermediate directory levels are used by default, even
  10299. if @var{dir} was a path involving several directory
  10300. levels.
  10301. @end table
  10302. For example, if a module is defined by:
  10303. @example
  10304. regmodule first-dir
  10305. @end example
  10306. @noindent
  10307. then regmodule will contain the files from first-dir:
  10308. @example
  10309. $ cvs co regmodule
  10310. cvs checkout: Updating regmodule
  10311. U regmodule/file1
  10312. U regmodule/file2
  10313. cvs checkout: Updating regmodule/sdir
  10314. U regmodule/sdir/sfile
  10315. $
  10316. @end example
  10317. By explicitly specifying files in the module definition
  10318. after @var{dir}, you can select particular files from
  10319. directory @var{dir}. Here is
  10320. an example:
  10321. @example
  10322. regfiles first-dir/sdir sfile
  10323. @end example
  10324. @noindent
  10325. With this definition, getting the regfiles module
  10326. will create a single working directory
  10327. @file{regfiles} containing the file listed, which
  10328. comes from a directory deeper
  10329. in the @sc{cvs} source repository:
  10330. @example
  10331. $ cvs co regfiles
  10332. U regfiles/sfile
  10333. $
  10334. @end example
  10335. @node Ampersand modules
  10336. @appendixsubsec Ampersand modules
  10337. @cindex Ampersand modules
  10338. @cindex &, in modules file
  10339. A module definition can refer to other modules by
  10340. including @samp{&@var{module}} in its definition.
  10341. @example
  10342. @var{mname} [ options ] @var{&module}@dots{}
  10343. @end example
  10344. Then getting the module creates a subdirectory for each such
  10345. module, in the directory containing the module. For
  10346. example, if modules contains
  10347. @example
  10348. ampermod &first-dir
  10349. @end example
  10350. @noindent
  10351. then a checkout will create an @code{ampermod} directory
  10352. which contains a directory called @code{first-dir},
  10353. which in turns contains all the directories and files
  10354. which live there. For example, the command
  10355. @example
  10356. $ cvs co ampermod
  10357. @end example
  10358. @noindent
  10359. will create the following files:
  10360. @example
  10361. ampermod/first-dir/file1
  10362. ampermod/first-dir/file2
  10363. ampermod/first-dir/sdir/sfile
  10364. @end example
  10365. There is one quirk/bug: the messages that @sc{cvs}
  10366. prints omit the @file{ampermod}, and thus do not
  10367. correctly display the location to which it is checking
  10368. out the files:
  10369. @example
  10370. $ cvs co ampermod
  10371. cvs checkout: Updating first-dir
  10372. U first-dir/file1
  10373. U first-dir/file2
  10374. cvs checkout: Updating first-dir/sdir
  10375. U first-dir/sdir/sfile
  10376. $
  10377. @end example
  10378. Do not rely on this buggy behavior; it may get fixed in
  10379. a future release of @sc{cvs}.
  10380. @c FIXCVS: What happens if regular and & modules are
  10381. @c combined, as in "ampermodule first-dir &second-dir"?
  10382. @c When I tried it, it seemed to just ignore the
  10383. @c "first-dir". I think perhaps it should be an error
  10384. @c (but this needs further investigation).
  10385. @c In addition to discussing what each one does, we
  10386. @c should put in a few words about why you would use one or
  10387. @c the other in various situations.
  10388. @node Excluding directories
  10389. @appendixsubsec Excluding directories
  10390. @cindex Excluding directories, in modules file
  10391. @cindex !, in modules file
  10392. An alias module may exclude particular directories from
  10393. other modules by using an exclamation mark (@samp{!})
  10394. before the name of each directory to be excluded.
  10395. For example, if the modules file contains:
  10396. @example
  10397. exmodule -a !first-dir/sdir first-dir
  10398. @end example
  10399. @noindent
  10400. then checking out the module @samp{exmodule} will check
  10401. out everything in @samp{first-dir} except any files in
  10402. the subdirectory @samp{first-dir/sdir}.
  10403. @c Note that the "!first-dir/sdir" sometimes must be listed
  10404. @c before "first-dir". That seems like a probable bug, in which
  10405. @c case perhaps it should be fixed (to allow either
  10406. @c order) rather than documented. See modules4 in testsuite.
  10407. @node Module options
  10408. @appendixsubsec Module options
  10409. @cindex Options, in modules file
  10410. Either regular modules or ampersand modules can contain
  10411. options, which supply additional information concerning
  10412. the module.
  10413. @table @code
  10414. @cindex -d, in modules file
  10415. @item -d @var{name}
  10416. Name the working directory something other than the
  10417. module name.
  10418. @c FIXME: Needs a bunch of examples, analogous to the
  10419. @c examples for alias, regular, and ampersand modules
  10420. @c which show where the files go without -d.
  10421. @cindex Export program
  10422. @cindex -e, in modules file
  10423. @item -e @var{prog}
  10424. Specify a program @var{prog} to run whenever files in a
  10425. module are exported. @var{prog} runs with a single
  10426. argument, the module name.
  10427. @c FIXME: Is it run on server? client?
  10428. @cindex Checkout program
  10429. @cindex -o, in modules file
  10430. @item -o @var{prog}
  10431. Specify a program @var{prog} to run whenever files in a
  10432. module are checked out. @var{prog} runs with a single
  10433. argument, the module name. See @ref{Module program options} for
  10434. information on how @var{prog} is called.
  10435. @c FIXME: Is it run on server? client?
  10436. @cindex Status of a module
  10437. @cindex Module status
  10438. @cindex -s, in modules file
  10439. @item -s @var{status}
  10440. Assign a status to the module. When the module file is
  10441. printed with @samp{cvs checkout -s} the modules are
  10442. sorted according to primarily module status, and
  10443. secondarily according to the module name. This option
  10444. has no other meaning. You can use this option for
  10445. several things besides status: for instance, list the
  10446. person that is responsible for this module.
  10447. @cindex Tag program
  10448. @cindex -t, in modules file
  10449. @item -t @var{prog}
  10450. Specify a program @var{prog} to run whenever files in a
  10451. module are tagged with @code{rtag}. @var{prog} runs
  10452. with two arguments: the module name and the symbolic
  10453. tag specified to @code{rtag}. It is not run
  10454. when @code{tag} is executed. Generally you will find
  10455. that taginfo is a better solution (@pxref{user-defined logging}).
  10456. @c FIXME: Is it run on server? client?
  10457. @c Problems with -t include:
  10458. @c * It is run after the tag not before
  10459. @c * It doesn't get passed all the information that
  10460. @c taginfo does ("mov", &c).
  10461. @c * It only is run for rtag, not tag.
  10462. @end table
  10463. You should also see @pxref{Module program options} about how the
  10464. ``program options'' programs are run.
  10465. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10466. @node Module program options
  10467. @appendixsubsec How the modules file ``program options'' programs are run
  10468. @cindex Modules file program options
  10469. @cindex -t, in modules file
  10470. @cindex -o, in modules file
  10471. @cindex -e, in modules file
  10472. @noindent
  10473. For checkout, rtag, and export, the program is server-based, and as such the
  10474. following applies:-
  10475. If using remote access methods (pserver, ext, etc.),
  10476. @sc{cvs} will execute this program on the server from a temporary
  10477. directory. The path is searched for this program.
  10478. If using ``local access'' (on a local or remote NFS file system, i.e.
  10479. repository set just to a path),
  10480. the program will be executed from the newly checked-out tree, if
  10481. found there, or alternatively searched for in the path if not.
  10482. The programs are all run after the operation has effectively
  10483. completed.
  10484. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10485. @node Wrappers
  10486. @appendixsec The cvswrappers file
  10487. @cindex cvswrappers (admin file)
  10488. @cindex CVSWRAPPERS, environment variable
  10489. @cindex Wrappers
  10490. @c FIXME: need some better way of separating this out
  10491. @c by functionality. -m is
  10492. @c one feature, and -k is a another. And this discussion
  10493. @c should be better motivated (e.g. start with the
  10494. @c problems, then explain how the feature solves it).
  10495. Wrappers refers to a @sc{cvs} feature which lets you
  10496. control certain settings based on the name of the file
  10497. which is being operated on. The settings are @samp{-k}
  10498. for binary files, and @samp{-m} for nonmergeable text
  10499. files.
  10500. The @samp{-m} option
  10501. specifies the merge methodology that should be used when
  10502. a non-binary file is updated. @code{MERGE} means the usual
  10503. @sc{cvs} behavior: try to merge the files. @code{COPY}
  10504. means that @code{cvs update} will refuse to merge
  10505. files, as it also does for files specified as binary
  10506. with @samp{-kb} (but if the file is specified as
  10507. binary, there is no need to specify @samp{-m 'COPY'}).
  10508. @sc{cvs} will provide the user with the
  10509. two versions of the files, and require the user using
  10510. mechanisms outside @sc{cvs}, to insert any necessary
  10511. changes.
  10512. @strong{WARNING: do not use @code{COPY} with
  10513. @sc{cvs} 1.9 or earlier - such versions of @sc{cvs} will
  10514. copy one version of your file over the other, wiping
  10515. out the previous contents.}
  10516. @c Ordinarily we don't document the behavior of old
  10517. @c versions. But this one is so dangerous, I think we
  10518. @c must. I almost renamed it to -m 'NOMERGE' so we
  10519. @c could say "never use -m 'COPY'".
  10520. The @samp{-m} wrapper option only affects behavior when
  10521. merging is done on update; it does not affect how files
  10522. are stored. See @ref{Binary files}, for more on
  10523. binary files.
  10524. The basic format of the file @file{cvswrappers} is:
  10525. @c FIXME: @example is all wrong for this. Use @deffn or
  10526. @c something more sensible.
  10527. @example
  10528. wildcard [option value][option value]...
  10529. where option is one of
  10530. -m update methodology value: MERGE or COPY
  10531. -k keyword expansion value: expansion mode
  10532. and value is a single-quote delimited value.
  10533. @end example
  10534. @ignore
  10535. @example
  10536. *.nib -f 'unwrap %s' -t 'wrap %s %s' -m 'COPY'
  10537. *.c -t 'indent %s %s'
  10538. @end example
  10539. @c When does the filter need to be an absolute pathname
  10540. @c and when will something like the above work? I
  10541. @c suspect it relates to the PATH of the server (which
  10542. @c in turn depends on all kinds of stuff, e.g. inetd
  10543. @c for pserver). I'm not sure whether/where to discuss
  10544. @c this.
  10545. @c FIXME: What do the %s's stand for?
  10546. @noindent
  10547. The above example of a @file{cvswrappers} file
  10548. states that all files/directories that end with a @code{.nib}
  10549. should be filtered with the @file{wrap} program before
  10550. checking the file into the repository. The file should
  10551. be filtered though the @file{unwrap} program when the
  10552. file is checked out of the repository. The
  10553. @file{cvswrappers} file also states that a @code{COPY}
  10554. methodology should be used when updating the files in
  10555. the repository (that is, no merging should be performed).
  10556. @c What pitfalls arise when using indent this way? Is
  10557. @c it a winning thing to do? Would be nice to at least
  10558. @c hint at those issues; we want our examples to tell
  10559. @c how to solve problems, not just to say that cvs can
  10560. @c do certain things.
  10561. The last example line says that all files that end with
  10562. @code{.c} should be filtered with @file{indent}
  10563. before being checked into the repository. Unlike the previous
  10564. example, no filtering of the @code{.c} file is done when
  10565. it is checked out of the repository.
  10566. @noindent
  10567. The @code{-t} filter is called with two arguments,
  10568. the first is the name of the file/directory to filter
  10569. and the second is the pathname to where the resulting
  10570. filtered file should be placed.
  10571. @noindent
  10572. The @code{-f} filter is called with one argument,
  10573. which is the name of the file to filter from. The end
  10574. result of this filter will be a file in the users directory
  10575. that they can work on as they normally would.
  10576. Note that the @samp{-t}/@samp{-f} features do not
  10577. conveniently handle one portion of @sc{cvs}'s operation:
  10578. determining when files are modified. @sc{cvs} will still
  10579. want a file (or directory) to exist, and it will use
  10580. its modification time to determine whether a file is
  10581. modified. If @sc{cvs} erroneously thinks a file is
  10582. unmodified (for example, a directory is unchanged but
  10583. one of the files within it is changed), you can force
  10584. it to check in the file anyway by specifying the
  10585. @samp{-f} option to @code{cvs commit} (@pxref{commit
  10586. options}).
  10587. @c This is, of course, a serious design flaw in -t/-f.
  10588. @c Probably the whole functionality needs to be
  10589. @c redesigned (starting from requirements) to fix this.
  10590. @end ignore
  10591. @c FIXME: We don't document -W or point to where it is
  10592. @c documented. Or .cvswrappers.
  10593. For example, the following command imports a
  10594. directory, treating files whose name ends in
  10595. @samp{.exe} as binary:
  10596. @example
  10597. cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag
  10598. @end example
  10599. @c Another good example, would be storing files
  10600. @c (e.g. binary files) compressed in the repository.
  10601. @c ::::::::::::::::::
  10602. @c cvswrappers
  10603. @c ::::::::::::::::::
  10604. @c *.t12 -m 'COPY'
  10605. @c *.t[0-9][0-9] -f 'gunzipcp %s' -t 'gzipcp %s %s' -m 'COPY'
  10606. @c
  10607. @c ::::::::::::::::::
  10608. @c gunzipcp
  10609. @c ::::::::::::::::::
  10610. @c :
  10611. @c [ -f $1 ] || exit 1
  10612. @c zcat $1 > /tmp/.#$1.$$
  10613. @c mv /tmp/.#$1.$$ $1
  10614. @c
  10615. @c ::::::::::::::::::
  10616. @c gzipcp
  10617. @c ::::::::::::::::::
  10618. @c :
  10619. @c DIRNAME=`echo $1 | sed -e "s|/.*/||g"`
  10620. @c if [ ! -d $DIRNAME ] ; then
  10621. @c DIRNAME=`echo $1 | sed -e "s|.*/||g"`
  10622. @c fi
  10623. @c gzip -c $DIRNAME > $2
  10624. @c One catch--"cvs diff" will not invoke the wrappers
  10625. @c (probably a CVS bug, although I haven't thought it out).
  10626. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10627. @node commit files
  10628. @appendixsec The commit support files
  10629. @cindex Committing, administrative support files
  10630. The @samp{-i} flag in the @file{modules} file can be
  10631. used to run a certain program whenever files are
  10632. committed (@pxref{modules}). The files described in
  10633. this section provide other, more flexible, ways to run
  10634. programs whenever something is committed.
  10635. There are three kind of programs that can be run on
  10636. commit. They are specified in files in the repository,
  10637. as described below. The following table summarizes the
  10638. file names and the purpose of the corresponding
  10639. programs.
  10640. @table @file
  10641. @item commitinfo
  10642. The program is responsible for checking that the commit
  10643. is allowed. If it exits with a non-zero exit status
  10644. the commit will be aborted.
  10645. @item verifymsg
  10646. The specified program is used to evaluate the log message,
  10647. and possibly verify that it contains all required
  10648. fields. This is most useful in combination with the
  10649. @file{rcsinfo} file, which can hold a log message
  10650. template (@pxref{rcsinfo}).
  10651. @item editinfo
  10652. The specified program is used to edit the log message,
  10653. and possibly verify that it contains all required
  10654. fields. This is most useful in combination with the
  10655. @file{rcsinfo} file, which can hold a log message
  10656. template (@pxref{rcsinfo}). (obsolete)
  10657. @item loginfo
  10658. The specified program is called when the commit is
  10659. complete. It receives the log message and some
  10660. additional information and can store the log message in
  10661. a file, or mail it to appropriate persons, or maybe
  10662. post it to a local newsgroup, or@dots{} Your
  10663. imagination is the limit!
  10664. @end table
  10665. @menu
  10666. * syntax:: The common syntax
  10667. * commitinfo:: Pre-commit checking
  10668. * verifymsg:: How are log messages evaluated?
  10669. * editinfo:: Specifying how log messages are created
  10670. (obsolete)
  10671. * loginfo:: Where should log messages be sent?
  10672. @end menu
  10673. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  10674. @node syntax
  10675. @appendixsubsec The common syntax
  10676. @cindex Info files (syntax)
  10677. @cindex Syntax of info files
  10678. @cindex Common syntax of info files
  10679. @c FIXME: having this so totally separate from the
  10680. @c Variables node is rather bogus.
  10681. The administrative files such as @file{commitinfo},
  10682. @file{loginfo}, @file{rcsinfo}, @file{verifymsg}, etc.,
  10683. all have a common format. The purpose of the files are
  10684. described later on. The common syntax is described
  10685. here.
  10686. @cindex Regular expression syntax
  10687. Each line contains the following:
  10688. @itemize @bullet
  10689. @item
  10690. @c Say anything about DEFAULT and ALL? Right now we
  10691. @c leave that to the description of each file (and in fact
  10692. @c the practice is inconsistent which is really annoying).
  10693. A regular expression. This is a basic regular
  10694. expression in the syntax used by GNU emacs.
  10695. @c FIXME: What we probably should be saying is "POSIX Basic
  10696. @c Regular Expression with the following extensions (`\('
  10697. @c `\|' '+' etc)"
  10698. @c rather than define it with reference to emacs.
  10699. @c The reference to emacs is not strictly speaking
  10700. @c true, as we don't support \=, \s, or \S. Also it isn't
  10701. @c clear we should document and/or promise to continue to
  10702. @c support all the obscure emacs extensions like \<.
  10703. @c Also need to better cite (or include) full
  10704. @c documentation for the syntax.
  10705. @c Also see comment in configure.in about what happens to the
  10706. @c syntax if we pick up a system-supplied regexp matcher.
  10707. @item
  10708. A whitespace separator---one or more spaces and/or tabs.
  10709. @item
  10710. A file name or command-line template.
  10711. @end itemize
  10712. @noindent
  10713. Blank lines are ignored. Lines that start with the
  10714. character @samp{#} are treated as comments. Long lines
  10715. unfortunately can @emph{not} be broken in two parts in
  10716. any way.
  10717. The first regular expression that matches the current
  10718. directory name in the repository is used. The rest of the line
  10719. is used as a file name or command-line as appropriate.
  10720. @c FIXME: need an example. In particular, show what
  10721. @c the regular expression is matched against (one
  10722. @c ordinarily clueful person got confused about whether it
  10723. @c includes the filename--"directory name" above should be
  10724. @c unambiguous but there is nothing like an example to
  10725. @c confirm people's understanding of this sort of thing).
  10726. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10727. @node commitinfo
  10728. @appendixsubsec Commitinfo
  10729. @cindex @file{commitinfo}
  10730. @cindex Commits, precommit verification of
  10731. @cindex Precommit checking
  10732. The @file{commitinfo} file defines programs to execute
  10733. whenever @samp{cvs commit} is about to execute. These
  10734. programs are used for pre-commit checking to verify
  10735. that the modified, added and removed files are really
  10736. ready to be committed. This could be used, for
  10737. instance, to verify that the changed files conform to
  10738. to your site's standards for coding practice.
  10739. As mentioned earlier, each line in the
  10740. @file{commitinfo} file consists of a regular expression
  10741. and a command-line template. The template can include
  10742. a program name and any number of arguments you wish to
  10743. supply to it. The full path to the current source
  10744. repository is appended to the template, followed by the
  10745. file names of any files involved in the commit (added,
  10746. removed, and modified files).
  10747. @cindex Exit status, of commitinfo
  10748. The first line with a regular expression matching the
  10749. directory within the repository will be used. If the
  10750. command returns a non-zero exit status the commit will
  10751. be aborted.
  10752. @c FIXME: need example(s) of what "directory within the
  10753. @c repository" means.
  10754. @cindex DEFAULT in commitinfo
  10755. If the repository name does not match any of the
  10756. regular expressions in this file, the @samp{DEFAULT}
  10757. line is used, if it is specified.
  10758. @cindex ALL in commitinfo
  10759. All occurrences of the name @samp{ALL} appearing as a
  10760. regular expression are used in addition to the first
  10761. matching regular expression or the name @samp{DEFAULT}.
  10762. @cindex @file{commitinfo}, working directory
  10763. @cindex @file{commitinfo}, command environment
  10764. The command will be run in the root of the workspace
  10765. containing the new versions of any files the user would like
  10766. to modify (commit), @emph{or in a copy of the workspace on
  10767. the server (@pxref{Remote repositories})}. If a file is
  10768. being removed, there will be no copy of the file under the
  10769. current directory. If a file is being added, there will be
  10770. no corresponding archive file in the repository unless the
  10771. file is being resurrected.
  10772. Note that both the repository directory and the corresponding
  10773. Attic (@pxref{Attic}) directory may need to be checked to
  10774. locate the archive file corresponding to any given file being
  10775. committed. Much of the information about the specific commit
  10776. request being made, including the destination branch, commit
  10777. message, and command line options specified, is not available
  10778. to the command.
  10779. @c FIXME: should discuss using commitinfo to control
  10780. @c who has checkin access to what (e.g. Joe can check into
  10781. @c directories a, b, and c, and Mary can check into
  10782. @c directories b, c, and d--note this case cannot be
  10783. @c conveniently handled with unix groups). Of course,
  10784. @c adding a new set of features to CVS might be a more
  10785. @c natural way to fix this problem than telling people to
  10786. @c use commitinfo.
  10787. @c FIXME: Should make some reference, especially in
  10788. @c the context of controlling who has access, to the fact
  10789. @c that commitinfo can be circumvented. Perhaps
  10790. @c mention SETXID (but has it been carefully examined
  10791. @c for holes?). This fits in with the discussion of
  10792. @c general CVS security in "Password authentication
  10793. @c security" (the bit which is not pserver-specific).
  10794. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10795. @node verifymsg
  10796. @appendixsubsec Verifying log messages
  10797. @cindex @file{verifymsg} (admin file)
  10798. @cindex Log message, verifying
  10799. Once you have entered a log message, you can evaluate
  10800. that message to check for specific content, such as
  10801. a bug ID. Use the @file{verifymsg} file to
  10802. specify a program that is used to verify the log message.
  10803. This program could be a simple script that checks
  10804. that the entered message contains the required fields.
  10805. The @file{verifymsg} file is often most useful together
  10806. with the @file{rcsinfo} file, which can be used to
  10807. specify a log message template.
  10808. Each line in the @file{verifymsg} file consists of a
  10809. regular expression and a command-line template. The
  10810. template must include a program name, and can include
  10811. any number of arguments. The full path to the current
  10812. log message template file is appended to the template.
  10813. One thing that should be noted is that the @samp{ALL}
  10814. keyword is not supported. If more than one matching
  10815. line is found, the first one is used. This can be
  10816. useful for specifying a default verification script in a
  10817. directory, and then overriding it in a subdirectory.
  10818. @cindex DEFAULT in @file{verifymsg}
  10819. If the repository name does not match any of the
  10820. regular expressions in this file, the @samp{DEFAULT}
  10821. line is used, if it is specified.
  10822. @cindex Exit status, of @file{verifymsg}
  10823. If the verification script exits with a non-zero exit status,
  10824. the commit is aborted.
  10825. @cindex @file{verifymsg}, changing the log message
  10826. In the default configuration, CVS allows the
  10827. verification script to change the log message. This is
  10828. controlled via the RereadLogAfterVerify CVSROOT/config
  10829. option.
  10830. When @samp{RereadLogAfterVerify=always} or
  10831. @samp{RereadLogAfterVerify=stat}, the log message will
  10832. either always be reread after the verification script
  10833. is run or reread only if the log message file status
  10834. has changed.
  10835. @xref{config}, for more on CVSROOT/config options.
  10836. It is NOT a good idea for a @file{verifymsg} script to
  10837. interact directly with the user in the various
  10838. client/server methods. For the @code{pserver} method,
  10839. there is no protocol support for communicating between
  10840. @file{verifymsg} and the client on the remote end. For the
  10841. @code{ext} and @code{server} methods, it is possible
  10842. for CVS to become confused by the characters going
  10843. along the same channel as the CVS protocol
  10844. messages. See @ref{Remote repositories}, for more
  10845. information on client/server setups. In addition, at the time
  10846. the @file{verifymsg} script runs, the CVS
  10847. server has locks in place in the repository. If control is
  10848. returned to the user here then other users may be stuck waiting
  10849. for access to the repository.
  10850. This option can be useful if you find yourself using an
  10851. rcstemplate that needs to be modified to remove empty
  10852. elements or to fill in default values. It can also be
  10853. useful if the rcstemplate has changed in the repository
  10854. and the CVS/Template was not updated, but is able to be
  10855. adapted to the new format by the verification script
  10856. that is run by @file{verifymsg}.
  10857. An example of an update might be to change all
  10858. occurrences of 'BugId:' to be 'DefectId:' (which can be
  10859. useful if the rcstemplate has recently been changed and
  10860. there are still checked-out user trees with cached
  10861. copies in the CVS/Template file of the older version).
  10862. Another example of an update might be to delete a line
  10863. that contains 'BugID: none' from the log message after
  10864. validation of that value as being allowed is made.
  10865. The following is a little silly example of a
  10866. @file{verifymsg} file, together with the corresponding
  10867. @file{rcsinfo} file, the log message template and an
  10868. verification script. We begin with the log message template.
  10869. We want to always record a bug-id number on the first
  10870. line of the log message. The rest of log message is
  10871. free text. The following template is found in the file
  10872. @file{/usr/cvssupport/tc.template}.
  10873. @example
  10874. BugId:
  10875. @end example
  10876. The script @file{/usr/cvssupport/bugid.verify} is used to
  10877. evaluate the log message.
  10878. @example
  10879. #!/bin/sh
  10880. #
  10881. # bugid.verify filename
  10882. #
  10883. # Verify that the log message contains a valid bugid
  10884. # on the first line.
  10885. #
  10886. if head -1 < $1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
  10887. exit 0
  10888. elif head -1 < $1 | grep '^BugId:[ ]*none$' > /dev/null; then
  10889. # It is okay to allow commits with 'BugId: none',
  10890. # but do not put that text into the real log message.
  10891. grep -v '^BugId:[ ]*none$' > $1.rewrite
  10892. mv $1.rewrite $1
  10893. exit 0
  10894. else
  10895. echo "No BugId found."
  10896. exit 1
  10897. fi
  10898. @end example
  10899. The @file{verifymsg} file contains this line:
  10900. @example
  10901. ^tc /usr/cvssupport/bugid.verify
  10902. @end example
  10903. The @file{rcsinfo} file contains this line:
  10904. @example
  10905. ^tc /usr/cvssupport/tc.template
  10906. @end example
  10907. The @file{config} file contains this line:
  10908. @example
  10909. RereadLogAfterVerify=always
  10910. @end example
  10911. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10912. @node editinfo
  10913. @appendixsubsec Editinfo
  10914. @cindex editinfo (admin file)
  10915. @cindex Editor, specifying per module
  10916. @cindex Per-module editor
  10917. @cindex Log messages, editing
  10918. @strong{Note: The @file{editinfo} feature has been
  10919. rendered obsolete. To set a default editor for log
  10920. messages use the @code{CVSEDITOR}, @code{EDITOR} environment variables
  10921. (@pxref{Environment variables}) or the @samp{-e} global
  10922. option (@pxref{Global options}). See @ref{verifymsg},
  10923. for information on the use of the @file{verifymsg}
  10924. feature for evaluating log messages.}
  10925. If you want to make sure that all log messages look the
  10926. same way, you can use the @file{editinfo} file to
  10927. specify a program that is used to edit the log message.
  10928. This program could be a custom-made editor that always
  10929. enforces a certain style of the log message, or maybe a
  10930. simple shell script that calls an editor, and checks
  10931. that the entered message contains the required fields.
  10932. If no matching line is found in the @file{editinfo}
  10933. file, the editor specified in the environment variable
  10934. @code{$CVSEDITOR} is used instead. If that variable is
  10935. not set, then the environment variable @code{$EDITOR}
  10936. is used instead. If that variable is not
  10937. set a default will be used. See @ref{Committing your changes}.
  10938. The @file{editinfo} file is often most useful together
  10939. with the @file{rcsinfo} file, which can be used to
  10940. specify a log message template.
  10941. Each line in the @file{editinfo} file consists of a
  10942. regular expression and a command-line template. The
  10943. template must include a program name, and can include
  10944. any number of arguments. The full path to the current
  10945. log message template file is appended to the template.
  10946. One thing that should be noted is that the @samp{ALL}
  10947. keyword is not supported. If more than one matching
  10948. line is found, the first one is used. This can be
  10949. useful for specifying a default edit script in a
  10950. module, and then overriding it in a subdirectory.
  10951. @cindex DEFAULT in editinfo
  10952. If the repository name does not match any of the
  10953. regular expressions in this file, the @samp{DEFAULT}
  10954. line is used, if it is specified.
  10955. If the edit script exits with a non-zero exit status,
  10956. the commit is aborted.
  10957. Note: when @sc{cvs} is accessing a remote repository,
  10958. or when the @samp{-m} or @samp{-F} options to @code{cvs
  10959. commit} are used, @file{editinfo} will not be consulted.
  10960. There is no good workaround for this; use
  10961. @file{verifymsg} instead.
  10962. @menu
  10963. * editinfo example:: Editinfo example
  10964. @end menu
  10965. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  10966. @node editinfo example
  10967. @appendixsubsubsec Editinfo example
  10968. The following is a little silly example of a
  10969. @file{editinfo} file, together with the corresponding
  10970. @file{rcsinfo} file, the log message template and an
  10971. editor script. We begin with the log message template.
  10972. We want to always record a bug-id number on the first
  10973. line of the log message. The rest of log message is
  10974. free text. The following template is found in the file
  10975. @file{/usr/cvssupport/tc.template}.
  10976. @example
  10977. BugId:
  10978. @end example
  10979. The script @file{/usr/cvssupport/bugid.edit} is used to
  10980. edit the log message.
  10981. @example
  10982. #!/bin/sh
  10983. #
  10984. # bugid.edit filename
  10985. #
  10986. # Call $EDITOR on FILENAME, and verify that the
  10987. # resulting file contains a valid bugid on the first
  10988. # line.
  10989. if [ "x$EDITOR" = "x" ]; then EDITOR=vi; fi
  10990. if [ "x$CVSEDITOR" = "x" ]; then CVSEDITOR=$EDITOR; fi
  10991. $CVSEDITOR $1
  10992. until head -1|grep '^BugId:[ ]*[0-9][0-9]*$' < $1
  10993. do echo -n "No BugId found. Edit again? ([y]/n)"
  10994. read ans
  10995. case $@{ans@} in
  10996. n*) exit 1;;
  10997. esac
  10998. $CVSEDITOR $1
  10999. done
  11000. @end example
  11001. The @file{editinfo} file contains this line:
  11002. @example
  11003. ^tc /usr/cvssupport/bugid.edit
  11004. @end example
  11005. The @file{rcsinfo} file contains this line:
  11006. @example
  11007. ^tc /usr/cvssupport/tc.template
  11008. @end example
  11009. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11010. @node loginfo
  11011. @appendixsubsec Loginfo
  11012. @cindex loginfo (admin file)
  11013. @cindex Storing log messages
  11014. @cindex Mailing log messages
  11015. @cindex Distributing log messages
  11016. @cindex Log messages
  11017. @c "cvs commit" is not quite right. What we
  11018. @c mean is "when the repository gets changed" which
  11019. @c also includes "cvs import" and "cvs add" on a directory.
  11020. The @file{loginfo} file is used to control where
  11021. @samp{cvs commit} log information is sent. The first
  11022. entry on a line is a regular expression which is tested
  11023. against the directory that the change is being made to,
  11024. relative to the @code{$CVSROOT}. If a match is found, then
  11025. the remainder of the line is a filter program that
  11026. should expect log information on its standard input.
  11027. If the repository name does not match any of the
  11028. regular expressions in this file, the @samp{DEFAULT}
  11029. line is used, if it is specified.
  11030. All occurrences of the name @samp{ALL} appearing as a
  11031. regular expression are used in addition to the first
  11032. matching regular expression or @samp{DEFAULT}.
  11033. The first matching regular expression is used.
  11034. @xref{commit files}, for a description of the syntax of
  11035. the @file{loginfo} file.
  11036. The user may specify a format string as
  11037. part of the filter. The string is composed of a
  11038. @samp{%} followed by a space, or followed by a single
  11039. format character, or followed by a set of format
  11040. characters surrounded by @samp{@{} and @samp{@}} as
  11041. separators. The format characters are:
  11042. @table @t
  11043. @item s
  11044. file name
  11045. @item V
  11046. old version number (pre-checkin)
  11047. @item v
  11048. new version number (post-checkin)
  11049. @end table
  11050. All other characters that appear in a format string
  11051. expand to an empty field (commas separating fields are
  11052. still provided).
  11053. For example, some valid format strings are @samp{%},
  11054. @samp{%s}, @samp{%@{s@}}, and @samp{%@{sVv@}}.
  11055. The output will be a space separated string of tokens enclosed in
  11056. quotation marks (@t{"}).
  11057. Any embedded dollar signs (@t{$}), backticks (@t{`}),
  11058. backslashes (@t{\}), or quotation marks will be preceded
  11059. by a backslash (this allows the shell to correctly parse it
  11060. as a single string, regardless of the characters it contains).
  11061. For backwards compatibility, the first
  11062. token will be the repository subdirectory. The rest of the
  11063. tokens will be comma-delimited lists of the information
  11064. requested in the format string. For example, if
  11065. @samp{/u/src/master/yoyodyne/tc} is the repository, @samp{%@{sVv@}}
  11066. is the format string, and three files (@t{ChangeLog},
  11067. @t{Makefile}, @t{foo.c}) were modified, the output
  11068. might be:
  11069. @example
  11070. "yoyodyne/tc ChangeLog,1.1,1.2 Makefile,1.3,1.4 foo.c,1.12,1.13"
  11071. @end example
  11072. As another example, @samp{%@{@}} means that only the
  11073. name of the repository will be generated.
  11074. Note: when @sc{cvs} is accessing a remote repository,
  11075. @file{loginfo} will be run on the @emph{remote}
  11076. (i.e., server) side, not the client side (@pxref{Remote
  11077. repositories}).
  11078. @menu
  11079. * loginfo example:: Loginfo example
  11080. * Keeping a checked out copy:: Updating a tree on every checkin
  11081. @end menu
  11082. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  11083. @node loginfo example
  11084. @appendixsubsubsec Loginfo example
  11085. The following @file{loginfo} file, together with the
  11086. tiny shell-script below, appends all log messages
  11087. to the file @file{$CVSROOT/CVSROOT/commitlog},
  11088. and any commits to the administrative files (inside
  11089. the @file{CVSROOT} directory) are also logged in
  11090. @file{/usr/adm/cvsroot-log}.
  11091. Commits to the @file{prog1} directory are mailed to @t{ceder}.
  11092. @c FIXME: is it a CVS feature or bug that only the
  11093. @c first matching line is used? It is documented
  11094. @c above, but is it useful? For example, if we wanted
  11095. @c to run both "cvs-log" and "Mail" for the CVSROOT
  11096. @c directory, it is kind of awkward if
  11097. @c only the first matching line is used.
  11098. @example
  11099. ALL /usr/local/bin/cvs-log $CVSROOT/CVSROOT/commitlog $USER
  11100. ^CVSROOT /usr/local/bin/cvs-log /usr/adm/cvsroot-log
  11101. ^prog1 Mail -s %s ceder
  11102. @end example
  11103. The shell-script @file{/usr/local/bin/cvs-log} looks
  11104. like this:
  11105. @example
  11106. #!/bin/sh
  11107. (echo "------------------------------------------------------";
  11108. echo -n $2" ";
  11109. date;
  11110. echo;
  11111. cat) >> $1
  11112. @end example
  11113. @node Keeping a checked out copy
  11114. @appendixsubsubsec Keeping a checked out copy
  11115. @c What other index entries? It seems like
  11116. @c people might want to use a lot of different
  11117. @c words for this functionality.
  11118. @cindex Keeping a checked out copy
  11119. @cindex Checked out copy, keeping
  11120. @cindex Web pages, maintaining with CVS
  11121. It is often useful to maintain a directory tree which
  11122. contains files which correspond to the latest version
  11123. in the repository. For example, other developers might
  11124. want to refer to the latest sources without having to
  11125. check them out, or you might be maintaining a web site
  11126. with @sc{cvs} and want every checkin to cause the files
  11127. used by the web server to be updated.
  11128. @c Can we offer more details on the web example? Or
  11129. @c point the user at how to figure it out? This text
  11130. @c strikes me as sufficient for someone who already has
  11131. @c some idea of what we mean but not enough for the naive
  11132. @c user/sysadmin to understand it and set it up.
  11133. The way to do this is by having loginfo invoke
  11134. @code{cvs update}. Doing so in the naive way will
  11135. cause a problem with locks, so the @code{cvs update}
  11136. must be run in the background.
  11137. @c Should we try to describe the problem with locks?
  11138. @c It seems like a digression for someone who just
  11139. @c wants to know how to make it work.
  11140. @c Another choice which might work for a single file
  11141. @c is to use "cvs -n update -p" which doesn't take
  11142. @c out locks (I think) but I don't see many advantages
  11143. @c of that and we might as well document something which
  11144. @c works for multiple files.
  11145. Here is an example for unix (this should all be on one line):
  11146. @example
  11147. ^cyclic-pages (date; cat; (sleep 2; cd /u/www/local-docs;
  11148. cvs -q update -d) &) >> $CVSROOT/CVSROOT/updatelog 2>&1
  11149. @end example
  11150. This will cause checkins to repository directories
  11151. starting with @code{cyclic-pages} to update the checked
  11152. out tree in @file{/u/www/local-docs}.
  11153. @c More info on some of the details? The "sleep 2" is
  11154. @c so if we are lucky the lock will be gone by the time
  11155. @c we start and we can wait 2 seconds instead of 30.
  11156. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11157. @node rcsinfo
  11158. @appendixsec Rcsinfo
  11159. @cindex rcsinfo (admin file)
  11160. @cindex Form for log message
  11161. @cindex Log message template
  11162. @cindex Template for log message
  11163. The @file{rcsinfo} file can be used to specify a form to
  11164. edit when filling out the commit log. The
  11165. @file{rcsinfo} file has a syntax similar to the
  11166. @file{verifymsg}, @file{commitinfo} and @file{loginfo}
  11167. files. @xref{syntax}. Unlike the other files the second
  11168. part is @emph{not} a command-line template. Instead,
  11169. the part after the regular expression should be a full pathname to
  11170. a file containing the log message template.
  11171. If the repository name does not match any of the
  11172. regular expressions in this file, the @samp{DEFAULT}
  11173. line is used, if it is specified.
  11174. All occurrences of the name @samp{ALL} appearing as a
  11175. regular expression are used in addition to the first
  11176. matching regular expression or @samp{DEFAULT}.
  11177. @c FIXME: should be offering advice, somewhere around
  11178. @c here, about where to put the template file. The
  11179. @c verifymsg example uses /usr/cvssupport but doesn't
  11180. @c say anything about what that directory is for or
  11181. @c whether it is hardwired into CVS or who creates
  11182. @c it or anything. In particular we should say
  11183. @c how to version control the template file. A
  11184. @c probably better answer than the /usr/cvssupport
  11185. @c stuff is to use checkoutlist (with xref to the
  11186. @c checkoutlist doc).
  11187. @c Also I am starting to see a connection between
  11188. @c this and the Keeping a checked out copy node.
  11189. @c Probably want to say something about that.
  11190. The log message template will be used as a default log
  11191. message. If you specify a log message with @samp{cvs
  11192. commit -m @var{message}} or @samp{cvs commit -f
  11193. @var{file}} that log message will override the
  11194. template.
  11195. @xref{verifymsg}, for an example @file{rcsinfo}
  11196. file.
  11197. When @sc{cvs} is accessing a remote repository,
  11198. the contents of @file{rcsinfo} at the time a directory
  11199. is first checked out will specify a template. This
  11200. template will be updated on all @samp{cvs update}
  11201. commands. It will also be added to new directories
  11202. added with a @samp{cvs add new-directry} command.
  11203. In versions of @sc{cvs} prior to version 1.12, the
  11204. @file{CVS/Template} file was not updated. If the
  11205. @sc{cvs} server is at version 1.12 or higher an older
  11206. client may be used and the @file{CVS/Template} will
  11207. be updated from the server.
  11208. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11209. @node cvsignore
  11210. @appendixsec Ignoring files via cvsignore
  11211. @cindex cvsignore (admin file), global
  11212. @cindex Global cvsignore
  11213. @cindex Ignoring files
  11214. @c -- This chapter should maybe be moved to the
  11215. @c tutorial part of the manual?
  11216. There are certain file names that frequently occur
  11217. inside your working copy, but that you don't want to
  11218. put under @sc{cvs} control. Examples are all the object
  11219. files that you get while you compile your sources.
  11220. Normally, when you run @samp{cvs update}, it prints a
  11221. line for each file it encounters that it doesn't know
  11222. about (@pxref{update output}).
  11223. @sc{cvs} has a list of files (or sh(1) file name patterns)
  11224. that it should ignore while running @code{update},
  11225. @code{import} and @code{release}.
  11226. @c -- Are those the only three commands affected?
  11227. This list is constructed in the following way.
  11228. @itemize @bullet
  11229. @item
  11230. The list is initialized to include certain file name
  11231. patterns: names associated with @sc{cvs}
  11232. administration, or with other common source control
  11233. systems; common names for patch files, object files,
  11234. archive files, and editor backup files; and other names
  11235. that are usually artifacts of assorted utilities.
  11236. Currently, the default list of ignored file name
  11237. patterns is:
  11238. @cindex Ignored files
  11239. @cindex Automatically ignored files
  11240. @example
  11241. RCS SCCS CVS CVS.adm
  11242. RCSLOG cvslog.*
  11243. tags TAGS
  11244. .make.state .nse_depinfo
  11245. *~ #* .#* ,* _$* *$
  11246. *.old *.bak *.BAK *.orig *.rej .del-*
  11247. *.a *.olb *.o *.obj *.so *.exe
  11248. *.Z *.elc *.ln
  11249. core
  11250. @end example
  11251. @item
  11252. The per-repository list in
  11253. @file{$CVSROOT/CVSROOT/cvsignore} is appended to
  11254. the list, if that file exists.
  11255. @item
  11256. The per-user list in @file{.cvsignore} in your home
  11257. directory is appended to the list, if it exists.
  11258. @item
  11259. Any entries in the environment variable
  11260. @code{$CVSIGNORE} is appended to the list.
  11261. @item
  11262. Any @samp{-I} options given to @sc{cvs} is appended.
  11263. @item
  11264. As @sc{cvs} traverses through your directories, the contents
  11265. of any @file{.cvsignore} will be appended to the list.
  11266. The patterns found in @file{.cvsignore} are only valid
  11267. for the directory that contains them, not for
  11268. any sub-directories.
  11269. @end itemize
  11270. In any of the 5 places listed above, a single
  11271. exclamation mark (@samp{!}) clears the ignore list.
  11272. This can be used if you want to store any file which
  11273. normally is ignored by @sc{cvs}.
  11274. Specifying @samp{-I !} to @code{cvs import} will import
  11275. everything, which is generally what you want to do if
  11276. you are importing files from a pristine distribution or
  11277. any other source which is known to not contain any
  11278. extraneous files. However, looking at the rules above
  11279. you will see there is a fly in the ointment; if the
  11280. distribution contains any @file{.cvsignore} files, then
  11281. the patterns from those files will be processed even if
  11282. @samp{-I !} is specified. The only workaround is to
  11283. remove the @file{.cvsignore} files in order to do the
  11284. import. Because this is awkward, in the future
  11285. @samp{-I !} might be modified to override
  11286. @file{.cvsignore} files in each directory.
  11287. Note that the syntax of the ignore files consists of a
  11288. series of lines, each of which contains a space
  11289. separated list of filenames. This offers no clean way
  11290. to specify filenames which contain spaces, but you can
  11291. use a workaround like @file{foo?bar} to match a file
  11292. named @file{foo bar} (it also matches @file{fooxbar}
  11293. and the like). Also note that there is currently no
  11294. way to specify comments.
  11295. @c FIXCVS? I don't _like_ this syntax at all, but
  11296. @c changing it raises all the usual compatibility
  11297. @c issues and I'm also not sure what to change it to.
  11298. @node checkoutlist
  11299. @appendixsec The checkoutlist file
  11300. @cindex checkoutlist
  11301. It may be helpful to use @sc{cvs} to maintain your own
  11302. files in the @file{CVSROOT} directory. For example,
  11303. suppose that you have a script @file{logcommit.pl}
  11304. which you run by including the following line in the
  11305. @file{commitinfo} administrative file:
  11306. @example
  11307. ALL $CVSROOT/CVSROOT/logcommit.pl
  11308. @end example
  11309. To maintain @file{logcommit.pl} with @sc{cvs} you would
  11310. add the following line to the @file{checkoutlist}
  11311. administrative file:
  11312. @example
  11313. logcommit.pl
  11314. @end example
  11315. The format of @file{checkoutlist} is one line for each
  11316. file that you want to maintain using @sc{cvs}, giving
  11317. the name of the file.
  11318. After setting up @file{checkoutlist} in this fashion,
  11319. the files listed there will function just like
  11320. @sc{cvs}'s built-in administrative files. For example,
  11321. when checking in one of the files you should get a
  11322. message such as:
  11323. @example
  11324. cvs commit: Rebuilding administrative file database
  11325. @end example
  11326. @noindent
  11327. and the checked out copy in the @file{CVSROOT}
  11328. directory should be updated.
  11329. Note that listing @file{passwd} (@pxref{Password
  11330. authentication server}) in @file{checkoutlist} is not
  11331. recommended for security reasons.
  11332. For information about keeping a checkout out copy in a
  11333. more general context than the one provided by
  11334. @file{checkoutlist}, see @ref{Keeping a checked out
  11335. copy}.
  11336. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11337. @node history file
  11338. @appendixsec The history file
  11339. @cindex History file
  11340. @cindex Log information, saving
  11341. The file @file{$CVSROOT/CVSROOT/history} is used
  11342. to log information for the @code{history} command
  11343. (@pxref{history}). This file must be created to turn
  11344. on logging. This is done automatically if the
  11345. @code{cvs init} command is used to set up the
  11346. repository (@pxref{Creating a repository}).
  11347. The file format of the @file{history} file is
  11348. documented only in comments in the @sc{cvs} source
  11349. code, but generally programs should use the @code{cvs
  11350. history} command to access it anyway, in case the
  11351. format changes with future releases of @sc{cvs}.
  11352. @node Variables
  11353. @appendixsec Expansions in administrative files
  11354. @cindex Internal variables
  11355. @cindex Variables
  11356. Sometimes in writing an administrative file, you might
  11357. want the file to be able to know various things based
  11358. on environment @sc{cvs} is running in. There are
  11359. several mechanisms to do that.
  11360. To find the home directory of the user running @sc{cvs}
  11361. (from the @code{HOME} environment variable), use
  11362. @samp{~} followed by @samp{/} or the end of the line.
  11363. Likewise for the home directory of @var{user}, use
  11364. @samp{~@var{user}}. These variables are expanded on
  11365. the server machine, and don't get any reasonable
  11366. expansion if pserver (@pxref{Password authenticated})
  11367. is in use; therefore user variables (see below) may be
  11368. a better choice to customize behavior based on the user
  11369. running @sc{cvs}.
  11370. @c Based on these limitations, should we deprecate ~?
  11371. @c What is it good for? Are people using it?
  11372. One may want to know about various pieces of
  11373. information internal to @sc{cvs}. A @sc{cvs} internal
  11374. variable has the syntax @code{$@{@var{variable}@}},
  11375. where @var{variable} starts with a letter and consists
  11376. of alphanumeric characters and @samp{_}. If the
  11377. character following @var{variable} is a
  11378. non-alphanumeric character other than @samp{_}, the
  11379. @samp{@{} and @samp{@}} can be omitted. The @sc{cvs}
  11380. internal variables are:
  11381. @table @code
  11382. @item CVSROOT
  11383. @cindex CVSROOT, internal variable
  11384. This is the absolute path to the current @sc{cvs} root directory.
  11385. @xref{Repository}, for a description of the various
  11386. ways to specify this, but note that the internal
  11387. variable contains just the directory and not any
  11388. of the access method information.
  11389. @item RCSBIN
  11390. @cindex RCSBIN, internal variable
  11391. In @sc{cvs} 1.9.18 and older, this specified the
  11392. directory where @sc{cvs} was looking for @sc{rcs}
  11393. programs. Because @sc{cvs} no longer runs @sc{rcs}
  11394. programs, specifying this internal variable is now an
  11395. error.
  11396. @item CVSEDITOR
  11397. @cindex CVSEDITOR, internal variable
  11398. @itemx EDITOR
  11399. @cindex EDITOR, internal variable
  11400. @itemx VISUAL
  11401. @cindex VISUAL, internal variable
  11402. These all expand to the same value, which is the editor
  11403. that @sc{cvs} is using. @xref{Global options}, for how
  11404. to specify this.
  11405. @item USER
  11406. @cindex USER, internal variable
  11407. Username of the user running @sc{cvs} (on the @sc{cvs}
  11408. server machine).
  11409. When using pserver, this is the user specified in the repository
  11410. specification which need not be the same as the username the
  11411. server is running as (@pxref{Password authentication server}).
  11412. Do not confuse this with the environment variable of the same name.
  11413. @end table
  11414. If you want to pass a value to the administrative files
  11415. which the user who is running @sc{cvs} can specify,
  11416. use a user variable.
  11417. @cindex User variables
  11418. To expand a user variable, the
  11419. administrative file contains
  11420. @code{$@{=@var{variable}@}}. To set a user variable,
  11421. specify the global option @samp{-s} to @sc{cvs}, with
  11422. argument @code{@var{variable}=@var{value}}. It may be
  11423. particularly useful to specify this option via
  11424. @file{.cvsrc} (@pxref{~/.cvsrc}).
  11425. For example, if you want the administrative file to
  11426. refer to a test directory you might create a user
  11427. variable @code{TESTDIR}. Then if @sc{cvs} is invoked
  11428. as
  11429. @example
  11430. cvs -s TESTDIR=/work/local/tests
  11431. @end example
  11432. @noindent
  11433. and the
  11434. administrative file contains @code{sh
  11435. $@{=TESTDIR@}/runtests}, then that string is expanded
  11436. to @code{sh /work/local/tests/runtests}.
  11437. All other strings containing @samp{$} are reserved;
  11438. there is no way to quote a @samp{$} character so that
  11439. @samp{$} represents itself.
  11440. Environment variables passed to administrative files are:
  11441. @table @code
  11442. @cindex environment variables, passed to administrative files
  11443. @item CVS_USER
  11444. @cindex CVS_USER, environment variable
  11445. The @sc{cvs}-specific username provided by the user, if it
  11446. can be provided (currently just for the pserver access
  11447. method), and to the empty string otherwise. (@code{CVS_USER}
  11448. and @code{USER} may differ when @file{$CVSROOT/CVSROOT/passwd}
  11449. is used to map @sc{cvs} usernames to system usernames.)
  11450. @item LOGNAME
  11451. @cindex LOGNAME, environment variable
  11452. The username of the system user.
  11453. @item USER
  11454. @cindex USER, environment variable
  11455. Same as @code{LOGNAME}.
  11456. Do not confuse this with the internal variable of the same name.
  11457. @end table
  11458. @node config
  11459. @appendixsec The CVSROOT/config configuration file
  11460. @cindex config, in CVSROOT
  11461. @cindex CVSROOT/config
  11462. The administrative file @file{config} contains various
  11463. miscellaneous settings which affect the behavior of
  11464. @sc{cvs}. The syntax is slightly different from the
  11465. other administrative files. Variables are not
  11466. expanded. Lines which start with @samp{#} are
  11467. considered comments.
  11468. @c FIXME: where do we define comments for the other
  11469. @c administrative files.
  11470. Other lines consist of a keyword, @samp{=}, and a
  11471. value. Note that this syntax is very strict.
  11472. Extraneous spaces or tabs are not permitted.
  11473. @c See comments in parseinfo.c:parse_config for more
  11474. @c discussion of this strictness.
  11475. Currently defined keywords are:
  11476. @table @code
  11477. @cindex RCSBIN, in CVSROOT/config
  11478. @item RCSBIN=@var{bindir}
  11479. For @sc{cvs} 1.9.12 through 1.9.18, this setting told
  11480. @sc{cvs} to look for @sc{rcs} programs in the
  11481. @var{bindir} directory. Current versions of @sc{cvs}
  11482. do not run @sc{rcs} programs; for compatibility this
  11483. setting is accepted, but it does nothing.
  11484. @cindex SystemAuth, in CVSROOT/config
  11485. @item SystemAuth=@var{value}
  11486. If @var{value} is @samp{yes}, then pserver should check
  11487. for users in the system's user database if not found in
  11488. @file{CVSROOT/passwd}. If it is @samp{no}, then all
  11489. pserver users must exist in @file{CVSROOT/passwd}.
  11490. The default is @samp{yes}. For more on pserver, see
  11491. @ref{Password authenticated}.
  11492. @ignore
  11493. @cindex PreservePermissions, in CVSROOT/config
  11494. @item PreservePermissions=@var{value}
  11495. Enable support for saving special device files,
  11496. symbolic links, file permissions and ownerships in the
  11497. repository. The default value is @samp{no}.
  11498. @xref{Special Files}, for the full implications of using
  11499. this keyword.
  11500. @end ignore
  11501. @cindex TopLevelAdmin, in CVSROOT/config
  11502. @item TopLevelAdmin=@var{value}
  11503. Modify the @samp{checkout} command to create a
  11504. @samp{CVS} directory at the top level of the new
  11505. working directory, in addition to @samp{CVS}
  11506. directories created within checked-out directories.
  11507. The default value is @samp{no}.
  11508. This option is useful if you find yourself performing
  11509. many commands at the top level of your working
  11510. directory, rather than in one of the checked out
  11511. subdirectories. The @file{CVS} directory created there
  11512. will mean you don't have to specify @code{CVSROOT} for
  11513. each command. It also provides a place for the
  11514. @file{CVS/Template} file (@pxref{Working directory
  11515. storage}).
  11516. @cindex LockDir, in CVSROOT/config
  11517. @item LockDir=@var{directory}
  11518. Put @sc{cvs} lock files in @var{directory} rather than
  11519. directly in the repository. This is useful if you want
  11520. to let users read from the repository while giving them
  11521. write access only to @var{directory}, not to the
  11522. repository.
  11523. It can also be used to put the locks on a very fast
  11524. in-memory file system to speed up locking and unlocking
  11525. the repository.
  11526. You need to create @var{directory}, but
  11527. @sc{cvs} will create subdirectories of @var{directory} as it
  11528. needs them. For information on @sc{cvs} locks, see
  11529. @ref{Concurrency}.
  11530. @c Mention this in Compatibility section?
  11531. Before enabling the LockDir option, make sure that you
  11532. have tracked down and removed any copies of @sc{cvs} 1.9 or
  11533. older. Such versions neither support LockDir, nor will
  11534. give an error indicating that they don't support it.
  11535. The result, if this is allowed to happen, is that some
  11536. @sc{cvs} users will put the locks one place, and others will
  11537. put them another place, and therefore the repository
  11538. could become corrupted. @sc{cvs} 1.10 does not support
  11539. LockDir but it will print a warning if run on a
  11540. repository with LockDir enabled.
  11541. @cindex LogHistory, in CVSROOT/config
  11542. @item LogHistory=@var{value}
  11543. Control what is logged to the @file{CVSROOT/history} file (@pxref{history}).
  11544. Default of @samp{TOEFWUCGMAR} (or simply @samp{all}) will log
  11545. all transactions. Any subset of the default is
  11546. legal. (For example, to only log transactions that modify the
  11547. @file{*,v} files, use @samp{LogHistory=TMAR}.)
  11548. @cindex RereadLogAfterVerify, in CVSROOT/config
  11549. @cindex @file{verifymsg}, changing the log message
  11550. @item RereadLogAfterVerify=@var{value}
  11551. Modify the @samp{commit} command such that CVS will reread the
  11552. log message after running the program specified by @file{verifymsg}.
  11553. @var{value} may be one of @samp{yes} or @samp{always}, indicating that
  11554. the log message should always be reread; @samp{no}
  11555. or @samp{never}, indicating that it should never be
  11556. reread; or @var{value} may be @samp{stat}, indicating
  11557. that the file should be checked with the filesystem
  11558. @samp{stat()} function to see if it has changed (see warning below)
  11559. before rereading. The default value is @samp{always}.
  11560. @strong{Note: the `stat' mode can cause CVS to pause for up to
  11561. one extra second per directory committed. This can be less IO and
  11562. CPU intensive but is not recommended for use with large repositories}
  11563. @xref{verifymsg}, for more information on how verifymsg
  11564. may be used.
  11565. @cindex UserAdminOptions, in CVSROOT/config
  11566. @item UserAdminOptions=@var{value}
  11567. Control what options will be allowed with the @code{cvs admin}
  11568. command (@pxref{admin}) for users not in the @code{cvsadmin} group.
  11569. The @var{value} string is a list of single character options
  11570. which should be allowed. If a user who is not a member of the
  11571. @code{cvsadmin} group tries to execute any @code{cvs admin}
  11572. option which is not listed they will will receive an error message
  11573. reporting that the option is restricted.
  11574. If no @code{cvsadmin} group exists on the server, @sc{cvs} will
  11575. ignore the @code{UserAdminOptions} keyword (@pxref{admin}).
  11576. When not specified, @code{UserAdminOptions} defaults to
  11577. @samp{k}. In other words, it defaults to allowing
  11578. users outside of the @code{cvsadmin} group to use the
  11579. @code{cvs admin} command only to change the default keyword
  11580. expansion mode for files.
  11581. As an example, to restrict users not in the @code{cvsadmin}
  11582. group to using @code{cvs admin} to change the default keyword
  11583. substitution mode, lock revisions, unlock revisions, and
  11584. replace the log message, use @samp{UserAdminOptions=klum}.
  11585. @end table
  11586. @c ---------------------------------------------------------------------
  11587. @node Environment variables
  11588. @appendix All environment variables which affect CVS
  11589. @cindex Environment variables
  11590. @cindex Reference manual for variables
  11591. This is a complete list of all environment variables
  11592. that affect @sc{cvs}.
  11593. @table @code
  11594. @cindex CVSIGNORE, environment variable
  11595. @item $CVSIGNORE
  11596. A whitespace-separated list of file name patterns that
  11597. @sc{cvs} should ignore. @xref{cvsignore}.
  11598. @cindex CVSWRAPPERS, environment variable
  11599. @item $CVSWRAPPERS
  11600. A whitespace-separated list of file name patterns that
  11601. @sc{cvs} should treat as wrappers. @xref{Wrappers}.
  11602. @cindex CVSREAD, environment variable
  11603. @cindex Read-only files, and CVSREAD
  11604. @item $CVSREAD
  11605. If this is set, @code{checkout} and @code{update} will
  11606. try hard to make the files in your working directory
  11607. read-only. When this is not set, the default behavior
  11608. is to permit modification of your working files.
  11609. @cindex CVSREADONLYFS, environment variable
  11610. @item $CVSREADONLYFS
  11611. Turns on read-only repository mode. This allows one to
  11612. check out from a read-only repository, such as within
  11613. an anoncvs server, or from a CDROM repository.
  11614. It has the same effect as if the @samp{-R} command-line
  11615. option is used. This can also allow the use of
  11616. read-only NFS repositories.
  11617. @item $CVSUMASK
  11618. Controls permissions of files in the repository. See
  11619. @ref{File permissions}.
  11620. @item $CVSROOT
  11621. Should contain the full pathname to the root of the @sc{cvs}
  11622. source repository (where the @sc{rcs} files are
  11623. kept). This information must be available to @sc{cvs} for
  11624. most commands to execute; if @code{$CVSROOT} is not set,
  11625. or if you wish to override it for one invocation, you
  11626. can supply it on the command line: @samp{cvs -d cvsroot
  11627. cvs_command@dots{}} Once you have checked out a working
  11628. directory, @sc{cvs} stores the appropriate root (in
  11629. the file @file{CVS/Root}), so normally you only need to
  11630. worry about this when initially checking out a working
  11631. directory.
  11632. @item $CVSEDITOR
  11633. @cindex CVSEDITOR, environment variable
  11634. @itemx $EDITOR
  11635. @cindex EDITOR, environment variable
  11636. @itemx $VISUAL
  11637. @cindex VISUAL, environment variable
  11638. Specifies the program to use for recording log messages
  11639. during commit. @code{$CVSEDITOR} overrides
  11640. @code{$EDITOR}, which overrides @code{$VISUAL}.
  11641. See @ref{Committing your changes} for more or
  11642. @ref{Global options} for alternative ways of specifying a
  11643. log editor.
  11644. @cindex PATH, environment variable
  11645. @item $PATH
  11646. If @code{$RCSBIN} is not set, and no path is compiled
  11647. into @sc{cvs}, it will use @code{$PATH} to try to find all
  11648. programs it uses.
  11649. @cindex HOME, environment variable
  11650. @item $HOME
  11651. @cindex HOMEPATH, environment variable
  11652. @item $HOMEPATH
  11653. @cindex HOMEDRIVE, environment variable
  11654. @item $HOMEDRIVE
  11655. Used to locate the directory where the @file{.cvsrc}
  11656. file, and other such files, are searched. On Unix, @sc{cvs}
  11657. just checks for @code{HOME}. On Windows NT, the system will
  11658. set @code{HOMEDRIVE}, for example to @samp{d:} and @code{HOMEPATH},
  11659. for example to @file{\joe}. On Windows 95, you'll
  11660. probably need to set @code{HOMEDRIVE} and @code{HOMEPATH} yourself.
  11661. @c We are being vague about whether HOME works on
  11662. @c Windows; see long comment in windows-NT/filesubr.c.
  11663. @cindex CVS_RSH, environment variable
  11664. @item $CVS_RSH
  11665. Specifies the external program which @sc{cvs} connects with,
  11666. when @code{:ext:} access method is specified.
  11667. @pxref{Connecting via rsh}.
  11668. @item $CVS_SERVER
  11669. Used in client-server mode when accessing a remote
  11670. repository using @sc{rsh}. It specifies the name of
  11671. the program to start on the server side (and any
  11672. necessary arguments) when accessing a remote repository
  11673. using the @code{:ext:}, @code{:fork:}, or @code{:server:} access methods.
  11674. The default value for @code{:ext:} and @code{:server:} is @code{cvs};
  11675. the default value for @code{:fork:} is the name used to run the client.
  11676. @pxref{Connecting via rsh}
  11677. @item $CVS_PASSFILE
  11678. Used in client-server mode when accessing the @code{cvs
  11679. login server}. Default value is @file{$HOME/.cvspass}.
  11680. @pxref{Password authentication client}
  11681. @item $CVS_CLIENT_PORT
  11682. Used in client-server mode to set the port to use when accessing the server
  11683. via Kerberos, GSSAPI, or @sc{cvs}'s password authentication protocol
  11684. if the port is not specified in the CVSROOT.
  11685. @pxref{Remote repositories}
  11686. @cindex CVS_RCMD_PORT, environment variable
  11687. @item $CVS_RCMD_PORT
  11688. Used in client-server mode. If set, specifies the port
  11689. number to be used when accessing the @sc{rcmd} demon on
  11690. the server side. (Currently not used for Unix clients).
  11691. @cindex CVS_CLIENT_LOG, environment variable
  11692. @item $CVS_CLIENT_LOG
  11693. Used for debugging only in client-server
  11694. mode. If set, everything sent to the server is logged
  11695. into @file{@code{$CVS_CLIENT_LOG}.in} and everything
  11696. sent from the server is logged into
  11697. @file{@code{$CVS_CLIENT_LOG}.out}.
  11698. @cindex CVS_SERVER_SLEEP, environment variable
  11699. @item $CVS_SERVER_SLEEP
  11700. Used only for debugging the server side in
  11701. client-server mode. If set, delays the start of the
  11702. server child process the specified amount of
  11703. seconds so that you can attach to it with a debugger.
  11704. @cindex CVS_IGNORE_REMOTE_ROOT, environment variable
  11705. @item $CVS_IGNORE_REMOTE_ROOT
  11706. For @sc{cvs} 1.10 and older, setting this variable
  11707. prevents @sc{cvs} from overwriting the @file{CVS/Root}
  11708. file when the @samp{-d} global option is specified.
  11709. Later versions of @sc{cvs} do not rewrite
  11710. @file{CVS/Root}, so @code{CVS_IGNORE_REMOTE_ROOT} has no
  11711. effect.
  11712. @cindex CVS_LOCAL_BRANCH_NUM, environment variable
  11713. @item $CVS_LOCAL_BRANCH_NUM
  11714. Setting this variable allows some control over the
  11715. branch number that is assigned. This is specifically to
  11716. support the local commit feature of CVSup. If one sets
  11717. @code{CVS_LOCAL_BRANCH_NUM} to (say) 1000 then branches
  11718. the local repository, the revision numbers will look
  11719. like 1.66.1000.xx. There is almost a dead-set certainty
  11720. that there will be no conflicts with version numbers.
  11721. @cindex COMSPEC, environment variable
  11722. @item $COMSPEC
  11723. Used under OS/2 only. It specifies the name of the
  11724. command interpreter and defaults to @sc{cmd.exe}.
  11725. @cindex TMPDIR, environment variable
  11726. @item $TMPDIR
  11727. @cindex TMP, environment variable
  11728. @itemx $TMP
  11729. @cindex TEMP, environment variable
  11730. @itemx $TEMP
  11731. @cindex Temporary files, location of
  11732. @c This is quite nuts. We don't talk about tempnam
  11733. @c or mkstemp which we sometimes use. The discussion
  11734. @c of "Global options" is semi-incoherent.
  11735. @c I'm not even sure those are the only inaccuracies.
  11736. @c Furthermore, the conventions are
  11737. @c pretty crazy and they should be simplified.
  11738. Directory in which temporary files are located.
  11739. The @sc{cvs} server uses
  11740. @code{TMPDIR}. @xref{Global options}, for a
  11741. description of how to specify this.
  11742. Some parts of @sc{cvs} will always use @file{/tmp} (via
  11743. the @code{tmpnam} function provided by the system).
  11744. On Windows NT, @code{TMP} is used (via the @code{_tempnam}
  11745. function provided by the system).
  11746. The @code{patch} program which is used by the @sc{cvs}
  11747. client uses @code{TMPDIR}, and if it is not set, uses
  11748. @file{/tmp} (at least with GNU patch 2.1). Note that
  11749. if your server and client are both running @sc{cvs}
  11750. 1.9.10 or later, @sc{cvs} will not invoke an external
  11751. @code{patch} program.
  11752. @cindex CVS_PID, environment variable
  11753. @item $CVS_PID
  11754. This is the process identification (aka pid) number of
  11755. the @sc{cvs} process. It is often useful in the
  11756. programs and/or scripts specified by the
  11757. @file{commitinfo}, @file{verifymsg}, @file{loginfo}
  11758. files.
  11759. @end table
  11760. @node Compatibility
  11761. @appendix Compatibility between CVS Versions
  11762. @cindex CVS, versions of
  11763. @cindex Versions, of CVS
  11764. @cindex Compatibility, between CVS versions
  11765. @c We don't mention versions older than CVS 1.3
  11766. @c on the theory that it would clutter it up for the vast
  11767. @c majority of people, who don't have anything that old.
  11768. @c
  11769. The repository format is compatible going back to
  11770. @sc{cvs} 1.3. But see @ref{Watches Compatibility}, if
  11771. you have copies of @sc{cvs} 1.6 or older and you want
  11772. to use the optional developer communication features.
  11773. @c If you "cvs rm" and commit using 1.3, then you'll
  11774. @c want to run "rcs -sdead <file,v>" on each of the
  11775. @c files in the Attic if you then want 1.5 and
  11776. @c later to recognize those files as dead (I think the
  11777. @c symptom if this is not done is that files reappear
  11778. @c in joins). (Wait: the above will work but really to
  11779. @c be strictly correct we should suggest checking
  11780. @c in a new revision rather than just changing the
  11781. @c state of the head revision, shouldn't we?).
  11782. @c The old convert.sh script was for this, but it never
  11783. @c did get updated to reflect use of the RCS "dead"
  11784. @c state.
  11785. @c Note: this is tricky to document without confusing
  11786. @c people--need to carefully say what CVS version we
  11787. @c are talking about and keep in mind the distinction
  11788. @c between a
  11789. @c repository created with 1.3 and on which one now
  11790. @c uses 1.5+, and a repository on which one wants to
  11791. @c use both versions side by side (e.g. during a
  11792. @c transition period).
  11793. @c Wait, can't CVS just detect the case in which a file
  11794. @c is in the Attic but the head revision is not dead?
  11795. @c Not sure whether this should produce a warning or
  11796. @c something, and probably needs further thought, but
  11797. @c it would appear that the situation can be detected.
  11798. @c
  11799. @c We might want to separate out the 1.3 compatibility
  11800. @c section (for repository & working directory) from the
  11801. @c rest--that might help avoid confusing people who
  11802. @c are upgrading (for example) from 1.6 to 1.8.
  11803. @c
  11804. @c A minor incompatibility is if a current version of CVS
  11805. @c puts "Nfoo" into CVS/Tag, then CVS 1.9 or older will
  11806. @c see this as if there is no tag. Seems to me this is
  11807. @c too obscure to mention.
  11808. The working directory format is compatible going back
  11809. to @sc{cvs} 1.5. It did change between @sc{cvs} 1.3
  11810. and @sc{cvs} 1.5. If you run @sc{cvs} 1.5 or newer on
  11811. a working directory checked out with @sc{cvs} 1.3,
  11812. @sc{cvs} will convert it, but to go back to @sc{cvs}
  11813. 1.3 you need to check out a new working directory with
  11814. @sc{cvs} 1.3.
  11815. The remote protocol is interoperable going back to @sc{cvs} 1.5, but no
  11816. further (1.5 was the first official release with the remote protocol,
  11817. but some older versions might still be floating around). In many
  11818. cases you need to upgrade both the client and the server to take
  11819. advantage of new features and bugfixes, however.
  11820. @c Perhaps should be saying something here about the
  11821. @c "D" lines in Entries (written by CVS 1.9; 1.8 and
  11822. @c older don't use them). These are supposed to be
  11823. @c compatible in both directions, but I'm not sure
  11824. @c they quite are 100%. One common gripe is if you
  11825. @c "rm -r" a directory and 1.9 gets confused, as it
  11826. @c still sees it in Entries. That one is fixed in
  11827. @c (say) 1.9.6. Someone else reported problems with
  11828. @c starting with a directory which was checked out with
  11829. @c an old version, and then using a new version, and
  11830. @c some "D" lines appeared, but not for every
  11831. @c directory, causing some directories to be skipped.
  11832. @c They weren't sure how to reproduce this, though.
  11833. @c ---------------------------------------------------------------------
  11834. @node Troubleshooting
  11835. @appendix Troubleshooting
  11836. If you are having trouble with @sc{cvs}, this appendix
  11837. may help. If there is a particular error message which
  11838. you are seeing, then you can look up the message
  11839. alphabetically. If not, you can look through the
  11840. section on other problems to see if your problem is
  11841. mentioned there.
  11842. @menu
  11843. * Error messages:: Partial list of CVS errors
  11844. * Connection:: Trouble making a connection to a CVS server
  11845. * Other problems:: Problems not readily listed by error message
  11846. @end menu
  11847. @ignore
  11848. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11849. @c @node Bad administrative files
  11850. @appendixsec Bad administrative files
  11851. @c -- Give hints on how to fix them
  11852. @end ignore
  11853. @node Error messages
  11854. @appendixsec Partial list of error messages
  11855. Here is a partial list of error messages that you may
  11856. see from @sc{cvs}. It is not a complete list---@sc{cvs}
  11857. is capable of printing many, many error messages, often
  11858. with parts of them supplied by the operating system,
  11859. but the intention is to list the common and/or
  11860. potentially confusing error messages.
  11861. The messages are alphabetical, but introductory text
  11862. such as @samp{cvs update: } is not considered in
  11863. ordering them.
  11864. In some cases the list includes messages printed by old
  11865. versions of @sc{cvs} (partly because users may not be
  11866. sure which version of @sc{cvs} they are using at any
  11867. particular moment).
  11868. @c If we want to start retiring messages, perhaps we
  11869. @c should pick a cutoff version (for example, no more
  11870. @c messages which are specific to versions before 1.9)
  11871. @c and then move the old messages to an "old messages"
  11872. @c node rather than deleting them completely.
  11873. @table @code
  11874. @c FIXME: What is the correct way to format a multiline
  11875. @c error message here? Maybe @table is the wrong
  11876. @c choice? Texinfo gurus?
  11877. @item @var{file}:@var{line}: Assertion '@var{text}' failed
  11878. The exact format of this message may vary depending on
  11879. your system. It indicates a bug in @sc{cvs}, which can
  11880. be handled as described in @ref{BUGS}.
  11881. @item cvs @var{command}: authorization failed: server @var{host} rejected access
  11882. This is a generic response when trying to connect to a
  11883. pserver server which chooses not to provide a
  11884. specific reason for denying authorization. Check that
  11885. the username and password specified are correct and
  11886. that the @code{CVSROOT} specified is allowed by @samp{--allow-root}
  11887. in @file{inetd.conf}. See @ref{Password authenticated}.
  11888. @item cvs @var{command}: conflict: removed @var{file} was modified by second party
  11889. This message indicates that you removed a file, and
  11890. someone else modified it. To resolve the conflict,
  11891. first run @samp{cvs add @var{file}}. If desired, look
  11892. at the other party's modification to decide whether you
  11893. still want to remove it. If you don't want to remove
  11894. it, stop here. If you do want to remove it, proceed
  11895. with @samp{cvs remove @var{file}} and commit your
  11896. removal.
  11897. @c Tests conflicts2-142b* in sanity.sh test for this.
  11898. @item cannot change permissions on temporary directory
  11899. @example
  11900. Operation not permitted
  11901. @end example
  11902. This message has been happening in a non-reproducible,
  11903. occasional way when we run the client/server testsuite,
  11904. both on Red Hat Linux 3.0.3 and 4.1. We haven't been
  11905. able to figure out what causes it, nor is it known
  11906. whether it is specific to linux (or even to this
  11907. particular machine!). If the problem does occur on
  11908. other unices, @samp{Operation not permitted} would be
  11909. likely to read @samp{Not owner} or whatever the system
  11910. in question uses for the unix @code{EPERM} error. If
  11911. you have any information to add, please let us know as
  11912. described in @ref{BUGS}. If you experience this error
  11913. while using @sc{cvs}, retrying the operation which
  11914. produced it should work fine.
  11915. @c This has been seen in a variety of tests, including
  11916. @c multibranch-2, multibranch-5, and basic1-24-rm-rm,
  11917. @c so it doesn't seem particularly specific to any one
  11918. @c test.
  11919. @item cvs [server aborted]: Cannot check out files into the repository itself
  11920. The obvious cause for this message (especially for
  11921. non-client/server @sc{cvs}) is that the @sc{cvs} root
  11922. is, for example, @file{/usr/local/cvsroot} and you try
  11923. to check out files when you are in a subdirectory, such
  11924. as @file{/usr/local/cvsroot/test}. However, there is a
  11925. more subtle cause, which is that the temporary
  11926. directory on the server is set to a subdirectory of the
  11927. root (which is also not allowed). If this is the
  11928. problem, set the temporary directory to somewhere else,
  11929. for example @file{/var/tmp}; see @code{TMPDIR} in
  11930. @ref{Environment variables}, for how to set the
  11931. temporary directory.
  11932. @item cannot commit files as 'root'
  11933. See @samp{'root' is not allowed to commit files}.
  11934. @c For one example see basica-1a10 in the testsuite
  11935. @c For another example, "cvs co ." on NT; see comment
  11936. @c at windows-NT/filesubr.c (expand_wild).
  11937. @c For another example, "cvs co foo/bar" where foo exists.
  11938. @item cannot open CVS/Entries for reading: No such file or directory
  11939. This generally indicates a @sc{cvs} internal error, and
  11940. can be handled as with other @sc{cvs} bugs
  11941. (@pxref{BUGS}). Usually there is a workaround---the
  11942. exact nature of which would depend on the situation but
  11943. which hopefully could be figured out.
  11944. @c This is more obscure than it might sound; it only
  11945. @c happens if you run "cvs init" from a directory which
  11946. @c contains a CVS/Root file at the start.
  11947. @item cvs [init aborted]: cannot open CVS/Root: No such file or directory
  11948. This message is harmless. Provided it is not
  11949. accompanied by other errors, the operation has
  11950. completed successfully. This message should not occur
  11951. with current versions of @sc{cvs}, but it is documented
  11952. here for the benefit of @sc{cvs} 1.9 and older.
  11953. @item cvs server: cannot open /root/.cvsignore: Permission denied
  11954. @itemx cvs [server aborted]: can't chdir(/root): Permission denied
  11955. See @ref{Connection}.
  11956. @item cvs [checkout aborted]: cannot rename file @var{file} to CVS/,,@var{file}: Invalid argument
  11957. This message has been reported as intermittently
  11958. happening with @sc{cvs} 1.9 on Solaris 2.5. The cause is
  11959. unknown; if you know more about what causes it, let us
  11960. know as described in @ref{BUGS}.
  11961. @item cvs [@var{command} aborted]: cannot start server via rcmd
  11962. This, unfortunately, is a rather nonspecific error
  11963. message which @sc{cvs} 1.9 will print if you are
  11964. running the @sc{cvs} client and it is having trouble
  11965. connecting to the server. Current versions of @sc{cvs}
  11966. should print a much more specific error message. If
  11967. you get this message when you didn't mean to run the
  11968. client at all, you probably forgot to specify
  11969. @code{:local:}, as described in @ref{Repository}.
  11970. @item ci: @var{file},v: bad diff output line: Binary files - and /tmp/T2a22651 differ
  11971. @sc{cvs} 1.9 and older will print this message
  11972. when trying to check in a binary file if
  11973. @sc{rcs} is not correctly installed. Re-read the
  11974. instructions that came with your @sc{rcs} distribution
  11975. and the @sc{install} file in the @sc{cvs}
  11976. distribution. Alternately, upgrade to a current
  11977. version of @sc{cvs}, which checks in files itself
  11978. rather than via @sc{rcs}.
  11979. @item cvs checkout: could not check out @var{file}
  11980. With @sc{cvs} 1.9, this can mean that the @code{co} program
  11981. (part of @sc{rcs}) returned a failure. It should be
  11982. preceded by another error message, however it has been
  11983. observed without another error message and the cause is
  11984. not well-understood. With the current version of @sc{cvs},
  11985. which does not run @code{co}, if this message occurs
  11986. without another error message, it is definitely a @sc{cvs}
  11987. bug (@pxref{BUGS}).
  11988. @c My current suspicion is that the RCS in the rcs (not
  11989. @c cvs/winnt/rcs57nt.zip) directory on the _Practical_
  11990. @c CD is bad (remains to be confirmed).
  11991. @c There is also a report of something which looks
  11992. @c very similar on SGI, Irix 5.2, so I dunno.
  11993. @item cvs [login aborted]: could not find out home directory
  11994. This means that you need to set the environment
  11995. variables that @sc{cvs} uses to locate your home directory.
  11996. See the discussion of @code{HOME}, @code{HOMEDRIVE}, and @code{HOMEPATH} in
  11997. @ref{Environment variables}.
  11998. @item cvs update: could not merge revision @var{rev} of @var{file}: No such file or directory
  11999. @sc{cvs} 1.9 and older will print this message if there was
  12000. a problem finding the @code{rcsmerge} program. Make
  12001. sure that it is in your @code{PATH}, or upgrade to a
  12002. current version of @sc{cvs}, which does not require
  12003. an external @code{rcsmerge} program.
  12004. @item cvs [update aborted]: could not patch @var{file}: No such file or directory
  12005. This means that there was a problem finding the
  12006. @code{patch} program. Make sure that it is in your
  12007. @code{PATH}. Note that despite appearances the message
  12008. is @emph{not} referring to whether it can find @var{file}.
  12009. If both the client and the server are running a current
  12010. version of @sc{cvs}, then there is no need for an
  12011. external patch program and you should not see this
  12012. message. But if either client or server is running
  12013. @sc{cvs} 1.9, then you need @code{patch}.
  12014. @item cvs update: could not patch @var{file}; will refetch
  12015. This means that for whatever reason the client was
  12016. unable to apply a patch that the server sent. The
  12017. message is nothing to be concerned about, because
  12018. inability to apply the patch only slows things down and
  12019. has no effect on what @sc{cvs} does.
  12020. @c xref to update output. Or File status?
  12021. @c Or some place else that
  12022. @c explains this whole "patch"/P/Needs Patch thing?
  12023. @item dying gasps from @var{server} unexpected
  12024. There is a known bug in the server for @sc{cvs} 1.9.18
  12025. and older which can cause this. For me, this was
  12026. reproducible if I used the @samp{-t} global option. It
  12027. was fixed by Andy Piper's 14 Nov 1997 change to
  12028. src/filesubr.c, if anyone is curious.
  12029. If you see the message,
  12030. you probably can just retry the operation which failed,
  12031. or if you have discovered information concerning its
  12032. cause, please let us know as described in @ref{BUGS}.
  12033. @item end of file from server (consult above messages if any)
  12034. The most common cause for this message is if you are
  12035. using an external @code{rsh} program and it exited with
  12036. an error. In this case the @code{rsh} program should
  12037. have printed a message, which will appear before the
  12038. above message. For more information on setting up a
  12039. @sc{cvs} client and server, see @ref{Remote repositories}.
  12040. @item cvs [update aborted]: EOF in key in RCS file @var{file},v
  12041. @itemx cvs [checkout aborted]: EOF while looking for end of string in RCS file @var{file},v
  12042. This means that there is a syntax error in the given
  12043. @sc{rcs} file. Note that this might be true even if @sc{rcs} can
  12044. read the file OK; @sc{cvs} does more error checking of
  12045. errors in the RCS file. That is why you may see this
  12046. message when upgrading from @sc{cvs} 1.9 to @sc{cvs}
  12047. 1.10. The likely cause for the original corruption is
  12048. hardware, the operating system, or the like. Of
  12049. course, if you find a case in which @sc{cvs} seems to
  12050. corrupting the file, by all means report it,
  12051. (@pxref{BUGS}).
  12052. There are quite a few variations of this error message,
  12053. depending on exactly where in the @sc{rcs} file @sc{cvs}
  12054. finds the syntax error.
  12055. @cindex mkmodules
  12056. @item cvs commit: Executing 'mkmodules'
  12057. This means that your repository is set up for a version
  12058. of @sc{cvs} prior to @sc{cvs} 1.8. When using @sc{cvs}
  12059. 1.8 or later, the above message will be preceded by
  12060. @example
  12061. cvs commit: Rebuilding administrative file database
  12062. @end example
  12063. If you see both messages, the database is being rebuilt
  12064. twice, which is unnecessary but harmless. If you wish
  12065. to avoid the duplication, and you have no versions of
  12066. @sc{cvs} 1.7 or earlier in use, remove @code{-i mkmodules}
  12067. every place it appears in your @code{modules}
  12068. file. For more information on the @code{modules} file,
  12069. see @ref{modules}.
  12070. @c This message comes from "co", and I believe is
  12071. @c possible only with older versions of CVS which call
  12072. @c co. The problem with being able to create the bogus
  12073. @c RCS file still exists, though (and I think maybe
  12074. @c there is a different symptom(s) now).
  12075. @c FIXME: Would be nice to have a more exact wording
  12076. @c for this message.
  12077. @item missing author
  12078. Typically this can happen if you created an RCS file
  12079. with your username set to empty. @sc{cvs} will, bogusly,
  12080. create an illegal RCS file with no value for the author
  12081. field. The solution is to make sure your username is
  12082. set to a non-empty value and re-create the RCS file.
  12083. @c "make sure your username is set" is complicated in
  12084. @c and of itself, as there are the environment
  12085. @c variables the system login name, &c, and it depends
  12086. @c on the version of CVS.
  12087. @item cvs [checkout aborted]: no such tag @var{tag}
  12088. This message means that @sc{cvs} isn't familiar with
  12089. the tag @var{tag}. Usually this means that you have
  12090. mistyped a tag name; however there are (relatively
  12091. obscure) cases in which @sc{cvs} will require you to
  12092. @c Search sanity.sh for "no such tag" to see some of
  12093. @c the relatively obscure cases.
  12094. try a few other @sc{cvs} commands involving that tag,
  12095. before you find one which will cause @sc{cvs} to update
  12096. the @file{val-tags} file; see discussion of val-tags in
  12097. @ref{File permissions}. You only need to worry about
  12098. this once for a given tag; when a tag is listed in
  12099. @file{val-tags}, it stays there. Note that using
  12100. @samp{-f} to not require tag matches does not override
  12101. this check; see @ref{Common options}.
  12102. @item *PANIC* administration files missing
  12103. This typically means that there is a directory named
  12104. @sc{cvs} but it does not contain the administrative files
  12105. which @sc{cvs} puts in a CVS directory. If the problem is
  12106. that you created a CVS directory via some mechanism
  12107. other than @sc{cvs}, then the answer is simple, use a name
  12108. other than @sc{cvs}. If not, it indicates a @sc{cvs} bug
  12109. (@pxref{BUGS}).
  12110. @item rcs error: Unknown option: -x,v/
  12111. This message will be followed by a usage message for
  12112. @sc{rcs}. It means that you have an old version of
  12113. @sc{rcs} (probably supplied with your operating
  12114. system), as well as an old version of @sc{cvs}.
  12115. @sc{cvs} 1.9.18 and earlier only work with @sc{rcs} version 5 and
  12116. later; current versions of @sc{cvs} do not run @sc{rcs} programs.
  12117. @c For more information on installing @sc{cvs}, see
  12118. @c (FIXME: where? it depends on whether you are
  12119. @c getting binaries or sources or what).
  12120. @c The message can also say "ci error" or something
  12121. @c instead of "rcs error", I suspect.
  12122. @item cvs [server aborted]: received broken pipe signal
  12123. This message seems to be caused by a hard-to-track-down
  12124. bug in @sc{cvs} or the systems it runs on (we don't
  12125. know---we haven't tracked it down yet!). It seems to
  12126. happen only after a @sc{cvs} command has completed, and
  12127. you should be able to just ignore the message.
  12128. However, if you have discovered information concerning its
  12129. cause, please let us know as described in @ref{BUGS}.
  12130. @item 'root' is not allowed to commit files
  12131. When committing a permanent change, @sc{cvs} makes a log entry of
  12132. who committed the change. If you are committing the change logged
  12133. in as "root" (not under "su" or other root-priv giving program),
  12134. @sc{cvs} cannot determine who is actually making the change.
  12135. As such, by default, @sc{cvs} disallows changes to be committed by users
  12136. logged in as "root". (You can disable this option by passing the
  12137. @code{--enable-rootcommit} option to @file{configure} and recompiling @sc{cvs}.
  12138. On some systems this means editing the appropriate @file{config.h} file
  12139. before building @sc{cvs}.)
  12140. @item Too many arguments!
  12141. This message is typically printed by the @file{log.pl}
  12142. script which is in the @file{contrib} directory in the
  12143. @sc{cvs} source distribution. In some versions of
  12144. @sc{cvs}, @file{log.pl} has been part of the default
  12145. @sc{cvs} installation. The @file{log.pl} script gets
  12146. called from the @file{loginfo} administrative file.
  12147. Check that the arguments passed in @file{loginfo} match
  12148. what your version of @file{log.pl} expects. In
  12149. particular, the @file{log.pl} from @sc{cvs} 1.3 and
  12150. older expects the logfile as an argument whereas the
  12151. @file{log.pl} from @sc{cvs} 1.5 and newer expects the
  12152. logfile to be specified with a @samp{-f} option. Of
  12153. course, if you don't need @file{log.pl} you can just
  12154. comment it out of @file{loginfo}.
  12155. @item cvs [update aborted]: unexpected EOF reading @var{file},v
  12156. See @samp{EOF in key in RCS file}.
  12157. @item cvs [login aborted]: unrecognized auth response from @var{server}
  12158. This message typically means that the server is not set
  12159. up properly. For example, if @file{inetd.conf} points
  12160. to a nonexistent cvs executable. To debug it further,
  12161. find the log file which inetd writes
  12162. (@file{/var/log/messages} or whatever inetd uses on
  12163. your system). For details, see @ref{Connection}, and
  12164. @ref{Password authentication server}.
  12165. @item cvs commit: Up-to-date check failed for `@var{file}'
  12166. This means that someone else has committed a change to
  12167. that file since the last time that you did a @code{cvs
  12168. update}. So before proceeding with your @code{cvs
  12169. commit} you need to @code{cvs update}. @sc{cvs} will merge
  12170. the changes that you made and the changes that the
  12171. other person made. If it does not detect any conflicts
  12172. it will report @samp{M @var{file}} and you are ready
  12173. to @code{cvs commit}. If it detects conflicts it will
  12174. print a message saying so, will report @samp{C @var{file}},
  12175. and you need to manually resolve the
  12176. conflict. For more details on this process see
  12177. @ref{Conflicts example}.
  12178. @item Usage: diff3 [-exEX3 [-i | -m] [-L label1 -L label3]] file1 file2 file3
  12179. @example
  12180. Only one of [exEX3] allowed
  12181. @end example
  12182. This indicates a problem with the installation of
  12183. @code{diff3} and @code{rcsmerge}. Specifically
  12184. @code{rcsmerge} was compiled to look for GNU diff3, but
  12185. it is finding unix diff3 instead. The exact text of
  12186. the message will vary depending on the system. The
  12187. simplest solution is to upgrade to a current version of
  12188. @sc{cvs}, which does not rely on external
  12189. @code{rcsmerge} or @code{diff3} programs.
  12190. @item warning: unrecognized response `@var{text}' from cvs server
  12191. If @var{text} contains a valid response (such as
  12192. @samp{ok}) followed by an extra carriage return
  12193. character (on many systems this will cause the second
  12194. part of the message to overwrite the first part), then
  12195. it probably means that you are using the @samp{:ext:}
  12196. access method with a version of rsh, such as most
  12197. non-unix rsh versions, which does not by default
  12198. provide a transparent data stream. In such cases you
  12199. probably want to try @samp{:server:} instead of
  12200. @samp{:ext:}. If @var{text} is something else, this
  12201. may signify a problem with your @sc{cvs} server.
  12202. Double-check your installation against the instructions
  12203. for setting up the @sc{cvs} server.
  12204. @c FIXCVS: should be printing CR as \r or \015 or some
  12205. @c such, probably.
  12206. @item cvs commit: [@var{time}] waiting for @var{user}'s lock in @var{directory}
  12207. This is a normal message, not an error. See
  12208. @ref{Concurrency}, for more details.
  12209. @item cvs commit: warning: editor session failed
  12210. @cindex Exit status, of editor
  12211. This means that the editor which @sc{cvs} is using exits with a nonzero
  12212. exit status. Some versions of vi will do this even when there was not
  12213. a problem editing the file. If so, point the
  12214. @code{CVSEDITOR} environment variable to a small script
  12215. such as:
  12216. @example
  12217. #!/bin/sh
  12218. vi $*
  12219. exit 0
  12220. @end example
  12221. @c "warning: foo was lost" and "no longer pertinent" (both normal).
  12222. @c Would be nice to write these up--they are
  12223. @c potentially confusing for the new user.
  12224. @end table
  12225. @node Connection
  12226. @appendixsec Trouble making a connection to a CVS server
  12227. This section concerns what to do if you are having
  12228. trouble making a connection to a @sc{cvs} server. If
  12229. you are running the @sc{cvs} command line client
  12230. running on Windows, first upgrade the client to
  12231. @sc{cvs} 1.9.12 or later. The error reporting in
  12232. earlier versions provided much less information about
  12233. what the problem was. If the client is non-Windows,
  12234. @sc{cvs} 1.9 should be fine.
  12235. If the error messages are not sufficient to track down
  12236. the problem, the next steps depend largely on which
  12237. access method you are using.
  12238. @table @code
  12239. @cindex :ext:, troubleshooting
  12240. @item :ext:
  12241. Try running the rsh program from the command line. For
  12242. example: "rsh servername cvs -v" should print @sc{cvs}
  12243. version information. If this doesn't work, you need to
  12244. fix it before you can worry about @sc{cvs} problems.
  12245. @cindex :server:, troubleshooting
  12246. @item :server:
  12247. You don't need a command line rsh program to use this
  12248. access method, but if you have an rsh program around,
  12249. it may be useful as a debugging tool. Follow the
  12250. directions given for :ext:.
  12251. @cindex :pserver:, troubleshooting
  12252. @item :pserver:
  12253. Errors along the lines of "connection refused" typically indicate
  12254. that inetd isn't even listening for connections on port 2401
  12255. whereas errors like "connection reset by peer",
  12256. "received broken pipe signal", "recv() from server: EOF",
  12257. or "end of file from server"
  12258. typically indicate that inetd is listening for
  12259. connections but is unable to start @sc{cvs} (this is frequently
  12260. caused by having an incorrect path in @file{inetd.conf}
  12261. or by firewall software rejecting the connection).
  12262. "unrecognized auth response" errors are caused by a bad command
  12263. line in @file{inetd.conf}, typically an invalid option or forgetting
  12264. to put the @samp{pserver} command at the end of the line.
  12265. Another less common problem is invisible control characters that
  12266. your editor "helpfully" added without you noticing.
  12267. One good debugging tool is to "telnet servername
  12268. 2401". After connecting, send any text (for example
  12269. "foo" followed by return). If @sc{cvs} is working
  12270. correctly, it will respond with
  12271. @example
  12272. cvs [pserver aborted]: bad auth protocol start: foo
  12273. @end example
  12274. If instead you get:
  12275. @example
  12276. Usage: cvs [cvs-options] command [command-options-and-arguments]
  12277. ...
  12278. @end example
  12279. @noindent
  12280. then you're missing the @samp{pserver} command at the end of the
  12281. line in @file{inetd.conf}; check to make sure that the entire command
  12282. is on one line and that it's complete.
  12283. Likewise, if you get something like:
  12284. @example
  12285. Unknown command: `pserved'
  12286. CVS commands are:
  12287. add Add a new file/directory to the repository
  12288. ...
  12289. @end example
  12290. @noindent
  12291. then you've misspelled @samp{pserver} in some way. If it isn't
  12292. obvious, check for invisible control characters (particularly
  12293. carriage returns) in @file{inetd.conf}.
  12294. If it fails to work at all, then make sure inetd is working
  12295. right. Change the invocation in @file{inetd.conf} to run the
  12296. echo program instead of cvs. For example:
  12297. @example
  12298. 2401 stream tcp nowait root /bin/echo echo hello
  12299. @end example
  12300. After making that change and instructing inetd to
  12301. re-read its configuration file, "telnet servername
  12302. 2401" should show you the text hello and then the
  12303. server should close the connection. If this doesn't
  12304. work, you need to fix it before you can worry about
  12305. @sc{cvs} problems.
  12306. On AIX systems, the system will often have its own
  12307. program trying to use port 2401. This is AIX's problem
  12308. in the sense that port 2401 is registered for use with
  12309. @sc{cvs}. I hear that there is an AIX patch available
  12310. to address this problem.
  12311. Another good debugging tool is the @samp{-d}
  12312. (debugging) option to inetd. Consult your system
  12313. documentation for more information.
  12314. If you seem to be connecting but get errors like:
  12315. @example
  12316. cvs server: cannot open /root/.cvsignore: Permission denied
  12317. cvs [server aborted]: can't chdir(/root): Permission denied
  12318. @end example
  12319. @noindent
  12320. then you probably haven't specified @samp{-f} in @file{inetd.conf}.
  12321. (In releases prior to @sc{cvs} 1.11.1, this problem can be caused by
  12322. your system setting the @code{$HOME} environment variable
  12323. for programs being run by inetd. In this case, you can either
  12324. have inetd run a shell script that unsets @code{$HOME} and then runs
  12325. @sc{cvs}, or you can use @code{env} to run @sc{cvs} with a pristine
  12326. environment.)
  12327. If you can connect successfully for a while but then can't,
  12328. you've probably hit inetd's rate limit.
  12329. (If inetd receives too many requests for the same service
  12330. in a short period of time, it assumes that something is wrong
  12331. and temporarily disables the service.)
  12332. Check your inetd documentation to find out how to adjust the
  12333. rate limit (some versions of inetd have a single rate limit,
  12334. others allow you to set the limit for each service separately.)
  12335. @end table
  12336. @node Other problems
  12337. @appendixsec Other common problems
  12338. Here is a list of problems which do not fit into the
  12339. above categories. They are in no particular order.
  12340. @itemize @bullet
  12341. @item
  12342. On Windows, if there is a 30 second or so delay when
  12343. you run a @sc{cvs} command, it may mean that you have
  12344. your home directory set to @file{C:/}, for example (see
  12345. @code{HOMEDRIVE} and @code{HOMEPATH} in
  12346. @ref{Environment variables}). @sc{cvs} expects the home
  12347. directory to not end in a slash, for example @file{C:}
  12348. or @file{C:\cvs}.
  12349. @c FIXCVS: CVS should at least detect this and print an
  12350. @c error, presumably.
  12351. @item
  12352. If you are running @sc{cvs} 1.9.18 or older, and
  12353. @code{cvs update} finds a conflict and tries to
  12354. merge, as described in @ref{Conflicts example}, but
  12355. doesn't tell you there were conflicts, then you may
  12356. have an old version of @sc{rcs}. The easiest solution
  12357. probably is to upgrade to a current version of
  12358. @sc{cvs}, which does not rely on external @sc{rcs}
  12359. programs.
  12360. @end itemize
  12361. @c ---------------------------------------------------------------------
  12362. @node Credits
  12363. @appendix Credits
  12364. @cindex Contributors (manual)
  12365. @cindex Credits (manual)
  12366. Roland Pesch, then of Cygnus Support <@t{roland@@wrs.com}>
  12367. wrote the manual pages which were distributed with
  12368. @sc{cvs} 1.3. Much of their text was copied into this
  12369. manual. He also read an early draft
  12370. of this manual and contributed many ideas and
  12371. corrections.
  12372. The mailing-list @code{info-cvs} is sometimes
  12373. informative. I have included information from postings
  12374. made by the following persons:
  12375. David G. Grubbs <@t{dgg@@think.com}>.
  12376. Some text has been extracted from the man pages for
  12377. @sc{rcs}.
  12378. The @sc{cvs} @sc{faq} by David G. Grubbs has provided
  12379. useful material. The @sc{faq} is no longer maintained,
  12380. however, and this manual is about the closest thing there
  12381. is to a successor (with respect to documenting how to
  12382. use @sc{cvs}, at least).
  12383. In addition, the following persons have helped by
  12384. telling me about mistakes I've made:
  12385. @display
  12386. Roxanne Brunskill <@t{rbrunski@@datap.ca}>,
  12387. Kathy Dyer <@t{dyer@@phoenix.ocf.llnl.gov}>,
  12388. Karl Pingle <@t{pingle@@acuson.com}>,
  12389. Thomas A Peterson <@t{tap@@src.honeywell.com}>,
  12390. Inge Wallin <@t{ingwa@@signum.se}>,
  12391. Dirk Koschuetzki <@t{koschuet@@fmi.uni-passau.de}>
  12392. and Michael Brown <@t{brown@@wi.extrel.com}>.
  12393. @end display
  12394. The list of contributors here is not comprehensive; for a more
  12395. complete list of who has contributed to this manual see
  12396. the file @file{doc/ChangeLog} in the @sc{cvs} source
  12397. distribution.
  12398. @c ---------------------------------------------------------------------
  12399. @node BUGS
  12400. @appendix Dealing with bugs in CVS or this manual
  12401. @cindex Bugs in this manual or CVS
  12402. Neither @sc{cvs} nor this manual is perfect, and they
  12403. probably never will be. If you are having trouble
  12404. using @sc{cvs}, or think you have found a bug, there
  12405. are a number of things you can do about it. Note that
  12406. if the manual is unclear, that can be considered a bug
  12407. in the manual, so these problems are often worth doing
  12408. something about as well as problems with @sc{cvs} itself.
  12409. @cindex Reporting bugs
  12410. @cindex Bugs, reporting
  12411. @cindex Errors, reporting
  12412. @itemize @bullet
  12413. @item
  12414. If you want someone to help you and fix bugs that you
  12415. report, there are companies which will do that for a
  12416. fee. One such company is:
  12417. @cindex Ximbiot
  12418. @cindex Support, getting CVS support
  12419. @example
  12420. Ximbiot
  12421. 319 S. River St.
  12422. Harrisburg, PA 17104-1657
  12423. USA
  12424. Email: info@@ximbiot.com
  12425. Phone: (717) 579-6168
  12426. Fax: (717) 234-3125
  12427. http://ximbiot.com/
  12428. @end example
  12429. @item
  12430. If you got @sc{cvs} through a distributor, such as an
  12431. operating system vendor or a vendor of freeware
  12432. @sc{cd-rom}s, you may wish to see whether the
  12433. distributor provides support. Often, they will provide
  12434. no support or minimal support, but this may vary from
  12435. distributor to distributor.
  12436. @item
  12437. If you have the skills and time to do so, you may wish
  12438. to fix the bug yourself. If you wish to submit your
  12439. fix for inclusion in future releases of @sc{cvs}, see
  12440. the file @sc{hacking} in the @sc{cvs} source
  12441. distribution. It contains much more information on the
  12442. process of submitting fixes.
  12443. @item
  12444. There may be resources on the net which can help. Two
  12445. good places to start are:
  12446. @example
  12447. http://www.cvshome.org
  12448. http://www.loria.fr/~molli/cvs-index.html
  12449. @end example
  12450. If you are so inspired, increasing the information
  12451. available on the net is likely to be appreciated. For
  12452. example, before the standard @sc{cvs} distribution
  12453. worked on Windows 95, there was a web page with some
  12454. explanation and patches for running @sc{cvs} on Windows
  12455. 95, and various people helped out by mentioning this
  12456. page on mailing lists or newsgroups when the subject
  12457. came up.
  12458. @item
  12459. It is also possible to report bugs to @code{bug-cvs}.
  12460. Note that someone may or may not want to do anything
  12461. with your bug report---if you need a solution consider
  12462. one of the options mentioned above. People probably do
  12463. want to hear about bugs which are particularly severe
  12464. in consequences and/or easy to fix, however. You can
  12465. also increase your odds by being as clear as possible
  12466. about the exact nature of the bug and any other
  12467. relevant information. The way to report bugs is to
  12468. send email to @code{bug-cvs@@gnu.org}. Note
  12469. that submissions to @code{bug-cvs} may be distributed
  12470. under the terms of the @sc{gnu} Public License, so if
  12471. you don't like this, don't submit them. There is
  12472. usually no justification for sending mail directly to
  12473. one of the @sc{cvs} maintainers rather than to
  12474. @code{bug-cvs}; those maintainers who want to hear
  12475. about such bug reports read @code{bug-cvs}. Also note
  12476. that sending a bug report to other mailing lists or
  12477. newsgroups is @emph{not} a substitute for sending it to
  12478. @code{bug-cvs}. It is fine to discuss @sc{cvs} bugs on
  12479. whatever forum you prefer, but there are not
  12480. necessarily any maintainers reading bug reports sent
  12481. anywhere except @code{bug-cvs}.
  12482. @end itemize
  12483. @cindex Known bugs in this manual or CVS
  12484. People often ask if there is a list of known bugs or
  12485. whether a particular bug is a known one. The file
  12486. @sc{bugs} in the @sc{cvs} source distribution is one
  12487. list of known bugs, but it doesn't necessarily try to
  12488. be comprehensive. Perhaps there will never be a
  12489. comprehensive, detailed list of known bugs.
  12490. @c ---------------------------------------------------------------------
  12491. @node Index
  12492. @unnumbered Index
  12493. @cindex Index
  12494. @printindex cp
  12495. @summarycontents
  12496. @contents
  12497. @bye
  12498. Local Variables:
  12499. fill-column: 55
  12500. End: