Subversion

From Digital Scholarship Group
Jump to navigation Jump to search

Using our Subversion server

Repositories: (Encoders — the bold one is the one you are probably interested in.)

Via SyncRO SVN Client (i.e., oXygen)

First, don’t be too stressed at the fact that the SVN Client is deprecated. The SyncRO guys have assured us that what that means is not that they plan to remove the SVN Client, but rather that the do not plan to make any improvements to it. If and when Subversion itself becomes incompatible with their SVN Client, they may be forced to drop it. But until then, they expect to include SVN Client in upcoming releases of oXygen.

Create local folder
Create a folder on your computer where you want the working copy to go. Your Documents/ folder is recommended. Give it a name like “WWPtextbase” or “WWP_tb” and put it where you want it to stay, as it is annoying to move. Probably a bad idea to put it in Desktop/ or a cloud-based folder (like Dropbox/), definitely a bad idea to put it in a temporary folder (like /tmp/).
Launch oXygen (if not already running)
Open the SVN Client main window
Select the Tools > SVN Client menu item
Request a new repository
Select the “Repositories” tab
Select the Repository > New Repository Location… menu item (CTL-ALT-N, the tiny can with blue circled plus sign icon or, if it is visible, the “Add a new repository” button)
Paste repository URL (which you can copy from list above—you want the bolded URL) to the “Repository URL” field and hit “Add”
Authenticate
You will probably be prompted for a username and password. For encoders the common username is “dsg”; if you do not know the password, ask a staff member face-to-face, by telophone or televideo, or by text message (i.e., not by e-mail). If you have the option to store the password locally (“Store authentication data”), feel free to do so; however, if your computer is stolen or otherwise compromised let us know so we can change the password.
Check out
Select Repository > Check out… (CTL-ALT-O, or the can with the blue down arrow)
In the resulting “Check out” dialog box everything should be filled in for except the “Check out to:” field, which should be set to the directory you created, above.
Note that if you use the “Browse…” button to find the directory (highly recommended), the software may eagerly tack the last component of the URL (e.g. “/trunk”) onto the end of the filepath. You should delete it.
Click “Check out”
For the textbase repository (~2.7 GiB) or other large repositories downloading may take a long time, depending on your network connection.

Via Commandline

Checking out

svn co [URL] Directory/

Where Directory/ is the target directory on your local machine. E.g., to get a local temporary copy of the XML source files to the Guide, you might issue svn co https://liblab.neu.edu/svn/DSG/wwp/website/trunk/encoding/guide/xml/ /tmp/GuideSource/. If you want the new directory plopped into your current directory with the same name as it has in Subversion, leave Directory/ out.

Using Subversion for the WWP website hotsheet

check out a series of revisions of a particular directory to /tmp/

cd /tmp/
for n in $(svn log URL | egrep '^r[0-9]' | awk '{ print $1 }' | perl -pe 's/^r//;' ); do
   echo "---------$n:";
   mkdir thing$n;
   svn co -r $n URL ./thing$n;
   done

where URL is the URL of the repository directory you want to check out, and “thing” should probably be something a little more intelligent. :-)

Remote updating (old)

If you have the svnrup.bash command installed on your local system, you can use it to perform an svn update on golf or papa without actually bothering to log in on the remote machine (i.e., golf or papa).

The svnrup.bash command is attached to this page. It only works with a machine that has its sister program, svn_update_via_URL.bash installed, which is currently only golf and papa. To install it onto a Mac OS X or GNU/Linux system:

  1. download it
  2. put it where you want it (typically /usr/local/bin/ or ~/bin/)
  3. make sure it is executable, e.g. chmod a+x /usr/local/bin/svnrup.bash
  4. OPTIONAL: in order to avoid needing to invoke it by its full path, make sure that the path to it is in your $PATH environment variable. Ask Syd if you want a hand with this.

To use it, navigate in your shell to the directory you want to update on golf or papa. You will often already be in that directory, having just issued a svn ci -m "msg" command.

Then issue svnrup.bash. Switches are: -g = update on golf, -p = update on papa, -h or -? = print commandline syntax. You can issue both golf and papa switches: -gp.

What it does

The svnrup.bash command looks up the URL of the Subversion repository that corresponds to your current working directory, and sends that off to the svn_update_via_URL.bash command on golf, papa, or both. (It will even send it to papa twice if you specify -p -p, which is silly.) Note that the "send" command is ssh, which will prompt you for your password on the remote machine. The way it knows which user name to use for you on the remote machine is pretty simple: svnrup.bash just looks at your local user name and looks up the remote user name from that. Nothing clever.

Anyway, svn_update_via_URL.bash then determines the target directory by looking at the URL it was passed. It is done in a way that is a little more complicated than a simple lookup, but the result is the same. I.e., it has to know where we keep our repositories on golf and papa. Right now it only knows about three of them ? thus you can start at any point within the following trees:

We can add more if we need to. We just need to remember to update the command on both golf and papa :-)

Once it knows the correct directory, svn_update_via_URL.bash goes to it and checks to see if there is a potential conflict. If there is a potential conflict, it issues an error message and quits. If not, it does the update and then changes the mode of all files in the directory to group-writable, recursively.

That's it!