To maitain the code it is recommended to use some version controls system. In our case we will use Mercurial with HgTortoise client, for more information about Mercurial check this website: www.hginit.com.
This article is about how to upgrade your SDK package to our newest update without losing your own code changes.
First, we need to create repository with our SDK. It will have only „default” branch so next step is creating named branch for the SDK sources from „portal-sdk-application-portal-sdk-package” zip file, in my case it's „sdk2015-orig” branch.
Next, what I show on screenshot, I performed merge from „sdk2015-orig” branch to „default” branch.
Branch „default” is the place where I commit my changes in code. Every change is commited in particular revisions. I can go back to any revision and update my SDK to particular one. In example: I want to get the state of SDK before Piotr added „toolbar button” and upgrade it to EP04 - all I need is update my revision to revision number 7 and do the next step.
First step to upgrade your SDK is updating your current repository to „sdk2015-orig” branch.
Copy all files from extracted EP04 „portal-sdk-application-portal-sdk-package” zip to your repository, add the new ones and include upgraded, in my example, folder with repository is „Repo SDK”.
Now commit changes.
After commiting, switch to default branch and merge from upgraded „sdk-2015-orig” branch.
NOTICE If you have conflicts in merge, choose „local files” option.
REMEMBER: If you want to merge branches it is important to do this in „default” branch from „sdk2015-org” branch, in opposite way after merge you will get just pure upgraded SDK without your changes from „default” branch.
The solution has now been updated to EP04. The same approach may be repeated with the consecutive patches (EP05, EP06 etc.). The main advantage of version controls systems, is the possibility to retrieve any of changes done in repository. In this case, Piotr done some changes 3 months ago and I want to upgrade my SDK but in particular state. All I need to do is update to revision which interest me and do upgrade in the same way.