Difference between revisions of "WorkingWithCVSBranches"

From Inkscape Wiki
Jump to navigation Jump to search
(removed spam)
 
m (link fix)
(One intermediate revision by the same user not shown)
Line 32: Line 32:
:3. Tag the initial revisions in your branch (you'll need this for merging easily)
:3. Tag the initial revisions in your branch (you'll need this for merging easily)


     cvs -z3 tag BRANCH_START
     cvs -z3 tag [[BRANCH_START]]


===== Merging Your Changes =====
===== Merging Your Changes =====
Line 40: Line 40:
:2. Tag the revisions for this merge
:2. Tag the revisions for this merge


     cvs -z3 tag BRANCH_MERGE
     cvs -z3 tag [[BRANCH_MERGE]]


:3. Switch your working copy back to the branch you want to merge to (HEAD is the default if you don't specify a branch with -j)
:3. Switch your working copy back to the branch you want to merge to (HEAD is the default if you don't specify a branch with -j)


     cvs -z3 update -PAd -j OTHER_BRANCH
     cvs -z3 update -PAd -r [[OTHER_BRANCH]]


:4. Merge the changes between BRANCH_START and BRANCH_MERGE into your working copy
:4. Merge the changes between [[BRANCH_START]] and [[BRANCH_MERGE]] into your working copy


     cvs -z3 update -Pd -j BRANCH_START -j BRANCH_MERGE
     cvs -z3 update -Pd -j [[BRANCH_START]] -j [[BRANCH_MERGE]]


:5. Check for any conflicts and commit the changes
:5. Check for any conflicts and commit the changes
Line 54: Line 54:
If you want to work on BRANCH some more, you'll need to switch your working copy back to BRANCH again.
If you want to work on BRANCH some more, you'll need to switch your working copy back to BRANCH again.


For future merges, you'll need to tag the revisions for those merges with unique tags (e.g. BRANCH_MERGE_2, BRANCH_MERGE_3, etc...), and only merge the changes between the previous merge and the new one.
For future merges, you'll need to tag the revisions for those merges with unique tags (e.g. [[BRANCH_MERGE_2]], [[BRANCH_MERGE_3]], etc...), and only merge the changes between the previous merge and the new one.


This is so you don't end up merging the same set of changes twice.
This is so you don't end up merging the same set of changes twice.
Example:
Example:


   First merge: -j BRANCH_START  -j BRANCH_MERGE
   First merge: -j [[BRANCH_START]]   -j [[BRANCH_MERGE]]
  Second merge: -j BRANCH_MERGE  -j BRANCH_MERGE_2
  Second merge: -j [[BRANCH_MERGE]]   -j [[BRANCH_MERGE_2]]
   Third merge: -j BRANCH_MERGE_2 -j BRANCH_MERGE_3
   Third merge: -j [[BRANCH_MERGE_2]] -j [[BRANCH_MERGE_3]]


If you merge to another branch that you've never merged to before, you'll need to merge from BRANCH_START up through BRANCH_MERGE_3 to catch up.
If you merge to another branch that you've never merged to before, you'll need to merge from [[BRANCH_START]] up through [[BRANCH_MERGE_3]] to catch up.

Revision as of 02:33, 22 January 2006

Starting Work on an Existing Branch
  • checking out a specific branch of MODULE into DIR
    cvs -z3 checkout -r BRANCH -d DIR MODULE
Explanation of switches:
    • -z3 - compress communication with the CVS server
    • -r - the branch to use
    • -d - the directory to checkout into (defaults to MODULE)
  • switching your working copy to BRANCH (commit before you do this unless you like pain!)
    cvs -z3 update -PAd -r BRANCH
Explanation of switches:
    • -P - prune empty directories from your working copy
    • -A - "reset sticky tags" (change the current branch)
    • -d - create new directories as required
    • -r - the branch to use
Making Your Own Branch
1. Make a branch based on the revisions in your working copy (commit before you do this!)
    cvs -z3 tag -b BRANCH
2. Switch your working copy to that BRANCH (as shown earlier)
    cvs -z3 update -PAd -r BRANCH
3. Tag the initial revisions in your branch (you'll need this for merging easily)
    cvs -z3 tag BRANCH_START
Merging Your Changes
1. Commit your work and resolve any conflicts
2. Tag the revisions for this merge
    cvs -z3 tag BRANCH_MERGE
3. Switch your working copy back to the branch you want to merge to (HEAD is the default if you don't specify a branch with -j)
    cvs -z3 update -PAd -r OTHER_BRANCH
4. Merge the changes between BRANCH_START and BRANCH_MERGE into your working copy
    cvs -z3 update -Pd -j BRANCH_START -j BRANCH_MERGE
5. Check for any conflicts and commit the changes

If you want to work on BRANCH some more, you'll need to switch your working copy back to BRANCH again.

For future merges, you'll need to tag the revisions for those merges with unique tags (e.g. BRANCH_MERGE_2, BRANCH_MERGE_3, etc...), and only merge the changes between the previous merge and the new one.

This is so you don't end up merging the same set of changes twice. Example:

 First merge: -j BRANCH_START   -j BRANCH_MERGE
Second merge: -j BRANCH_MERGE   -j BRANCH_MERGE_2
 Third merge: -j BRANCH_MERGE_2 -j BRANCH_MERGE_3

If you merge to another branch that you've never merged to before, you'll need to merge from BRANCH_START up through BRANCH_MERGE_3 to catch up.