wiki:AddNewModule

Adding a new module

AKA import, add, commit cycle

Assumptions

For the purpose of this note I assume that;

  • The SVN server is being accessed via https:
  • The SVN repository is Ultracam
  • You're using the module/trunk, module/tags and module/branches layout
  • Your module is called MyServer
  • You've got some sourcode, in ~/mysrc that you want to check in

1) Create the directory structure

You need to import an initial directory structure. You can do this in a temporary location thus;

> cd /tmp
> mkdir ttt
> cd ttt
> mkdir MyServer
> mkdir MyServer/trunk
> mkdir MyServer/tags
> mkdir MyServer/branches
> svn import . https://forge.roe.ac.uk/svn/Ultracam --message 'Initial repository layout'

This will create the directories MyServer/trunk, MyServer/tags and MyServer/branches in the Ultracam repository on the SVN server. After that you should get rid of the temporary directories;

> cd /tmp
> rm -rf ttt

2) Check out a working copy

You need to check out a working copy so you can add sourcecode (etc) to it;

> cd /tmp
> svn checkout https://forge.roe.ac.uk/svn/Ultracam/MyServer/trunk MyServer

This will create a directory MyServer (in /tmp) that contains only a .svn directory

3) Add files

Populate the project by copying files (and/or directories) to the working copy

> cd MyServer
> cp ~/mysrc/*.cpp ~/mysrc/*.h ~/mysrc/Makefile  .

Make sure the working copy is clean, i.e. there aren't any object files or executables. You only want to check in source code.

4) Update the repository

One way is to add the new files, then commit them;

> svn add *
> svn commit -m "Initial source code check-in"

5) Cleanup

> cd /tmp
> rm -rf MyServer

Now you can use it

You can now run svn checkout https://forge.roe.ac.uk/svn/Ultracam/MyServer/trunk MyServer anywhere and it should check you out the current working copy of the MyServer module.

Last modified 12 years ago Last modified on Apr 26, 2007, 12:25:12 PM