SlideShare uma empresa Scribd logo
1 de 85
Subversion:
Best Practices
   Adam Backstrom
    April 30, 2009
What is svn?
What is svn?

index.php   index.php   index.php
   r956       r1281       r1305
What is svn?

index.php   index.php   index.php
   r956       r1281       r1305
What is svn?
What is svn?
What is svn?

     r1305
What is svn?

          r1305
  HEAD, BASE, {2009-02-01}
What is svn?
What is svn?
What is svn?
What is svn?
What is svn?
What is svn?

    svn branch
    svn merge
svn checkout
svn checkout
adam:igrad$ svn co svn://io/repos/trunk
svn checkout
adam:igrad$ svn co svn://io/repos/trunk
A trunk/common.php
A trunk/index.html
A trunk/images
A trunk/images/header.png
Checked out revision 55.
adam:igrad$
svn checkout
svn co svn://io/repos/trunk [dirname]
The Basics   Glossing over these. Use
             them in preference to
             the normal shell
             commands (or your
             editor’s file browser
             functions). svn actions
             maintain log history, so
             use them.
The Basics        Glossing over these. Use
                     them in preference to
                     the normal shell
                     commands (or your
                     editor’s file browser
                     functions). svn actions
                     maintain log history, so
                     use them.




 svn add

              rm
svn delete
             rmdir

svn copy      cp

svn move      mv
The Basics        Glossing over these. Use
                     them in preference to
                     the normal shell
                     commands (or your
                     editor’s file browser
                     functions). svn actions
                     maintain log history, so
                     use them.




 svn add

              rm
svn delete
             rmdir

svn copy      cp

svn move      mv
The Basics        Glossing over these. Use
                     them in preference to
                     the normal shell
                     commands (or your
                     editor’s file browser
                     functions). svn actions
                     maintain log history, so
                     use them.




 svn add

              rm
svn delete
             rmdir

svn copy      cp

svn move      mv
svn checkin
svn ci
svn ci common.php
svn ci common.php includes/
svn checkin
                            Flags are a good way to
                            commit more than you
                            intended. Leave them
                            out and svn will prompt
                            you for a message.

                            check_deps

                            https://io.plymouth.edu/
                            trac/search


       svn ci -F message.txt
svn ci -m ‘making some changes’
svn checkin
                            Flags are a good way to
                            commit more than you
                            intended. Leave them
                            out and svn will prompt
                            you for a message.

                            check_deps

                            https://io.plymouth.edu/
                            trac/search


       svn ci -F message.txt
svn ci -m ‘making some changes’
svn checkin
                            Flags are a good way to
                            commit more than you
                            intended. Leave them
                            out and svn will prompt
                            you for a message.

                            check_deps

                            https://io.plymouth.edu/
                            trac/search


       svn ci -F message.txt
svn ci -m ‘making some changes’
You will probably need to



          svn checkin
                                   define your editor. This
                                   code does it
                                   automatically at login.




tcsh$ echo setenv EDITOR vi >> ~/.cshrc

bash$ echo export EDITOR=vi >> ~/.bashrc
svn checkin        Checkin after distinct
                             changes. Simplify
                             rollbacks, keep out the
                             cruft when we look at
                             changesets.




Project TODO:
•Verbiage changes
•Update to authZ/authN
•Alphabetize functions.php
svn checkin          Checkin after distinct
                               changes. Simplify
                               rollbacks, keep out the
                               cruft when we look at
                               changesets.




Project TODO:
•Verbiage changes            svn ci
•Update to authZ/authN
•Alphabetize functions.php
svn checkin          Checkin after distinct
                               changes. Simplify
                               rollbacks, keep out the
                               cruft when we look at
                               changesets.




Project TODO:
•Verbiage changes            svn ci
•Update to authZ/authN       svn ci
•Alphabetize functions.php
svn checkin          Checkin after distinct
                               changes. Simplify
                               rollbacks, keep out the
                               cruft when we look at
                               changesets.




Project TODO:
•Verbiage changes            svn ci
•Update to authZ/authN       svn ci
•Alphabetize functions.php   svn ci
This should become habit.




            svn update
                                   Prevent conflicts
                                   (changing lines of code
                                   that have already been
                                   changed in the repos).
                                   Can’t checkin an out-of-
                                   date working directory.




Update working directory from the remote
repository.

•Before you start editing
•Before you commit
svn update
Update multiple directories/files in one pass.

svn up /web/includes_psu/PSUDatabase.class.php 
> /web/includes_external/adodb5 
> /web/pscpages/webapp/ape/common.php
Should also become habit.




             svn status
                                  You’re scheduling
                                  commits for a reason,
                                  don’t let older changes
                                  creep into your commit.

                                  Lots of codes to choose
                                  from.




