Get change from one specific commit or from another working directory
Author: LG Calix Last revision: 2024/12/18, LG Calix
Pull the change from one commit
Let’s say you have a local folder folder1, with revision 2345. If for some reason you want to import just the fix brought by revision 3456 - without all the intermediary change - you can do “cherry-picking” with the option -c of svn merge :
cd [folder1] svn merge -c 3456 .
However it is to handle carefully ; during the next svn update, it will compare the HEAD with revision 2345, and thus create a conflict.
Copy the change done on one local folder to other local folders
Second case scenario : you have two working directories WORKDIR1 and 2 with different ORCHIDEE revisions, and did some change to WORKDIR1 that you want to replicate on WORKDIR2 (for example a new model output). Instead of doing it manually, you can use the following commands (eventually it will create .rej and .orig files to resolve conflicts manually) :
cd [WORKDIR1]/modipsl/modeles/ORCHIDEE svn diff > mychange.patch cp mychange.patch ../../../[WORKDIR2]/modipsl/modeles/ORCHIDEE cd ../../../../[WORKDIR2]/modipsl/modeles/ORCHIDEE patch -p0 < my_changes.patch
If you take as destination directory WORKDIR1 (in place of another one, WORKDIR2) it will assume your are trying to reverse the change. If you answer 'yes' for all files, you will instead remove your change (still stored in your patch) from WORKDIR1