SVN Revert codebase to a previous revision

  1. Figure out revision number of old good version
    svn log http://svn.domain.com/app/branches/3_3_0 -r {2010-09-15}:{2010-09-20}
    
  2. See what code will be reverted
    svn merge --dry-run -r 25951:25950  http://svn.domain.com/app/branches/3_3_0
    
  3. Perform the revision
    svn merge -r 25951:25950  http://svn.domain.com/app/branches/3_3_0
    
  4. Commit your change
    svn commit -m "Description"
    

Merge all changes from branch to trunk while leaving merge conflicts up to developers

  1. This document is assuming you have already checked out & updated trunk.
    svn checkout http://server/svn/project/trunk ~/workspaces/project_trunk
    svn update ~/workspaces/project_trunk
  2. Check out the branch to merge from
    svn checkout http://server/svn/project/branches/0.0.6 ~/workspaces/project_0.0.6
  3. Figure out the revision the branch began
    $ svn log --verbose --stop-on-copy http://server/svn/project/branches/0.0.6
    ------------------------------------------------------------------------
    r3 | joe | 2010-08-03 12:50:08 -0700 (Tue, 03 Aug 2010) | 1 line
    Changed paths:
       A /branches/0.0.6/test
       A /branches/0.0.6/global
    
    Adding dirs for test sprint 1
    ------------------------------------------------------------------------
    r2 | joe | 2010-08-03 12:49:12 -0700 (Tue, 03 Aug 2010) | 1 line
    Changed paths:
       A /branches/0.0.6 (from /trunk:1)
    
    Creating branch for test Sprint 1
    ------------------------------------------------------------------------

    NOTE: The revision where the branch was created ($BCV = 2)

  4. CD into the trunk you are merging to & get the revision num.
    cd /workspaces/project_trunk
    svn update

    This will return a message “At revision XXXXX”

    jsmith@PC-JSMITH /workspaces/project_trunk
    $ svn update
    At revision 92.

    $TV=92

  5. CD to your trunk which you are merging TO
    $ cd /workspaces/project_trunk
  6. Merge the changes from the branch to the trunk
    $ svn merge --accept postpone -r ${BCV}:${TV} http://server/svn/project/branches/0.0.6
    --- Merging r2 through r92 into '.':
    C    test-3pom.xml
    Skipped 'foo.bar'
    C    test-parentpom.xml
    U    test-1srcmainjavacomarrisilibTest.java
    U    test-1srcmainjavacomarrisilibApp.java
    C    test-1pom.xml
    C    test-2pom.xml
    Summary of conflicts:
    Text conflicts: 4
    Skipped paths: 1
  7. Generate a report of merge conflicts
    cd /workspaces/project_trunk
    find . -type f -name "*.working"

    EX:

    jsmith@PC-JSMITH /workspaces/project_trunk/trunk
    $ find . -type f -name "*.working"
    ./test-1/pom.xml.working
    ./test-2/pom.xml.working
    ./test-3/pom.xml.working
    ./test-parent/pom.xml.working

    Copy this list into an email & remove working from the end of each line.

  8. Get rid of all conflict resolution files
    find . -type f -name "*.working" -exec rm {} ;
    find . -type f -name "*-left.r*" -exec rm {} ;
    find . -type f -name "*-left.l*" -exec rm {} ;
  9. Commit your changes
    svn commit -m "EM-300 - Merge project 0.0.6 to trunk"
  10. Send email to DEV team to handle merge conflicts