doc:kb:subeversion

Subversion

In case you made a commit you want to fully rollback (so remove any history of that change and restore the repositoy exactly as it was) there is a brute way to rollback: Basically dump it again up to the given previous revision and reload it as new:

svnadmin dump /srv/svn/repository -r0:<revision> dump.svn
svnadmin create /srv/svn/rollback-repos
svnadmin load /srv/svn/rollback-repos < dump.svn

Quite intensive and can also be done in a single commandline (if you already created the new repos):

svnadmin dump /srv/svn/repository -r0:<revision> | svnadmin load /srv/svn/rollback-repos
This doesn't restore any configuration or hook setup (./conf/ and ./hooks/ directories)

To create a branch, simply make a copy of the trunk:

svn copy <trunk-url> <branch_url>

While you work on your local-copy of the branch, you should keep it in sync with the trunk (merge upstream changes) in order to avoid big issues when you merge back the branch into the trunk.

To keep it in sync, first make sure your working copy has no local modifications, and if it has, commit them:

branch-copy> svn status
branch-copy> svn commit

Then sync upstream trunk change into your branch:

branch-copy> svn merge <trunk-url>

In case it fails warning about mixed revision (probably your branch was already synced with trunk), update it and try again with merge. Check for changes applied with svn status, check it works and commit the changes again:

branch-copy> svn commit -m "Synced with trunk"

Now you are in 'sync' with trunk

When you finished all your local changes and branch is ready, check again that your local-copy is up to date and in sync with trunk.

Then fetch/checkout a copy of the trunk locally:

local> svn checkout <trunk-url>

And merge back (reintegrate) your branch changes into it:

trunk-copy> svn merge --reintegrate <branch-url>

As usual, test build and check everything is working as expected and finally commit the new trunk changes which now will include your branch changes into it:

trunk-copy> svn commit -m "Integrated branch changes"

You're done!

  • <todo #count:2016-08-23>Document Branching and merging</todo>
  • <todo>Chaning MIME</todo>
  • doc/kb/subeversion.txt
  • Last modified: 2021/06/10 21:46
  • by 127.0.0.1