Merge

From MapbenderWiki

Jump to: navigation, search

Contents

Known problems

line breaks

Some users check in files developed under Windows, having Windows line breaks. So you can't compare these files to files created in Linux (You will see all lines are marked as changed). These files need to be converted to have UNIX line breaks like this

dos2unix <filename>

If you don't have that command on your machine, install it via

sudo apt-get install tofrodos

See http://www.thefreecountry.com/tofrodos/index.shtml

Meld

Recommended by --Christoph Baudson 15:43, 9 June 2008 (CEST), easier than merging via Subversion.

See Meld.

KDiff3

Another tool much like Meld. It seems more powerful, yet not quite intuitive.

Subversion

Not recommended by --Christoph Baudson 15:43, 9 June 2008 (CEST) It's too complex for his pea-sized brain.

Objective: Merging a branch into the trunk.

Check out the trunk

your local copy is the target of the merge!

svn co https://svn.osgeo.org/mapbender/trunk/mapbender <local_folder>

(All SVN commands may be executed via a GUI, for example via Subclipse in Eclipse)

Determine the revision numbers

Determine the revision numbers of

  • the creation of the branch (refered to as r1)
  • the current revision number of the trunk (r2)

Use the log command to find that out

svn log https://svn.osgeo.org/mapbender/trunk/mapbender


Merge

Optional: Perform a dry run to see the differences between trunk and branch

svn merge -r <r1>:<r2> --dry-run https://svn.osgeo.org/mapbender/branches/<branch_name>

Actually merge the branch into the trunk

svn merge -r <r1>:<r2> https://svn.osgeo.org/mapbender/branches/<branch_name>

Or via Eclipse

Image:Svn1.png

You get a list of files that changed:

  • A = Added
  • D = Deleted
  • U = Updated
  • C = Conflict

Files that have conflicts (C) come in four versions:

<name>                     BEWARE: contains both versions!
<name>.Left.<rev_nr>       version in the trunk
<name>.Right.<rev_nr>      version in the branch
<name>.working             version in local copy of trunk, usually = <name>.Left.<rev_nr>

You have to merge these files manually!

Resolve the conflicts

svn resolved <filename>

or click "Mark resolved" in Eclipse. Only the file

<name>                     

will remain (make sure its content is correct!), the other three versions

<name>.Left.<rev_nr>       
<name>.Right.<rev_nr>      
<name>.working             

will be deleted by Subversion.

Retrieved from "http://mapbender.org/Merge"
Views
Personal tools