mirror of
https://github.com/jlengrand/jlengrand.github.io.git
synced 2026-03-10 08:31:22 +00:00
Changes code blocks to be properly formatted
This commit is contained in:
@@ -28,7 +28,6 @@ On my machine, the repositories are stored in `/spacemetric/svn`, and the reposi
|
||||
|
||||
On my machine, this gives us :
|
||||
|
||||
|
||||
$ cd /spacemetric/svn
|
||||
$ svnadmin dump main > /spacemetric/shared/jll/svnstuff/main_last.dump
|
||||
$ svnadmin dump ext-video > /spacemetric/shared/jll/svnstuff/video_last.dump
|
||||
@@ -36,88 +35,73 @@ On my machine, this gives us :
|
||||
|
||||
And as the main repo is for us the most critical, and I am never sure enough of what I do, I also made a folder copy of the repository :
|
||||
|
||||
```
|
||||
$ cp -rp main main_backup
|
||||
```
|
||||
$ cp -rp main main_backup
|
||||
|
||||
Here, it is worth noting that we decided to create a brand new repository for this, in order to keep the old repositories intact but also to make clear for everybody in a team what happened (by having them making a checkout from scratch).
|
||||
|
||||
As the main repo contains most commits, I decided that I wanted to merge ext-video and public in main. So I started by creating a new repository that was based on the main repo. Which give us :
|
||||
|
||||
```
|
||||
$ svnadmin create spacemetric # Creating the new repository
|
||||
$ cd spacemetric
|
||||
$ svnadmin load . < /spacemetric/shared/jll/svnstuff/main_last.dump # Loading main into the new repo
|
||||
```
|
||||
$ svnadmin create spacemetric # Creating the new repository
|
||||
$ cd spacemetric
|
||||
$ svnadmin load . < /spacemetric/shared/jll/svnstuff/main_last.dump # Loading main into the new repo
|
||||
|
||||
The next step was to insert the content of the ext-video and public repositories into the freshly created spacemetric repo. This is pretty simple to do :
|
||||
|
||||
First we create subfolders for public and video inside spacemetric:
|
||||
|
||||
```
|
||||
$ svn mkdir svn+ssh://jll@svn.spacemetric.se/spacemetric/svn/spacemetric/public-repo --message "Added the public-repo folder to merge public repository."
|
||||
$ svn mkdir svn+ssh://jll@svn.spacemetric.se/spacemetric/svn/spacemetric/video-repo --message "Added the video-repo folder to merge video repository."
|
||||
```
|
||||
$ svn mkdir svn+ssh://jll@svn.spacemetric.se/spacemetric/svn/spacemetric/public-repo --message "Added the public-repo folder to merge public repository."
|
||||
$ svn mkdir svn+ssh://jll@svn.spacemetric.se/spacemetric/svn/spacemetric/video-repo --message "Added the video-repo folder to merge video repository."
|
||||
|
||||
And then load the content of the repository into the subfolders:
|
||||
|
||||
```
|
||||
$ svnadmin load . --parent-dir public-repo < /spacemetric/shared/jll/svnstuff/public_last.dump
|
||||
$ svnadmin load . --parent-dir video-repo < /spacemetric/shared/jll/svnstuff/video_last.dump
|
||||
```
|
||||
$ svnadmin load . --parent-dir public-repo < /spacemetric/shared/jll/svnstuff/public_last.dump
|
||||
$ svnadmin load . --parent-dir video-repo < /spacemetric/shared/jll/svnstuff/video_last.dump
|
||||
|
||||
It is interesting to note here that if no commits are lost in this process, **the order and reference of the commits are changed**. In this case, the public commits are rolled on top of the spacemetric commits, and then the video commits are rolled on top of this. Basically, it looks like the video repo has been created last and all commits have been made there one after the other.
|
||||
The commit history is still complete, but the relative order is now different.
|
||||
|
||||
This is close from what I want, but not quite yet. I already said that all my repos have the same structure, so simply having subfolders won't cut it. Ti try to make things simple, here was the situation before the merge:
|
||||
|
||||
```
|
||||
- main #SVN repository
|
||||
- test
|
||||
- spacemetric
|
||||
- eclipse
|
||||
- video # SVN repository
|
||||
- eclipse
|
||||
- public # SVN repository
|
||||
- eclipse
|
||||
```
|
||||
- main #SVN repository
|
||||
- test
|
||||
- spacemetric
|
||||
- eclipse
|
||||
- video # SVN repository
|
||||
- eclipse
|
||||
- public # SVN repository
|
||||
- eclipse
|
||||
|
||||
Here is the current situation :
|
||||
|
||||
```
|
||||
- spacemetric # SVN repository
|
||||
- test
|
||||
- spacemetric
|
||||
- eclipse
|
||||
- video_repo # subfolder
|
||||
- eclipse
|
||||
- public_repo # subfolder
|
||||
- eclipse
|
||||
```
|
||||
- spacemetric # SVN repository
|
||||
- test
|
||||
- spacemetric
|
||||
- eclipse
|
||||
- video_repo # subfolder
|
||||
- eclipse
|
||||
- public_repo # subfolder
|
||||
- eclipse
|
||||
|
||||
And here is what I want to achieve in the end :
|
||||
|
||||
```
|
||||
- spacemetric # SVN repository
|
||||
- test
|
||||
- spacemetric
|
||||
- eclipse # contains the code from main, video and public
|
||||
```
|
||||
- spacemetric # SVN repository
|
||||
- test
|
||||
- spacemetric
|
||||
- eclipse # contains the code from main, video and public
|
||||
|
||||
Well, the easiest way I found to do this was to do folder operations on the client side. As all repos contained code that was non redundant I was pretty sure there would be no conflict so the process was rather quick and easy :
|
||||
|
||||
On my local machine, here is what I have done :
|
||||
$ svn checkout svn+ssh://jll@svn.spacemetric.se/spacemetric/svn/spacemetric
|
||||
|
||||
$ svn checkout svn+ssh://jll@svn.spacemetric.se/spacemetric/svn/spacemetric
|
||||
|
||||
And then using [Tortoise](http://tortoisesvn.net/) (I hate the SVN command line) I simply moved the eclipse folder from video and public into the main eclipse folder and commited. This was a pretty big and scary commit but everything turned out fine.
|
||||
|
||||
Last but not least, I made sure everybody has to switch to the new repository by adding a pre-commit hook to the old repositories. Bsaically, anyone that would attempt to commit would get an error message back. Doing it was pretty simple. In the main, video and public `/hooks/pre-commit` folder I added the following bash script :
|
||||
Last but not least, I made sure everybody has to switch to the new repository by adding a pre-commit hook to the old repositories. Basically, anyone that would attempt to commit would get an error message back. Doing it was pretty simple. In the main, video and public `/hooks/pre-commit` folder I added the following bash script :
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
echo "No more commit here - this is an archive branch. Please use the Spacemetric repository instead." 1>&2
|
||||
exit 1
|
||||
```
|
||||
#!/bin/sh
|
||||
echo "No more commit here - this is an archive branch. Please use the Spacemetric repository instead." 1>&2
|
||||
exit 1
|
||||
|
||||
Here it is, a clear, unique repository that will allow developers to start using branches easily without having nightmares!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user