关闭

关闭

关闭

封号提示

内容

首页 Pragmatic Version Control With Subversion.pdf

Pragmatic Version Control With Subversion.pdf

Pragmatic Version Control With …

上传者: 惊鸿游龙 2010-12-18 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《Pragmatic Version Control With Subversionpdf》,可适用于IT/计算机领域,主题内容包含WhatreadersaresayingaboutPragmaticVersionControlusingSubversionIexpectedal符等。

WhatreadersaresayingaboutPragmaticVersionControlusingSubversionIexpectedalot,butyousurprisedmewithevenmoreHavingusedCVSforyearsIhesitatedtotrySubversionuntilnow,althoughIknewitwouldsolvemanyoftheshortcomingsofCVSAfterreadingyourbook,myexcusestostaywithCVSdisappearedOh,andcomingfromthePragmaticBookshelfthisbookisfuntoreadtooThanksMikeSteffenGemkowManagingDirector,ObjectFabGmbHI’malongtimeuserofCVSandI’vebeenskepticalofSubversion,wonderingifitwouldeverbe“readyforprimetime”UntilnowThankstoMikeMasonforwritingaclear,concise,gentleintroductiontothisnewtoolAfterreadingthisbook,I’mactuallyexcitedaboutthepossibilitiesforversioncontrolthatSubversionbringstothetableDavidRuppSeniorSoftwareEngineer,GreatWestLifeAnnuityThiswasexactlytheSubversionbookIwaswaitingforAsalongtimePerforceandCVSuserandadministrator,andinmyroleasanagiletoolscoach,IwantedacompactbookthattoldmejustwhatIneededtoknowThisisitWithinacoupleofhoursIwasupandrunningagainstremoteSubversionservers,andsettingupmyownlocalserverstooMikeusesalotofcommandlineexamplestoguidethereader,andasaWindowsuserIwasworriedatfirstMyfearswereunfoundedthoughMike’sexamplesweresoclearthatIthinkI’llsticktousingthecommandlinefromnowon!IthoroughlyrecommendthisbooktoanyonegettingstartedusingoradministeringSubversionMikeRobertsProjectcoLead,CruiseControlNETPragmaticVersionControlusingSubversionMikeMasonThePragmaticBookshelfRaleigh,NorthCarolinaDallas,TexasManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthisbook,andThePragmaticProgrammers,LLCwasawareofatrademarkclaim,thedesignationshavebeenprintedininitialcapitallettersorinallcapitalsThePragmaticStarterKit,ThePragmaticProgrammer,PragmaticProgramming,PragmaticBookshelfandthelinkinggdevicearetrademarksofThePragmaticProgrammers,LLCEveryprecautionwastakeninthepreparationofthisbookHowever,thepublisherassumesnoresponsibilityforerrorsoromissions,orfordamagesthatmayresultfromtheuseofinformation(includingprogramlistings)containedhereinOurPragmaticcourses,workshops,andotherproductscanhelpyouandyourteamcreatebettersoftwareandhavemorefunFormoreinformation,aswellasthelatestPragmatictitles,pleasevisitusathttp:wwwpragmaticprogrammercomCopyrightThePragmaticProgrammersLLCAllrightsreservedNopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmitted,inanyform,orbyanymeans,electronic,mechanical,photocopying,recording,orotherwise,withoutthepriorconsentofthepublisherPrintedintheUnitedStatesofAmericaISBNPrintedonacidfreepaperwithrecycled,postconsumercontentFirstprinting,FebruaryVersion:ContentsPrefaceviiiIntroductionVersionControlinActionRoadMapWhyChooseSubversionWhatIsVersionControlTheRepositoryWhatShouldWeStoreWorkingCopiesandManipulatingFilesProjects,Directories,andFilesWhereDoVersionsComeInTagsBranchesMergingLockingOptionsConfigurationManagement(CM)GettingStartedwithSubversionInstallingSubversionCreatingaRepositoryCreatingaSimpleProjectStartingtoWorkwithaProjectMakingChangesUpdatingtheRepositoryWhenWorldsCollideConflictResolutionCONTENTSviHowToOurBasicPhilosophyImportantStepsWhenUsingVersionControlAccessingaRepositoryNetworkProtocolsChoosingaNetworkingOptionCommonSubversionCommandsCheckingThingsOutKeepingUptoDateAddingFilesandDirectoriesPropertiesCopyingandMovingFilesandDirectoriesSeeingWhatHasChangedHandlingMergeConflictsCommittingChangesExaminingChangeHistoryRemovingaChangeOrganizingYourRepositoryASimpleProjectMultipleProjectsMultipleRepositoriesUsingTagsandBranchesTagsandBranchesCreatingaReleaseBranchWorkinginaReleaseBranchGeneratingaReleaseFixingBugsinaReleaseBranchDeveloperExperimentalBranchesWorkingwithExperimentalCodeMergingtheExperimentalBranchCreatingaProjectCreatingtheInitialProjectStructurewithintheProjectSharingCodebetweenProjectsPreparedexclusivelyforKimPartridgeCONTENTSviiThirdPartyCodeBinaryLibrariesLibrarieswithSourceCodeKeywordExpansionduringImportsAInstall,Network,Secure,andAdministerAInstallingSubversionANetworkingwithsvnserveANetworkingwithsvnsshANetworkingwithApacheASecuringSubversionABackingUpYourRepositoryBMigratingtoSubversionBGettingcvssvnBChoosingHowMuchtoConvertBConvertingYourRepositoryCThirdPartySubversionToolsCTortoiseSVNCIDEIntegrationCOtherToolsDCommandSummaryandRecipesDSubversionCommandSummaryDRecipesEOtherResourcesEOnlineResourcesEBibliographyPreparedexclusivelyforKimPartridgePrefaceIwasprettyexcitedwhenIheardaboutthePragmaticStarterKitfinallysomeguidanceonthebasicstuffallprojectsneedtogetrightTheopportunitytoproduceaSubversioneditionofPragmaticVersionControlwasoneIcouldn’tmissSubversionhadpreviouslysavedme(andmyteam)fromversioncontrolhell,andIwantedtodomyparttohelppromoteagreatnewversioncontrolsystemVersioncontroladdsanimmenseamounttoaprojectItgivesyouasafetynet,helpsyourteamcollaborateeffectively,letsyouorganizeyourbuildsandQA,andevenallowsyoutodosomedetectiveworkifthingsgowrongIhopethisneweditionofPragmaticVersionControlwillhelpyouandyourteamgetstartedandsucceedwithSubversionAcknowledgmentsI’dliketothankDaveandAndyfortakingachanceonmebeingabletowritethebookandtothankDavebeingsuchanexcellenteditorIwasn’treallysurewhatIwasgettingmyselfinto,andDave’sadviceandguidancewereinvaluableThebookreceivedplentyofscrutinybyreviewersI’dliketothankBradAppleton,BrankoCˇibej,MartinFowler,SteffenGemkow,RobertRasmussen,MikeRoberts,andDavidRuppfortheirwellthoughtoutcommentsandsuggestionsI’mfranklyamazedbythequalityoffeedbackIgotgreatsuggestions,highlytechnicalcommentsandplentyofpeoplethinkingaboutthe“biggerpicture”EveryoneatThoughtWorkshasbeenreallysupportiveofmybookwritingefforts,includingseveralpeoplewhotookthetimetolookthroughearlydraftsofthebook,andI’dliketoPREFACEixthankallthosewhogavemeadviceandguidanceI’dparticularlyliketothanktheCalgaryofficeforwelcomingmeintothefoldthisyearandforenablingmetogetstufffinishedwhenthecrunchpointcameFinallyI’dliketothankMartin,Mike,andMichelleformakingmebelieveIcouldreallywritethebookandfortheirencouragementalongthewayMikeMasonDecembermikemikemasoncaTypographicConventionsitalicfontItalicsindicateatermthatisbeingdefined,orborrowedfromanotherlanguagefilesFiles(anddirectories)areindicatedlikethiscommandsCommands(andoptionssuchash)areshownlikethisoutputOutput(aswellasthingsyoumightneedtotype)isindicatedlikethisIfcommandsaretoolongforasinglelinethey’resplitontomultiplelinesusinga(backwardslash)CVSHint:ThiskindoftextindicatesahintforusersfamiliarwithCVSThiswarningsignindicatesthismaterialismoreadvancedandcanbeskippedonyourfirstreading“Joethedeveloper,”ourcartoonfriend,asksarelatedquestionthatyoumayfindusefulPreparedexclusivelyforKimPartridgeChapterIntroductionThisbooktellsyouhowtoimprovetheeffectivenessofyoursoftwaredevelopmentprocessusingversioncontrolVersioncontrol,sometimescalledsourcecodecontrol,isthefirstlegofourprojectsupporttripodWeviewtheuseofversioncontrolasmandatoryonallprojectsVersioncontroloffersmanyadvantagestobothteamsandindividuals:•Itgivestheteamaprojectwideundobuttonnothingisfinal,andmistakesareeasilyrolledbackImagineyou’reusingtheworld’smostsophisticatedwordprocessorIthaseveryfunctionimaginable,exceptoneForsomereason,theyforgottoaddsupportforaDELETEkeyThinkhowcarefullyandslowlyyou’dhavetotype,particularlyasyougotneartheendofalargedocumentOnemistake,andyou’dhavetostartagainIt’sthesamewithversioncontrolhavingtheabilitytogobackanhour,aday,oraweekfreesyourteamtoworkquickly,confidentthattheyhaveawayoffixingmistakes•ItallowsmultipledeveloperstoworkonthesamecodebaseinacontrolledmannerTheteamnolongerloseschangeswhensomeoneoverwritestheeditsmadebyanotherteammember•TheversioncontrolsystemkeepsarecordofthechangesmadeovertimeIfyoucomeacrosssome“surprisingcode,”it’seasytofindoutwhomadethechange,when,and(withanyluck)whyVERSIONCONTROLINACTION•AversioncontrolsystemallowsyoutosupportmultiplereleasesofyoursoftwareatthesametimeasyoucontinuewiththemainlineofdevelopmentWithaversioncontrolsystem,there’snolongeraneedfortheteamtostopworkduringacodefreezejustbeforerelease•Versioncontrolisaprojectwidetimemachine,allowingyoutodialinadateandseeexactlywhattheprojectlookedlikeonthatdateThisisusefulforresearch,butitisessentialforregeneratingpriorreleasesforcustomerswithproblemsThisbookfocusesonversioncontrolfromaprojectperspectiveRatherthansimplylistingthecommandsavailableinaversioncontrolsystem,weexplainthetasksyouneedtoperformwellinasuccessfulprojectandthenshowhowaversioncontrolsystemcanhelpLet’sstartwithasmallstoryVersionControlinActionFredrollsintotheofficeeagertocontinueworkingonthenewOrinocobookorderingsystem(WhyOrinocoFred’scompanyusesthenamesofriversforallinternalprojects)Aftergettinghisfirstcupofcoffee,Fredupdateshislocalcopyoftheproject’ssourcecodewiththelatestversionsfromthecentralversioncontrolsystemInthelogthatliststheupdatedfiles,henoticesthatWilmahaschangedcodeinthebasicOrdersclassFredgetsworriedthatthischangemightaffecthiswork,buttodayWilmaisoffattheclient’ssite,installingthelatestrelease,sohecan’taskherdirectlyInstead,FredaskstheversioncontrolsystemtodisplaythenotesassociatedwiththechangetoOrdersWilma’scommentdoeslittletoreassurehim:AddednewdeliveryPreferencesfieldtotheOrdersclassTofindoutwhat’sgoingon,hegoesbacktotheversioncontrolsystemandaskstoseetheactualchangesmadetothesourcefileHeseesthatWilmahasaddedacoupleofinstancevariables,buttheyaresettodefaultvalues,andnothingseemstochangethemThismightbeaprobleminthefuture,butitisnothingthatwillstophimtoday,soFredcontinuesworkingPreparedexclusivelyforKimPartridgeVERSIONCONTROLINACTIONAsheworksonhiscode,FredaddsanewclassandacoupleoftestclassestothesystemFredaddsthenamesofthefileshecreatestotheversioncontrolsystemashecreatesthemthefilesthemselveswon’tbeaddeduntilhecommitshischanges,butaddingtheirnamesnowmeanshewon’tforgettoaddthemlaterAcoupleofhoursintotheday,FredhascompletedthefirstpartofsomenewfunctionalityItpassesitstests,anditwon’taffectanythingintherestofthesystem,sohedecidestocheckitallintotheversioncontrolsystem,makingitavailabletotherestoftheteamOvertheyears,Fredhasfoundthatcheckingcodeinandoutfrequentlyworksbestforhim:it’saloteasiertoreconciletheoccasionalconflictifyouhavetoworryaboutonlyacoupleoffilesratherthanaweek’sworthofchangesfromthewholeteamWhyYouShouldNeverAnswerthePhoneJustasFredisabouttostartthenextroundofcoding,hisphoneringsIt’sWilma,callingfromtheclient’ssiteItlookslikethere’sabuginthereleasesheisinstalling:printedinvoicesarenotcalculatingsalestaxonshippingamountsTheclientisgoingballistic,andtheyneedafixnowUnlessYouUseVersionControlFreddoublechecksthenameofthereleasewithWilmaandthentellstheversioncontrolsystemtocheckoutallthefilesinthatversionofthesoftwareHeputsitinatemporarydirectoryonhisPC,asheintendstodeleteitafterhefinishestheworkHenowhastwocopiesofthesystem’ssourcecodeonhiscomputer:thetrunk(themainlineofdevelopment)andtheversionreleasedtotheclientBecauseheisabouttofixabug,hetellstheversioncontrolsystemtotaghissourcecodewithalabel(He’lladdanothertagwhenhehasfixedthebugThesetagsactasflagsyouleavebehindtomarksignificantpointsinthedevelopmentByusingconsistentlynamedtagsbeforeandafterhemakesthechange,otherfolksinhisteamwillbeabletoseeexactlywhatchangedshouldtheylookatitlater)PreparedexclusivelyforKimPartridgeVERSIONCONTROLINACTIONInordertoisolatetheproblem,FredfirstwritesatestSureenough,itlookslikenooneevercheckedthesalestaxcalculationwhenshippingwasinvolved,becausehistestimmediatelyshowstheproblem(Fredmakesanotetoraisethisduringthisiteration’sreviewmeetingthisissomethingthatshouldneverhavegoneoutthedoor)Sighing,Fredaddsthelineofcodethataddsshippingtothetaxabletotal,compiles,andchecksthathistestpassesHererunsthewholetestsuiteasaquicksanitytestandchecksthefixedcodebackintothecentralversioncontrolsystemFinally,hetagsthereleasebranchindicatingthatthebugisfixedHesendsanoteofftoQA,whoisresponsibleforshippingemergencyreleasestotheclientUsinghistag,they’llbeabletoinstructthebuildsystemtoproduceadeliverydiskthatincludeshisfixFredthenphonesWilmaandtellsherthefixisinthehandsofQAandshouldbewithhersoonHavingfinishedwiththislittledistraction,Fredremovesthesourceforthereleasedcodefromhislocalmachine:there’snopointinclutteringthingsup,andthechangeshehasmadearesafelytuckedbackintothecentralserverHethengetstowondering:isthesalestaxbughefoundinthereleasedcodealsopresentinthecurrentdevelopmentversionThequickestwaytocheckistoaddthetesthewroteinthereleasedversiontothedevelopmenttestsuiteHetellstheversioncontrolsystemtomergethatparticularchangeinthereleasebranchintotheappropriatefileinthedevelopmentcopyThemergeprocesstakeswhateverchangesweremadetothereleasefilesandmakesthesamechangestothedevelopmentversionWhenherunsthetests,hisnewtestfails:thebugisindeedpresentHethenmoveshisfixfromthereleasebranchintothedevelopmentversion(Hedoesn’tneedthereleasebranch’scodeonhismachinetodoanyofthisallthechangesarebeingfetchedfromthecentralversioncontrolsystem)Oncehehasthetestsallrunningagain,hecommitsthischangeintotheversioncontrolsystemThat’sonelessbugthat’llbitetheteamnexttimeCrisisover,FredgetsbacktoworkingonhisowntasksforthedayHespendsahappyafternoonwritingtestsandcodeandtowardtheendofthedaydecidesheisdoneWhilehehasbeenworking,otherfolksinhisteamhavealsobeenmakingPreparedexclusivelyforKimPartridgeVERSIONCONTROLINACTIONchanges,soheusestheversioncontrolsystemtotaketheirworkandapplyithislocalcopyofthesourceHerunsthetestsonelasttimeandthencheckshischangesbackin,readytostartworkthenextdayTomorrowUnfortunately,thenextdaybringsitsownsurprisesOvernightFred’scentralheatingfinallygivesuptheghostAsFredlivesinMinnesota,andasit’sFebruary,thisisn’tsomethingtobetakenlightlyFredcallsintoworktosayhe’llbeoutmostofthedaywaitingfortherepairfolkstoarriveHowever,thatdoesn’tmeanhehastostopworkingAccessinghisofficenetworkusingasecureconnectionoverthepublicInternet,FredchecksoutthelatestdevelopmentcodeontohislaptopBecausehecheckedinbeforehewenthomethepreviousnight,everythingisthereanduptodateHecontinuestoworkathome,wrappedinablanketandsittingbythefireBeforehestopsfortheday,hecheckshischangesinfromthelaptopsothey’llbeavailabletohimatworkthenextdayLifeisgood(exceptfortheheatingrepairbill)

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/42
仅支持在线阅读

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部