Friday, May 28, 2010

Structural Changes to the Repository

For a couple of reasons I have made some structural changes to my remote code store, or repository. First, if I want other people to contribute, I need to make it easy to understand what goes where. Secondly, I wanted to play around a bit more with subversion (svn) commands.

My first task was to create some new directories. When I read the book, it looked as if you used svn commands just like DOS or "shell" commands, and instead of them. So I tried:

svn add "my documents\code\100515\client"

without having first created the client subdirectory. But it didn't work. The wording given by the --help switch makes it clearer:

svn add --help
add: Put files and directories under version control, scheduling
them for addition to repository.
usage: add PATH...

In other words the add command brings a folder under the svn umbrella, but it cannot be used to create one.

Next I wanted to move some source files from the trunk to the new subdirectory. The command and the displayed results were as follows.

svn move "my documents\code\100515\AMJApp.java"
"my documents\code\100515\client\src"
A My Documents\Code\100515\Client\src\AMJApp.java
D My Documents\Code\100515\AMJApp.java

This time the svn command really did replace the equivalent DOS command. I repeated the process for all my source files.

I then committed the changes:

svn commit "my documents\code\100515" -m
"Added a preliminary directory structure"
Deleting My Documents\Code\100515\AMJApp.java
Adding My Documents\Code\100515\Client
Adding My Documents\Code\100515\Client\src
Adding My Documents\Code\100515\Client\src\AMJApp.java
Adding My Documents\Code\100515\Client\src\QAdd.java
Adding My Documents\Code\100515\Client\src\QDiv.java
Adding My Documents\Code\100515\Client\src\QMul.java
Adding My Documents\Code\100515\Client\src\QSub.java
Adding My Documents\Code\100515\Client\src\QTrack.java
Deleting My Documents\Code\100515\QAdd.java
Deleting My Documents\Code\100515\QDiv.java
Deleting My Documents\Code\100515\QMul.java
Deleting My Documents\Code\100515\QSub.java
Deleting My Documents\Code\100515\QTrack.java

1 comment:

Dokemion said...

I am trying to learn java. Thanks for the post.