关闭

关闭

关闭

封号提示

内容

首页 Pragmatic Version Control With Subversion

Pragmatic Version Control With Subversion.pdf

Pragmatic Version Control With …

惊鸿游龙
2010-12-18 0人阅读 0 0 0 暂无简介 举报

简介:本文档为《Pragmatic Version Control With Subversionpdf》,可适用于IT/计算机领域

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:wwwpragmaticprogrammercomCopyright©ThePragmaticProgrammersLLCAllrightsreservedNopartofthispublicationmaybereproduced,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)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/42

0下载券

立即下载

扫码寻找文档

送下载券

加入VIP

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部

举报
资料