This wiki is now closed and kept for historical purposes. Please visit the new wiki at https://lbne.bnl.gov/wiki/

SVN Repository

From DUSEL
Jump to navigationJump to search

This topic gives information on LBNE-WCD's Subversion repository.

The Repository

We have a central LBNE Subversion (SVN) repository at

https://lbne.bnl.gov/svn/

First time Access

Note: this site uses a self-signed certificate. Your SVN client may complain about this. The following information may be checked to convince you to trust the certificate:

Hostname
lbne.bnl.gov
Valid
from Mar 3 21:50:57 2010 GMT until Mar 2 21:50:57 2012 GMT
Issuer
Information Technology Division, Brookhaven National Labs, Upton, New York, US
Fingerprint
f9:2c:a7:f0:fc:10:44:4b:c0:bc:b3:47:ab:1f:8c:52:91:de:72:fa


Accounts

Files can be checked out anonymously but an account is needed to check in. To request an account, contact bv@bnl.gov. Email must be sent from a collaborating institution server (not from gmail/yahoo type account). You will need to provide two things:

  1. You preferred username.
  2. Your preferences for receiving commit messages (see below)
  3. A password hash. This can be generated with the command
openssl passwd -apr1

Please do not send passwords in clear text. The "openssl" program should be available on most Unix-like (Linux, Mac OS X, Cygwin) systems.

Commit messages

You can receive an email message each time someone commits. By default, a commit to any repository area will trigger a message. If desired, you can limit the trigger to commits going to zero or more top-level directories.

Repository Browsers

You can browse the repository via your web browser.

More sophisticated browsing is available through the associated trac instance at:

https://lbne.bnl.gov/trac/

Some features require authentication. This is done using your SVN credentials.

Clients

Unix (Linux/Mac OS X) Command Line

On Unix-like platforms the best client to use is the native command line one. It is available as a native package on all popular Linux distributions and on Mac OS X through XCode.

Mac OS X GUI

For Mac users that are afraid of the command line there are GUI clients available but they cost $$. This is not an endorsement but there are two that are appear to be worth considering:

http://www.versionsapp.com/
http://www.zennaware.com/cornerstone/

Windows

On Windows consider TortoiseSVN which integrates SVN into the Windows Explorer file browser.

Using SVN

There are many available resources on the web for learning how to use SVN. The definitive manual is at:

Command Line Basics

Check out an area:

svn co https://lbne.bnl.gov/svn/SOMEAREA

Bring local copy up to date

svn update

Add a file to a checked out area

svn add MYFILE

Add a directory to a checked out area

svn add -N MYDIR

(The -N is needed to stop svn from recursing into the directory. Without it, it is very easy to add unwanted files.)

Committing an added or modified file (or directory)

svn commit -m "Some descriptive message" MYFILE

If you omit a file name svn will commit all modifications from your current directory on down.

Make a new directory, for example, one to store your own files:

svn mkdir https://lbne.bnl.gov/svn/people/MyName

Updating your working copy

To incorporate edits from others you can update your copy. Before committing any of your own modifications you must update. When an update is done, SVN will indicate what it is doing to your files with a letter code:

U
The file has been updated
G
The file has local modifications which have been merged with the updated version

Handling Conflicts

When two people change the same part of a file and the first commits their changes then the second will experience a conflict when an update is done. The SVN client will give you a chance to immediately resolve the conflict by choosing a version or allowing fine-grained merging by editing the file. You can also postpone a decision and let the update continue. More details are in this section of the SVN book.

For the command line client you can either resolve the conflict through the "svn update" command or explicitly through "svn resolve".

Status of your files

The command line command "svn status" will show what SVN thinks the status of your files are. Details are in this section of the manual.

Dealing with HTTP proxy

SVN communicates via HTTPS. Institutions that require going through an explicit HTTP/HTTPS proxy need to configure SVN specially to handle that proxy.

SVN command line client

To configure the "svn" client edit/create the file

~/.subversion/servers

Edit it to fit local conditions.

BNL
[global]
http-proxy-host = 192.168.1.165
http-proxy-port = 3128
LANL
[global]
http-proxy-host = proxyout.lanl.gov
http-proxy-port = 8080

If your site is not listed, you can follow the comments in the default-generated "servers" file. Feel free to update this page with what you needed in order to help others at your institution.


TortoiseSVN (Windows)

Under "Network" click "Enable Proxy Server" and enter the proxy host and port information.