Summarize changes in working directory.

•Before you start editing
•Before you commit
 M images/title.png
 A includes
 ? includes/functions.php
 D common.php
Should also become habit.




             svn status
                                  You’re scheduling
                                  commits for a reason,
                                  don’t let older changes
                                  creep into your commit.

                                  Lots of codes to choose
                                  from.




Summarize changes in working directory.

•Before you start editing
•Before you commit
 M images/title.png
 A includes
 ? includes/functions.php
 D common.php
Should also become habit.




             svn status
                                  You’re scheduling
                                  commits for a reason,
                                  don’t let older changes
                                  creep into your commit.

                                  Lots of codes to choose
                                  from.




Summarize changes in working directory.

•Before you start editing
•Before you commit
 M images/title.png
 A includes
 ? includes/functions.php
 D common.php
Should also become habit.




             svn status
                                  You’re scheduling
                                  commits for a reason,
                                  don’t let older changes
                                  creep into your commit.

                                  Lots of codes to choose
                                  from.




Summarize changes in working directory.

•Before you start editing
•Before you commit
 M images/title.png
 A includes
 ? includes/functions.php
 D common.php
Should also become habit.




             svn status
                                  You’re scheduling
                                  commits for a reason,
                                  don’t let older changes
                                  creep into your commit.

                                  Lots of codes to choose
                                  from.




Summarize changes in working directory.

•Before you start editing
•Before you commit
 M images/title.png
 A includes
 ? includes/functions.php
 D common.php
svn help
            svn help status
           svn help commit
          svn help checkout
             svn help di
            svn help blame

Version Control with Subversion
http://svnbook.red-bean.com/
Structure
svn://io/repos/trunk      Production Code


                           Development
svn://io/repos/branches     Branches


svn://io/repos/tags       Named Snapshots
The current state of our



            Trunk
                                 web world.

                                 Should be able to
                                 checkout trunk at any
                                 time to bring up a new
                                 server.




       Our “Real” applications

New web server = new trunk checkout
Break out a code base



            Branches
                                 into its own world.
                                 Allows you to commit
                                 changes to an application
                                 without affecting the
                                 trunk.




svn://io/repos/branches/ape-authz svn://
io/repos/branches/igrad-1-0
svn://io/repos/branches/surplus-porter
Directories locked in



                   Tags
                                   time. Snapshots.
                                   “Locked” only by
                                   convention.

                                   Tags give revision
                                   numbers a name.




svn://io/repos/tags/ape-1-0
svn://io/repos/tags/adodb-5-0-8




         ape-1-0   ape-1-1   ape-2-0
Directories locked in



  Structure
              time. Snapshots.
              “Locked” only by
              convention.

              Tags give revision
              numbers a name.




branches/
trunk/
tags/
PSU Structure
  repos/
   webapp/
    trunk/
      ape/
      igrad
    branches/
      ape-authz/
    tags/
   banner/
    trunk/
    branches/
    tags/
svn diff
svn diff

r1
svn diff

r1
        r2
svn diff

r1
        r2      r3
svn diff

r1
                 r2   r3

     +
     +
         -r1:2
svn diff

r1
                 r2               r3

     +                -
     +                +
         -r1:2            -r2:3
svn diff

r1
          r2          r3

     svn di -r1:3

     -
     +

     +
     +
svn diff

r1
          r2          r3

     svn di -r1:3

     -
     +

     +
     +
svn diff

r1
          r2          r3

     svn di -r1:3

     -
     +

     +
     +
svn diff

r1
          r2          r3

     svn di -r1:3

     -
     +

     +
     +
svn diff

r1
          r2          r3

     svn di -r1:3

     -
     +

     +
     +
svn diff

r1
          r2          r3

     svn di -r3:1

     +
     -

      -
      -
svn diff
adam@flit:project$ svn di
Index: common.php
====================================================
===============
--- common.php (revision 1)
+++ common.php (working copy)
@@ -7,7 +7,7 @@

require_once('PSUDatabase.class.php');

-$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/psc1_psu');
+$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/test_psu');

