intro to cvs

Upload: samanthahewamanage7473

Post on 05-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Intro to CVS

    1/16

    Using CVS(Concurrent Versions System)

    Samantha HewamanageBaylor High Energy Mini Symposium

    01-09-2009

    1

  • 7/31/2019 Intro to CVS

    2/16

    Outline

    Why CVS What is covered What is CVS Creating a CVS repository Accessing a CVS repository Getting CVS information

    2

  • 7/31/2019 Intro to CVS

    3/16

    What is covered

    This is a quick and dirty guide to get you going. Based on my experience with CDF environment what I

    needed most and used often. Commands listed here are frequently used They have lot of options, but not all of them are

    listed here

    There are lot more for you to explore Search our Elogs for common mishaps. Google is your friend for everything else.

    3

  • 7/31/2019 Intro to CVS

    4/16

    CVS? huh!

    As developers we often need to know

    Who made a given change? When did they(I) make it? Why did they(I) make it?

    What other changes did they(I) make at thesame time?

    4

  • 7/31/2019 Intro to CVS

    5/16

    What is CVS?

    CVS maintains a history of asource tree, in terms of a

    series of changes. Each change is time stamped

    and user (person who madethe change) info is kept.

    Your Sandbox is your playarea. Erase it?

    5

  • 7/31/2019 Intro to CVS

    6/16

    Advantages of Using CVS

    You get answers to the Qs in slide#4 +

    Can merge files (pick up changes of other users)

    Rollback or get different versions Make your code available to others Tag and freeze for distributions

    Make patches

    Have test releases by branching out Ill skip, you can explore more

    6

  • 7/31/2019 Intro to CVS

    7/16

    Your CVS Account @ CDF

    Write to [email protected] Rick Snider is the person

    Ask for a PRIVATE CVS account

    Specify a name for your package

    7

  • 7/31/2019 Intro to CVS

    8/16

    Using CVS repository

    CVSROOT - environment variable has to be set to therepository. When you setup cdfsoft you get

    pserver:[email protected]:/cdf/code/cdfcvs/run2 In a favorite dir do cvs checkout This creates the infrastructure for CVS to work The CVS dir - each dir has one. Contains directory

    structure, repository, checkout info etc. Never deleteit! unless you want a fresh checkout and discard yoursandbox.

    8

    mailto:[email protected]:[email protected]:[email protected]
  • 7/31/2019 Intro to CVS

    9/16

    Checking out a package

    Assuming now your have confirmation of you packagefrom Rick

    cvs checkout

    9

  • 7/31/2019 Intro to CVS

    10/16

    Using CVS repository...

    cd into your checkout dir To make a dir name Ceylon

    mkdir Ceylon

    cvs add Ceylon To make a new file Serendip.cc and commit

    Create Serendip.cc file (using Vim or any other editor)

    cvs add Serendip.cc (only once) cvs commit -m This file is about .... and Seredip is the

    Persian name for Sri Lanka. Serendip.cc

    10

  • 7/31/2019 Intro to CVS

    11/16

    cvs log

    cvs log JetFilterModuleV2.cc

    RCS file: /cdf/code/cdfcvs/run2/samantha/src/Pho/JetFilterModuleV2.cc,vWorking file: JetFilterModuleV2.cchead: 1.22

    branch:locks: strictaccess list:

    symbolic names:

    keyword substitution: kvtotal revisions: 22; selected revisions: 22description:----------------------------revision 1.22date: 2008/12/20 03:50:21; author: samantha; state: Exp; lines: +4 -2Fixed a bug. The smear_factor introduced in previous version was loosing info as we were passingJetStuff by-copy to GenerateMyTotalMet. Changed it back to as it was, passing-by-reference.----------------------------

    revision 1.21date: 2008/12/18 16:13:51; author: samantha; state: Exp; lines: +130 -55Completely replaced the InitMetProbStuff function from what Sasha sent me on 12-17-2008. Addedanother line to job summary to show the MaxJetEta cut.----------------------------

    11

  • 7/31/2019 Intro to CVS

    12/16

    cvs status -v

    cvs status -v JetFilterModuleV2.cc

    File: JetFilterModuleV2.cc Status: Needs Patch

    Working revision: 1.3Repository revision: 1.22 /cdf/code/cdfcvs/run2/samantha/src/Pho/JetFilterModuleV2.cc,vSticky Tag: (none)Sticky Date: (none)Sticky Options: (none)

    Existing Tags:MetModel_1stTests_PhoMc_Ewk_PhoData10th_1 (revision: 1.8)MetModelTestingSuccessfull_1 (revision: 1.7)WZpeak_1 (revision: 1.6)MetTest_1 (revision: 1.6)PhoJet-1_8_ICHEP08 (revision: 1.3)PhoJet-1_8 (revision: 1.3)PhoJet-1_7 (revision: 1.3)PhoJet-1_6 (revision: 1.3)PhoJet-1_5 (revision: 1.2)

    PhoJet-1_4 (revision: 1.1)DebugDuplicates_1 (revision: 1.1)PhoJet-1_3 (revision: 1.1) } -v

    12

  • 7/31/2019 Intro to CVS

    13/16

    cvs tag

    Tag Name can be anything (meaningful) You can tag individual branches (or subdirectories)(Google for more)

    Now anyone can checkout by tag name

    will have all the files with the tag name

    13

  • 7/31/2019 Intro to CVS

    14/16

    cvs diff

    This is the most single cvs command youll use

    Very powerful See https://hep.baylor.edu/hep/samantha/204 or Googlefor all the options available and very useful too

    Explore the options for the output formatting and

    minimizing the reported changes (likes not reportingspacing changes).

    14

    https://hep.baylor.edu/hep/samantha/204https://hep.baylor.edu/hep/samantha/204https://hep.baylor.edu/hep/samantha/204
  • 7/31/2019 Intro to CVS

    15/16

    May help!

    Try to be detailed as possible about the changesyou made when committing.

    Tag often and give meaningful names.

    Directories can never be removed or deleted. Sobe wise. Files ... Commit even the small change. Even if it is not the

    final version (Submit only working code if you areworking in a group!)

    .cvsignore - list all your files you do not wish tocommit to CVS so it will not complain. Rememberto commit .cvsignore too!

    15

  • 7/31/2019 Intro to CVS

    16/16

    There is lot to explore

    Explore the option for commands .cvsrc can use to make most common options default You can make your own CVS repository

    16