首页 > > > 程序员修炼三部曲.版本控制之道.Pragmatic Version Control Using…

程序员修炼三部曲.版本控制之道.Pragmatic Version Control Using Subversion.pdf

程序员修炼三部曲.版本控制之道.Pragmatic Versi…

上传者: Jason 2012-01-05 评分1 评论0 下载640 收藏10 阅读量892 暂无简介 简介 举报

简介:本文档为《程序员修炼三部曲.版本控制之道.Pragmatic Version Control Using 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)

精彩专题

热门资料

幼师培养中的情感要素刍议 - 期宁波大学学报.pdf

幼师培养中的情感要素刍议 - 期宁波大学学报.pdf

幼师培养中的情感要素刍议 - 期宁波大学学报.pdf

幼师培养中的情感要素刍议 - 期宁波大学学报.pdf

该用户的其他资料

  • 名称/格式
  • 评分
  • 下载次数
  • 资料大小
  • 上传时间

用户评论

0/200
    暂无评论
上传我的资料

相关资料

资料评价:

/ 211
所需积分:0 立即下载
返回
顶部
举报
资料
关闭

温馨提示

感谢您对爱问共享资料的支持,精彩活动将尽快为您呈现,敬请期待!