$admin = $GLOBALS['BANNER']-GetOne(quot;SELECT 1 FROM users WHERE pidm = …
svn diff
adam@flit:project$ svn di
Index: common.php
====================================================
===============
--- common.php (revision 1)
+++ common.php (working copy)
@@ -7,7 +7,7 @@

require_once('PSUDatabase.class.php');

-$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/psc1_psu');
+$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/test_psu');

$admin = $GLOBALS['BANNER']-GetOne(quot;SELECT 1 FROM users WHERE pidm = …
Use diff to pull out



                               svn diff
                                                               uncommitted changes
                                                               into a single file. Email file
                                                               around, save for later,
                                                               etc. Alternative to
                                                               branching.




adam@flit:project$ svn di  changes.di    # archive
adam@flit:project$ svn revert -R .         # back out changes

[edit files, merge, cp, etc.]

adam@flit:project$ svn ci             # checkin new changes
adam@flit:project$ patch -p0  changes.di  # apply archive
Show changes bet ween



                 svn diff
                                          last checked out version
                                          (NOT including changes
                                          we made) and the most
                                          recent version.




adam@flit:project$ svn di -r BASE:HEAD
Branching
svn copy
                                          Copies are cheap. Same
                                          files on the backend, just
                                          a new name for them.
                                          Create tags and branches
                                          the same way.




adam@flit:project$ svn cp svn://io/repos/trunk 
 svn://io/repos/branches/banner8

Committed revision 12.
adam@flit:project$
svn sw
                                    Easy to switch bet ween
                                    trees. Also easy to shoot
                                    yourself in the foot.
                                    (Coming up next slide.)




adam@flit:project$ svn sw 
 svn://io/repos/branches/banner8

At revision 3.
adam@flit:project$
svn sw
                                    See that switching bet ween
                                    branches will update all files
                                    within that branch.
                                    Unpredictable if you switch
                                    bet ween t wo unrelated
                                    directories. Works fine
                                    bet ween t wo “clean” checkouts
                                    with no modifications.




adam@flit:project$ svn sw 
 svn://io/repos/branches/banner8
U index.html
D includes/functions.inc.php
A includes/functions.php
Updated to revision 4.
adam@flit:project$
svn sw
                                    Switching with changes in the
                                    tree. Will merge if possible.
                                    Works fine if you are working
                                    on trunk, then create a branch
                                    and switch to it. (Changes from
                                    trunk will be applied to branch
                                    cleanly.) You’ll get conflicts if
                                    you switch back to trunk.




adam@flit:project$ svn sw 
 svn://io/repos/branches/banner8
G index.html
Updated to revision 5.
adam@flit:project$
svn info
                                           Find out where you are.




adam@flit:project$ svn sw 
 svn://io/repos/branches/banner8
adam@flit:project$ svn info
Path: .
URL: svn://io/repos/branches/banner8
Repository Root: svn://io/repos/
Repository UUID: bb1ebae7-95e1-0310-b179-bb68cf00a8bd
Revision: 55
Node Kind: directory
Schedule: normal
Last Changed Author: adam
Last Changed Rev: 55
Last Changed Date: 2009-03-30 21:21:56 -0400 (Mon, 30 …
svn merge
svn merge
adam@flit:project$ svn sw [branch path]
svn merge
adam@flit:project$ svn sw [branch path]
adam@flit:project$ vi index.html common.php
svn merge
adam@flit:project$ svn sw [branch path]
adam@flit:project$ vi index.html common.php
adam@flit:project$ svn rm images/header.big.png
svn merge
adam@flit:project$ svn sw [branch path]
adam@flit:project$ vi index.html common.php
adam@flit:project$ svn rm images/header.big.png
adam@flit:project$ svn ci
Sending    index.html
Sending    common.php
Deleting   images/header.big.png

Committed revision 9.
svn merge
adam@flit:project$ svn sw [branch path]
adam@flit:project$ vi index.html common.php
adam@flit:project$ svn rm images/header.big.png
adam@flit:project$ svn ci
Sending    index.html
Sending    common.php
Deleting   images/header.big.png

Committed revision 9.
adam@flit:project$ svn merge -r5:9 svn://io/repos/trunk .
U index.html
A images/background.png
adam@flit:project$ svn ci
svn merge
adam@flit:project$ svn sw [branch path]
adam@flit:project$ vi index.html common.php
adam@flit:project$ svn rm images/header.big.png
adam@flit:project$ svn ci
Sending    index.html
Sending    common.php
Deleting   images/header.big.png

Committed revision 9.
adam@flit:project$ svn merge -r5:9 svn://io/repos/trunk .
U index.html
A images/background.png
                                Range of revisions since
adam@flit:project$ svn ci
                                branch broke from trunk
svn merge
                                             Imagine a timeline like
                                             this: branch created in
                                             rev 4, changes made to
                                             trunk and branch,
                                             currently at rev 12. How
                                             to merge in new changes
                                             from trunk 6 and 9-12?




trunk/
1   2   3   4   5   6   7   8   9 10 11 12 13 14 15 16



branches/rel-1-1/
svn merge
                                             Imagine a timeline like
                                             this: branch created in
                                             rev 4, changes made to
                                             trunk and branch,
                                             currently at rev 12. How
                                             to merge in new changes
                                             from trunk 6 and 9-12?




trunk/
1   2   3   4   5   6   7   8   9 10 11 12 13 14 15 16



branches/rel-1-1/
svn merge
                                              Imagine a timeline like
                                              this: branch created in
                                              rev 4, changes made to
                                              trunk and branch,
                                              currently at rev 12. How
                                              to merge in new changes
                                              from trunk 6 and 9-12?




trunk/
 1   2   3   4   5   6   7   8   9 10 11 12 13 14 15 16



branches/rel-1-1/
svn merge -r4:HEAD svn://io/repos/trunk .
Conflicts



    Image ©2006 Eric Joyner
Conflicts
$db = PSUDatabase::connect('oracle/psc1_psu');
Conflicts
   $db = PSUDatabase::connect('oracle/psc1_psu');



                       Trunk
$db = PSUDatabase::connect('oracle/psc1_psu/fixcase');
Conflicts
   $db = PSUDatabase::connect('oracle/psc1_psu');



                       Trunk
$db = PSUDatabase::connect('oracle/psc1_psu/fixcase');


                      Branch
     $db = new PSUDatabase('oracle/psc1_psu');
Conflicts
adam@flit:project$ svn merge -r4:16 
 svn://io/repos/trunk
C common.php
adam@flit:project$ svn st
?   common.php.merge-left.r11
?   common.php.merge-right.r12
?   common.php.working
C    common.php
Conflicts
 .working
$GLOBALS['BANNER'] = new PSUDatabase('oracle/psc1_psu');
=======
$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/psc1_psu/fixcase');
 .merge-right.r12
Conflicts
adam@flit:project$ svn merge -r4:16 
 svn://io/repos/trunk
C common.php
adam@flit:project$ svn st
?   common.php.merge-left.r11
?   common.php.merge-right.r12
?   common.php.working
C    common.php
adam@flit:project$ svn resolved common.php
Resolved conflicted state of 'common.php'
Thanks.

Mais conteúdo relacionado

Mais procurados

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best PracticesAshraf Fouad
 
Version Control with SVN
Version Control with SVNVersion Control with SVN
Version Control with SVNPHPBelgium
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to SubversionAtul Jha
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forgeJasmine Conseil
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with SubversionGuy K. Kloss
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
Subversion client
Subversion clientSubversion client
Subversion clientrchakra
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingPhilip Johnson
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopigopinathkarangula
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous IntegrationGeff Henderson Chang
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN TutorialenggHeads
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systemsTim Staley
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeBert Jan Schrijver
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLabPablo Arriazu
 

Mais procurados (20)

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Version Control with SVN
Version Control with SVNVersion Control with SVN
Version Control with SVN
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to Subversion
 
SVN Basics
SVN BasicsSVN Basics
SVN Basics
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forge
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with Subversion
 
Subversion User Guide
Subversion User GuideSubversion User Guide
Subversion User Guide
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
svn
svnsvn
svn
 
Using svn
Using svnUsing svn
Using svn
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
 
Subversion client
Subversion clientSubversion client
Subversion client
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project Hosting
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopi
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
 
SVN
SVNSVN
SVN
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systems
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 

Destaque

Version Control With svn Setting The Stage
Version  Control With svn Setting The StageVersion  Control With svn Setting The Stage
Version Control With svn Setting The Stageparag
 
Code Management (Version Control)
Code Management (Version Control)Code Management (Version Control)
Code Management (Version Control)Y. Thong Kuah
 
Version Control != Dependency Management
Version Control != Dependency ManagementVersion Control != Dependency Management
Version Control != Dependency ManagementPatrick van Dissel
 
Code Management Workshop
Code Management WorkshopCode Management Workshop
Code Management WorkshopSameh El-Ashry
 
Source Code Control System (SCCS)
Source Code Control System (SCCS)Source Code Control System (SCCS)
Source Code Control System (SCCS)Saurabh Kumar
 
Introduction to EDI(Electronic Data Interchange)
Introduction to EDI(Electronic Data Interchange)Introduction to EDI(Electronic Data Interchange)
Introduction to EDI(Electronic Data Interchange)Siva Arunachalam
 
1 electronic data interchange (edi)
1   electronic data interchange (edi)1   electronic data interchange (edi)
1 electronic data interchange (edi)gauravashq
 
IDOC , ALE ,EDI
IDOC , ALE ,EDIIDOC , ALE ,EDI
IDOC , ALE ,EDIAmit Khari
 
Presentation - Electronic Data Interchange
Presentation - Electronic Data InterchangePresentation - Electronic Data Interchange
Presentation - Electronic Data InterchangeSharad Srivastava
 

Destaque (14)

Introduce to SVN
Introduce to SVNIntroduce to SVN
Introduce to SVN
 
Version Control With svn Setting The Stage
Version  Control With svn Setting The StageVersion  Control With svn Setting The Stage
Version Control With svn Setting The Stage
 
Code Management (Version Control)
Code Management (Version Control)Code Management (Version Control)
Code Management (Version Control)
 
Version Control != Dependency Management
Version Control != Dependency ManagementVersion Control != Dependency Management
Version Control != Dependency Management
 
Code Management Workshop
Code Management WorkshopCode Management Workshop
Code Management Workshop
 
Source Code Control System (SCCS)
Source Code Control System (SCCS)Source Code Control System (SCCS)
Source Code Control System (SCCS)
 
From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
 
What Is EDI: Whitepaper Download
What Is EDI: Whitepaper DownloadWhat Is EDI: Whitepaper Download
What Is EDI: Whitepaper Download
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
GIT / SVN
GIT / SVNGIT / SVN
GIT / SVN
 
Introduction to EDI(Electronic Data Interchange)
Introduction to EDI(Electronic Data Interchange)Introduction to EDI(Electronic Data Interchange)
Introduction to EDI(Electronic Data Interchange)
 
1 electronic data interchange (edi)
1   electronic data interchange (edi)1   electronic data interchange (edi)
1 electronic data interchange (edi)
 
IDOC , ALE ,EDI
IDOC , ALE ,EDIIDOC , ALE ,EDI
IDOC , ALE ,EDI
 
Presentation - Electronic Data Interchange
Presentation - Electronic Data InterchangePresentation - Electronic Data Interchange
Presentation - Electronic Data Interchange
 

Semelhante a SVN Best Practices

Subversion Retake
Subversion RetakeSubversion Retake
Subversion Retakemanat
 
Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Alex Kavanagh
 
Subversion: A Getting Started Presentation
Subversion: A Getting Started PresentationSubversion: A Getting Started Presentation
Subversion: A Getting Started PresentationNap Ramirez
 
Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replicationnormanmaurer
 
Version control with subversion
Version control with subversionVersion control with subversion
Version control with subversionxprayc
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP DevelopersLorna Mitchell
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)anandvaidya
 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrapdonnfelker
 
Care and Feeding of Large Web Applications
Care and Feeding of Large Web ApplicationsCare and Feeding of Large Web Applications
Care and Feeding of Large Web ApplicationsPerrin Harkins
 
Ubuntu安装SVN总结
Ubuntu安装SVN总结Ubuntu安装SVN总结
Ubuntu安装SVN总结wensheng wei
 
Capistrano与jenkins(hudson)在java web项目中的实践
Capistrano与jenkins(hudson)在java web项目中的实践Capistrano与jenkins(hudson)在java web项目中的实践
Capistrano与jenkins(hudson)在java web项目中的实践crazycode t
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version ControlNowell Strite
 
Clearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad DecisionsClearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad DecisionsJonathan Hitchcock
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 

Semelhante a SVN Best Practices (20)

Subversion Retake
Subversion RetakeSubversion Retake
Subversion Retake
 
Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01
 
Subversion: A Getting Started Presentation
Subversion: A Getting Started PresentationSubversion: A Getting Started Presentation
Subversion: A Getting Started Presentation
 
Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replication
 
Version control with subversion
Version control with subversionVersion control with subversion
Version control with subversion
 
Svn refcard
Svn refcardSvn refcard
Svn refcard
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP Developers
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Svn
SvnSvn
Svn
 
Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)
 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrap
 
Svn Subversion
Svn SubversionSvn Subversion
Svn Subversion
 
Care and Feeding of Large Web Applications
Care and Feeding of Large Web ApplicationsCare and Feeding of Large Web Applications
Care and Feeding of Large Web Applications
 
Ubuntu安装SVN总结
Ubuntu安装SVN总结Ubuntu安装SVN总结
Ubuntu安装SVN总结
 
Capistrano与jenkins(hudson)在java web项目中的实践
Capistrano与jenkins(hudson)在java web项目中的实践Capistrano与jenkins(hudson)在java web项目中的实践
Capistrano与jenkins(hudson)在java web项目中的实践
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
Clearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad DecisionsClearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad Decisions
 
Os Harkins
Os HarkinsOs Harkins
Os Harkins
 
groovy & grails - lecture 10
groovy & grails - lecture 10groovy & grails - lecture 10
groovy & grails - lecture 10
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 

Último

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

SVN Best Practices

  • 1. Subversion: Best Practices Adam Backstrom April 30, 2009
  • 3. What is svn? index.php index.php index.php r956 r1281 r1305
  • 4. What is svn? index.php index.php index.php r956 r1281 r1305
  • 7. What is svn? r1305
  • 8. What is svn? r1305 HEAD, BASE, {2009-02-01}
  • 14. What is svn? svn branch svn merge
  • 16. svn checkout adam:igrad$ svn co svn://io/repos/trunk
  • 17. svn checkout adam:igrad$ svn co svn://io/repos/trunk A trunk/common.php A trunk/index.html A trunk/images A trunk/images/header.png Checked out revision 55. adam:igrad$
  • 18. svn checkout svn co svn://io/repos/trunk [dirname]
  • 19. The Basics Glossing over these. Use them in preference to the normal shell commands (or your editor’s file browser functions). svn actions maintain log history, so use them.
  • 20. The Basics Glossing over these. Use them in preference to the normal shell commands (or your editor’s file browser functions). svn actions maintain log history, so use them. svn add rm svn delete rmdir svn copy cp svn move mv
  • 21. The Basics Glossing over these. Use them in preference to the normal shell commands (or your editor’s file browser functions). svn actions maintain log history, so use them. svn add rm svn delete rmdir svn copy cp svn move mv
  • 22. The Basics Glossing over these. Use them in preference to the normal shell commands (or your editor’s file browser functions). svn actions maintain log history, so use them. svn add rm svn delete rmdir svn copy cp svn move mv
  • 23. svn checkin svn ci svn ci common.php svn ci common.php includes/
  • 24. svn checkin Flags are a good way to commit more than you intended. Leave them out and svn will prompt you for a message. check_deps https://io.plymouth.edu/ trac/search svn ci -F message.txt svn ci -m ‘making some changes’
  • 25. svn checkin Flags are a good way to commit more than you intended. Leave them out and svn will prompt you for a message. check_deps https://io.plymouth.edu/ trac/search svn ci -F message.txt svn ci -m ‘making some changes’
  • 26. svn checkin Flags are a good way to commit more than you intended. Leave them out and svn will prompt you for a message. check_deps https://io.plymouth.edu/ trac/search svn ci -F message.txt svn ci -m ‘making some changes’
  • 27. You will probably need to svn checkin define your editor. This code does it automatically at login. tcsh$ echo setenv EDITOR vi >> ~/.cshrc bash$ echo export EDITOR=vi >> ~/.bashrc
  • 28. svn checkin Checkin after distinct changes. Simplify rollbacks, keep out the cruft when we look at changesets. Project TODO: •Verbiage changes •Update to authZ/authN •Alphabetize functions.php
  • 29. svn checkin Checkin after distinct changes. Simplify rollbacks, keep out the cruft when we look at changesets. Project TODO: •Verbiage changes svn ci •Update to authZ/authN •Alphabetize functions.php
  • 30. svn checkin Checkin after distinct changes. Simplify rollbacks, keep out the cruft when we look at changesets. Project TODO: •Verbiage changes svn ci •Update to authZ/authN svn ci •Alphabetize functions.php
  • 31. svn checkin Checkin after distinct changes. Simplify rollbacks, keep out the cruft when we look at changesets. Project TODO: •Verbiage changes svn ci •Update to authZ/authN svn ci •Alphabetize functions.php svn ci
  • 32. This should become habit. svn update Prevent conflicts (changing lines of code that have already been changed in the repos). Can’t checkin an out-of- date working directory. Update working directory from the remote repository. •Before you start editing •Before you commit
  • 33. svn update Update multiple directories/files in one pass. svn up /web/includes_psu/PSUDatabase.class.php > /web/includes_external/adodb5 > /web/pscpages/webapp/ape/common.php
  • 34. Should also become habit. svn status You’re scheduling commits for a reason, don’t let older changes creep into your commit. Lots of codes to choose from. Summarize changes in working directory. •Before you start editing •Before you commit M images/title.png A includes ? includes/functions.php D common.php
  • 35. Should also become habit. svn status You’re scheduling commits for a reason, don’t let older changes creep into your commit. Lots of codes to choose from. Summarize changes in working directory. •Before you start editing •Before you commit M images/title.png A includes ? includes/functions.php D common.php
  • 36. Should also become habit. svn status You’re scheduling commits for a reason, don’t let older changes creep into your commit. Lots of codes to choose from. Summarize changes in working directory. •Before you start editing •Before you commit M images/title.png A includes ? includes/functions.php D common.php
  • 37. Should also become habit. svn status You’re scheduling commits for a reason, don’t let older changes creep into your commit. Lots of codes to choose from. Summarize changes in working directory. •Before you start editing •Before you commit M images/title.png A includes ? includes/functions.php D common.php
  • 38. Should also become habit. svn status You’re scheduling commits for a reason, don’t let older changes creep into your commit. Lots of codes to choose from. Summarize changes in working directory. •Before you start editing •Before you commit M images/title.png A includes ? includes/functions.php D common.php
  • 39. svn help svn help status svn help commit svn help checkout svn help di svn help blame Version Control with Subversion http://svnbook.red-bean.com/
  • 40. Structure svn://io/repos/trunk Production Code Development svn://io/repos/branches Branches svn://io/repos/tags Named Snapshots
  • 41. The current state of our Trunk web world. Should be able to checkout trunk at any time to bring up a new server. Our “Real” applications New web server = new trunk checkout
  • 42. Break out a code base Branches into its own world. Allows you to commit changes to an application without affecting the trunk. svn://io/repos/branches/ape-authz svn:// io/repos/branches/igrad-1-0 svn://io/repos/branches/surplus-porter
  • 43. Directories locked in Tags time. Snapshots. “Locked” only by convention. Tags give revision numbers a name. svn://io/repos/tags/ape-1-0 svn://io/repos/tags/adodb-5-0-8 ape-1-0 ape-1-1 ape-2-0
  • 44. Directories locked in Structure time. Snapshots. “Locked” only by convention. Tags give revision numbers a name. branches/ trunk/ tags/
  • 45. PSU Structure repos/ webapp/ trunk/ ape/ igrad branches/ ape-authz/ tags/ banner/ trunk/ branches/ tags/
  • 49. svn diff r1 r2 r3
  • 50. svn diff r1 r2 r3 + + -r1:2
  • 51. svn diff r1 r2 r3 + - + + -r1:2 -r2:3
  • 52. svn diff r1 r2 r3 svn di -r1:3 - + + +
  • 53. svn diff r1 r2 r3 svn di -r1:3 - + + +
  • 54. svn diff r1 r2 r3 svn di -r1:3 - + + +
  • 55. svn diff r1 r2 r3 svn di -r1:3 - + + +
  • 56. svn diff r1 r2 r3 svn di -r1:3 - + + +
  • 57. svn diff r1 r2 r3 svn di -r3:1 + - - -
  • 58. svn diff adam@flit:project$ svn di Index: common.php ==================================================== =============== --- common.php (revision 1) +++ common.php (working copy) @@ -7,7 +7,7 @@ require_once('PSUDatabase.class.php'); -$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/psc1_psu'); +$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/test_psu'); $admin = $GLOBALS['BANNER']-GetOne(quot;SELECT 1 FROM users WHERE pidm = …
  • 59. svn diff adam@flit:project$ svn di Index: common.php ==================================================== =============== --- common.php (revision 1) +++ common.php (working copy) @@ -7,7 +7,7 @@ require_once('PSUDatabase.class.php'); -$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/psc1_psu'); +$GLOBALS['BANNER'] = PSUDatabase::connect('oracle/test_psu'); $admin = $GLOBALS['BANNER']-GetOne(quot;SELECT 1 FROM users WHERE pidm = …
  • 60. Use diff to pull out svn diff uncommitted changes into a single file. Email file around, save for later, etc. Alternative to branching. adam@flit:project$ svn di changes.di # archive adam@flit:project$ svn revert -R . # back out changes [edit files, merge, cp, etc.] adam@flit:project$ svn ci # checkin new changes adam@flit:project$ patch -p0 changes.di # apply archive
  • 61. Show changes bet ween svn diff last checked out version (NOT including changes we made) and the most recent version. adam@flit:project$ svn di -r BASE:HEAD
  • 63. svn copy Copies are cheap. Same files on the backend, just a new name for them. Create tags and branches the same way. adam@flit:project$ svn cp svn://io/repos/trunk svn://io/repos/branches/banner8 Committed revision 12. adam@flit:project$
  • 64. svn sw Easy to switch bet ween trees. Also easy to shoot yourself in the foot. (Coming up next slide.) adam@flit:project$ svn sw svn://io/repos/branches/banner8 At revision 3. adam@flit:project$
  • 65. svn sw See that switching bet ween branches will update all files within that branch. Unpredictable if you switch bet ween t wo unrelated directories. Works fine bet ween t wo “clean” checkouts with no modifications. adam@flit:project$ svn sw svn://io/repos/branches/banner8 U index.html D includes/functions.inc.php A includes/functions.php Updated to revision 4. adam@flit:project$
  • 66. svn sw Switching with changes in the tree. Will merge if possible. Works fine if you are working on trunk, then create a branch and switch to it. (Changes from trunk will be applied to branch cleanly.) You’ll get conflicts if you switch back to trunk. adam@flit:project$ svn sw svn://io/repos/branches/banner8 G index.html Updated to revision 5. adam@flit:project$
  • 67. svn info Find out where you are. adam@flit:project$ svn sw svn://io/repos/branches/banner8 adam@flit:project$ svn info Path: . URL: svn://io/repos/branches/banner8 Repository Root: svn://io/repos/ Repository UUID: bb1ebae7-95e1-0310-b179-bb68cf00a8bd Revision: 55 Node Kind: directory Schedule: normal Last Changed Author: adam Last Changed Rev: 55 Last Changed Date: 2009-03-30 21:21:56 -0400 (Mon, 30 …
  • 70. svn merge adam@flit:project$ svn sw [branch path] adam@flit:project$ vi index.html common.php
  • 71. svn merge adam@flit:project$ svn sw [branch path] adam@flit:project$ vi index.html common.php adam@flit:project$ svn rm images/header.big.png
  • 72. svn merge adam@flit:project$ svn sw [branch path] adam@flit:project$ vi index.html common.php adam@flit:project$ svn rm images/header.big.png adam@flit:project$ svn ci Sending index.html Sending common.php Deleting images/header.big.png Committed revision 9.
  • 73. svn merge adam@flit:project$ svn sw [branch path] adam@flit:project$ vi index.html common.php adam@flit:project$ svn rm images/header.big.png adam@flit:project$ svn ci Sending index.html Sending common.php Deleting images/header.big.png Committed revision 9. adam@flit:project$ svn merge -r5:9 svn://io/repos/trunk . U index.html A images/background.png adam@flit:project$ svn ci
  • 74. svn merge adam@flit:project$ svn sw [branch path] adam@flit:project$ vi index.html common.php adam@flit:project$ svn rm images/header.big.png adam@flit:project$ svn ci Sending index.html Sending common.php Deleting images/header.big.png Committed revision 9. adam@flit:project$ svn merge -r5:9 svn://io/repos/trunk . U index.html A images/background.png Range of revisions since adam@flit:project$ svn ci branch broke from trunk
  • 75. svn merge Imagine a timeline like this: branch created in rev 4, changes made to trunk and branch, currently at rev 12. How to merge in new changes from trunk 6 and 9-12? trunk/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 branches/rel-1-1/
  • 76. svn merge Imagine a timeline like this: branch created in rev 4, changes made to trunk and branch, currently at rev 12. How to merge in new changes from trunk 6 and 9-12? trunk/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 branches/rel-1-1/
  • 77. svn merge Imagine a timeline like this: branch created in rev 4, changes made to trunk and branch, currently at rev 12. How to merge in new changes from trunk 6 and 9-12? trunk/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 branches/rel-1-1/ svn merge -r4:HEAD svn://io/repos/trunk .
  • 78. Conflicts Image ©2006 Eric Joyner
  • 80. Conflicts $db = PSUDatabase::connect('oracle/psc1_psu'); Trunk $db = PSUDatabase::connect('oracle/psc1_psu/fixcase');
  • 81. Conflicts $db = PSUDatabase::connect('oracle/psc1_psu'); Trunk $db = PSUDatabase::connect('oracle/psc1_psu/fixcase'); Branch $db = new PSUDatabase('oracle/psc1_psu');
  • 82. Conflicts adam@flit:project$ svn merge -r4:16 svn://io/repos/trunk C common.php adam@flit:project$ svn st ? common.php.merge-left.r11 ? common.php.merge-right.r12 ? common.php.working C common.php
  • 83. Conflicts .working $GLOBALS['BANNER'] = new PSUDatabase('oracle/psc1_psu'); ======= $GLOBALS['BANNER'] = PSUDatabase::connect('oracle/psc1_psu/fixcase'); .merge-right.r12
  • 84. Conflicts adam@flit:project$ svn merge -r4:16 svn://io/repos/trunk C common.php adam@flit:project$ svn st ? common.php.merge-left.r11 ? common.php.merge-right.r12 ? common.php.working C common.php adam@flit:project$ svn resolved common.php Resolved conflicted state of 'common.php'

Notas do Editor