Last days we have had several problems trying to merge two branches using subversion. I wanted to merge trunk to modularity but I always obtained this error:
svn: Working copy path 'lib/runtime' does not exist in repository
This happened using any merge command (svn merge modularity, svn merge trunk@r1 trunk@r2…).
It seems to be related with subversion issue 3067 and the only way to make it work was checking out the svn branch that solves this issue compiling it and using it to do the merge. The steps to do that are:
1) svn co http://svn.collab.net/repos/svn/branches/issue-3067-deleted-subtrees/ svn-mod
2) cd svn-mod
After doing the merge using that svn client the working copy cannot be used anymore with the old svn client.
Recently I’ve added to AD_Column table in Openbravo ERP database the Position column and I’ve commited it to trunk (r8191). This new column stores the physical database order for the columns which will be required by Data Access Layer Project.
This column is mandatory, so when mergeing trunk to project branches it will cause problems in case these projects add new columns. Here I will try to explain who to deal with these problems:
- First of all resolve the conflicts as usual in the xml files.
- If you have created new columns in your project you will not be able to update your database, so before updating let’s put the new column as not mandatory open src-db/database/model/tables/AD_COLUMN.xml file and change the line
<column name="POSITION" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false"> to
<column name="POSITION" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">. Now you should be able to update your database.
- Your database now contains the columns you’ve added to your project with the position value as null, now you have to populate this value to do it execute:
UPDATE AD_COLUMN C
SET POSITION=(SELECT COLUMN_ID FROM USER_TAB_COLUMNS U, AD_TABLE T
WHERE T.AD_TABLE_ID = C.AD_TABLE_ID
AND TABLE_NAME = UPPER(T.TABLENAME)
AND COLUMN_NAME = UPPER(C.COLUMNNAME))
WHERE POSITION IS NULL;
- Export now your database to xml files.
- Revert the previous modification in src-db/database/model/tables/AD_COLUMN.xml file.
- And now you are ready to commit
I have some doubts about how to merge back to trunk the following case: I have a project branch that is already reintegrated in the trunk and another branch that started from the first one, the problem is how to reintegrate it to the trunk.
In this post I will introduce some guidelines and recommendations on how to manage the source code branches for Openbravo R2.40 and R.250.
Currently trunk is used for bug fixing for r2.40 until r2.40 stable version is released.
A branch for r2.50 developments was created from trunk and will be merged back to trunk once r2.40 stable is released. Periodically r2.50 branch will be updated with trunk to take there the bug fixed in trunk.
Taking all this into account the way of working should be:
- Bug fixing: Only commit to trunk, it is not necessary to do it to r2.50 because these commits will be merged periodically, in case you want to commit the fix also to r2.50 do it via merge: do not make different commits in both sides (which could cause conflicts).
- New r2.50 developments: Create a branch for the project from r2.50 branch. Once the project is finished merge it back (reintegrate) to r2.50 branch, in case when the project is finish r2.40 stable is released the merge back will go to trunk.