solab-pre-001-r1-cvslecture.pdf

Upload: pabloharriatzu

Post on 02-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    1/31

    Software Development and Version Managementwith CVS and TortoiseCVS

    Madrid, 16th August 2012

    Pablo Arriazu Ruiz

    Possible new features for SOLab develo!ent

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    2/31

    What is CVS?

    "on#urrent $ersioning S%ste!&

    'sed to tra#( and #oordinate sour#e #ode #hanges&

    )els the wor( with several develoers*

    + ra#(s the #hange and who #hanges it&+ Allows to wor( si!ultaneousl% in the sa!e sour#e #ode, even in the

    sa!e file&

    Avoids %ou for (eeing ba#(us of the ro#ess&

    -!ortant tool for the .ree Software "o!!unit%

    htt*//www&nongnu&org/#vs/

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    3/31

    What is Tortoise CVS?

    $isual '- -nterfa#e"L-34 that si!lifies

    the ro#ess&

    -ntera#tion with "$S

    server through the .ileManager&

    htt*//www&tortoise#vs&org

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    4/31

    The Copy-Modify-Merge model

    he develoer downloads a wor(ing #o% checking out4 fro! theshared repository&

    he develoer edits his wor(ing #o% on his #o!uter 5 sandbox4

    he develoer finishes his #hanges and commitsthe! into "$S with a

    log messageelaining the urose of the #hanges&

    Other develoers #an as( for the #hanges in the librar%, "$S

    auto!ati#all% updatestheir wor(ing #oies&

    -f two develoers #o!!it #hanges in the sa!e file, "$S dete#ts the

    conflictand saves a differen#es file&

    A develoer sele#ts what is the ade7uate solution for the #onfli#t and

    mergesboth versions into a unified revision&

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    5/31

    Starting to work with CVS:Partiipate in a pro!et

    -n order to wor( as a develoer of an eisting ro8e#t i&e& SOLab4 -nstall ortoise"$S

    $cvs d :pserver:[email protected]:2401:/CVS/ROOT/!" lo#in

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    6/31

    Starting to work with CVS "#$

    After sele#ting the ro8e#tto download, aears a

    window that window that

    shows the !essages that

    "$S usuall% shows in a

    #onsole

    -t9s ossible to intera#t

    with "$S in the #lassi#al

    wa% with a #onsole even

    in MS :indows usingPu%4

    $cvs cec%out SO&a'

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    7/31

    Changing the ontent of a pro!et

    :hen a new file is added it !ust be se#ified

    + ortoise"$S dete#ts AS"--/;inar%

    + After adding

    > add ?(b for binaries

    "o!!it after #hanging the #ontent of a file

    + 'grades the revision* 1&1?@1&2

    $cvs add (e)*ocu+ent.t,t

    $cvs co++it - + 'u# solved (e)*ocu+ent.t,t

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    8/31

    %ranhing and tagging

    -nsert a new bran#h for a new develo!ent#on#et or to !aintain two different wa%s of it&

    ou #an return to the trun(head4, to tags or bran#hes,

    b% udate se#ial#o!!and

    -t9s ossible to get the version

    as it was 8ust before a date

    $cvs update * 2012/03/1

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    9/31

    Merging a &ranh

    1&? Ma(e update specialin order to have in%our lo#al #o% the revision %ou want to

    !erge in generall% the trun(4&

    2&? Loo( for the !erge #o!!and&

    B&? Set the CStartD in the revision %ou wantto !erge in and the CndD as the file %ou

    want to #o%& -t #ould be a revision, a

    bran#h or a tag4

    E&? Resolve the #onfli#ts that will aear&

    F&? "o!!it

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    10/31

    %'t( there are more developers)

    'dating the files %ou obtain the last situation on the reositor%

    So!e letters aear before the files*

    + " > .ile #hanged in both lo#all% and "$S

    + M > .ile #hanged in lo#al #o%

    + P > .ile had #hanged in "$S, so the lo#al #o% has been udated

    + ' > .ile has been #reated in %our !a#hine

    + A > .ile added to "$S, but not %et #o!!itted

    + R > .ile re!oved fro! "$S,

    $cvs update -5

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    11/31

    When a onflit appears

    Aears when #o!!itting, !erging or udating after two develoers

    have !ade #hanges in the sa!e file&

    $cvs status

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    12/31

    Traking the hanges:The *stat's+ ommand

    Status of the files in %our !a#hine4*+ '?to?date

    + Lo#all% !odified

    + 3eeds Pat#h before udating4

    + 3eeds !erge before udating4

    + .ile has #onfli#ts on !erge after !erging4

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    13/31

    Traking the hanges ",,$:Stat's in ile Manager

    Most of the ti!es, it9s enough with the infor!ation of the .ile Manager

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    14/31

    Traking the hanges ",,,$:What are the hanges?

    Logshows the #o!!ent!ade in ever% #o!!it&

    -f #o!!ents are #orre#tl%

    %ou will (now the !eaning of

    the #hanges done without

    reading the #ode&

    $cvs lo# -ile

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    15/31

    Traking the hanges ",V$:Who has made the hanges?

    Annotateallows to (now thewho, when and in what

    revision have #hanged ever%

    line in the #ode&

    ;% default onl% shows the

    trun(9s #hanges& o wat#h the

    annotation fro! a bran#h add

    the tag >r

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    16/31

    Traking the hanges "V$:We&log

    3eeds to be installed in theserver* $iew$" or "$Sweb&

    Gui#( vision of the tree of files&

    Possibilit% of setting what bran#h

    %ou want to see&

    Shows ever% file login ht!l&

    Allows to see annotateand diff

    fro! the files&

    -HLdo# do#u!ents a#tual #o% in

    sandbo but it #annot berela#ed b% weblog4

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    17/31

    Traking the hanges "V,$:.ook for the differenes

    ou #an*

    + Loo( for the differen#es between %our

    wor(ing file and an% of the others&

    > ou #an use ese#ifi# rogra!s to this

    i&e& :inMerge4 and #onfigure ortoise

    to oen it ortoise"$S ?@Preferen#es?@ ools ?@ Hiff Ali#ation4

    + ou #an save the revision

    + he differen#e between a Sti#(%

    versionand setting a file with udate

    se#ial is that it will re!ain without

    #hanging although %ou udate4

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    18/31

    /everting hanges

    Probabl%, the needing of going ba#( to a revious revision will aear*

    he new file will aear as revision 1&F

    $cvs update 6 1.4 6 1.7 -ile

    $cvs co++it + reverted to 1.7 -ile

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    19/31

    /evisions( versions? Tags

    /evisionsare internal #hara#teristi#s of the develo!ent ro#ess,ever% ti!e %ou #hange an%thing, it9s advisable to do it

    ver% ti!e %ou #o!!it the revision nu!ber last one4 in#reases b%

    one* 1&1?@1&2

    -n bran#hes the revision nu!ber #o!es fro! the starting file, an evennu!ber setted b% "$S and the revision nu!ber

    Versions are deliverable snashots of the #ode that are used b% the

    final user&

    + he sa!e version of the Ali#ation #an have a different na!e of revisionfor ever% file, but the user doesn9t !atters this

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    20/31

    /evisions( Versions? Tags ",,$

    A good wa% to reserve the visionof a rogra! or its situation in a

    #on#rete eriod of ti!e is to ut

    tags&

    ;ut, how do %ou #hange the

    version&

    :here - ut the stable versionI -n

    the trun( and then, do - #ontinue

    in a bran#hI

    Sour#e* OpenSource development with CVS&Moshe ;ar and Jarl .ogel

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    21/31

    To &ranh or not to &ranh

    Release 1&0

    Release 2&0

    Release B&0

    ;ran#hes, how 3O to use the!

    2&1 2&2

    B&1

    & h & h " $

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    22/31

    To &ranh or not to &ranh ",,$:0 software development style proposal

    he !ainline is the

    develo!ent line&

    Releases are stored in bran#hes

    in order to suort the! and

    fi bugs

    Hevelo!ent lines unstable4

    are stored in bran#hes too&

    So!e referen#es re#o!!end!ainline to #o!ile and wor(

    roerl% in ever% !o!ent&

    Sour#e* Practical Perforce& Laura :ingerd

    Mini!ize the nu!ber of

    bran#hes

    Mini!ize deth of bran#hes

    'se #onsistent tags

    T & h t t & h

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    23/31

    To &ranh or not to &ranh:0 software development style proposal

    he !ainline is the

    develo!ent line&

    Releases are stored in bran#hes

    in order to suort the! and

    fi bugs

    Hevelo!ent lines unstable4

    are stored in bran#hes too&

    So!e referen#es re#o!!end!ainline to #o!ile and wor(

    roerl% in ever% !o!ent&

    Sour#e* Practical Perforce& Laura :ingerd

    Mini!ize the nu!ber of

    bran#hes

    Mini!ize deth of bran#hes

    'se #onsistent tags

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    24/31

    Some good praties

    Alwa%s #o!!ent ever% #hange&+ C-f %ou don9t have an%thing to #o!!ent %ou don9t have an%thing to #o!!itD

    'se tags to set u oints %ou will robabl% want to go ba#(&

    + agging is a good wa% to set the version nu!ber, stabilit% oints, start of

    develo!ents, et#&

    ag Root?of?na!e of the bran#h4 in the file it #o!es fro!&

    Put a tag in ever% !erge&

    "o!!it at least at the end of the da% and udate ever% !orning&

    + ou are not alone* in this wa% all the grou will wor( with udated #ode&

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    25/31

    /eleases? #12?

    A release in "$S is a #o% without the ad!inistrative "$S hidden b%default4 data in the wor(ing #o%&

    "he#( out in another folder, this will dis#onne#t %our #o% to the

    server&

    o #hange the revision first nu!ber %ou #an use this #ode*

    ;e #areful of this, on#e there is a file in this wa%, all the new files will

    use the sa!e version first nu!ber&

    $cvs co++it r 2 -ile

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    26/31

    CVS as a omm'niation tool

    Several develoers !ight want to wor( in the sa!e file&

    -t9s ossible to #onfigure the server in order to send e?

    !ails when a develoer is wor(ing on a file&

    Mails are sent onl% to the users that have a#tivated the

    watch #o!!and in a file& -t #an be a#tivated in the whole

    ro8e#t& his onl% noti#es when a user #o!!its a wat#hed file&

    -n order to noti#e when a user starts to edit* edit

    -f this user is going to sto editing without #o!!it4*

    unedit

    Watchers allows %ou to (now who is wat#hing that file/s

    Server has to be#onfigured to do

    this

    CVS as a omm'niation tool ",,$:

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    27/31

    CVS as a omm'niation tool ",,$:reminding people to 'se wath

    -f users don9t set edit, "$S sends a !ail when commit Watch on!a(es the #o% on %our #o!uter read?onl%&

    urns read?and?write onl% after edit#o!!and&

    his #ould be un#onfortable for develoers

    oo !u#h !ails start editing and #o!!iting4 #ould !a(e the!

    anno%ing and develoers won9t read the!&

    watch off is ossible

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    28/31

    3istory

    )as to be a#tivated in server Shows ever% a#tion ta(en in the server

    3ot 7uite useful, not eas% to read the result

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    29/31

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    30/31

    4eywords in the header

    :ritten in the header, the% give infor!ation about the file lastrevision&

    SOLab #ode uses K-H* K, when #o!!iting it9s #onverted into*

    %efore ommiting( delete the keyword information( this wayCVS will fill it again1 "only 5,D: 5 has to remain$

    :hen !erging and diff, the% are dete#ted as #hanges, 8ust delete the

    infor!ation&

    Other (e%words* Author, Hate, Revision, Sour#e, Log

    K-d* solfunittose#onds&ro,v 1&1 2012/0N/06 12*1*0N !#osta K

  • 8/10/2019 solab-PRE-001-r1-CVSlecture.pdf

    31/31

    S6.a&

    -t9s i!ortant to sele#t a develo!ent !ethodolog%, ese#iall% to!a(e the bran#hes fun#tionalit% ra#ti#al&

    So!e of these features #ould be added to the SOLab #oding ro#ess

    he% will be !ore interesting as the nu!ber of users and develoersgrow&