|
Size: 331
Comment:
|
Size: 4595
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| SVN! | SVN! aka, Subversion! |
| Line 3: | Line 3: |
| We are in the process of installing the 40m directory tree into SVN version control. | The SVN repository is set up in /cvs/cds/caltech/svn. '''Do not''' try to modify it or put anything on the directory. It is the job of svn command. An apache web server dedicated to handle svn queries is running on nodus. For more information about svn, please refer to the following web page. http://svnbook.red-bean.com/ |
| Line 6: | Line 12: |
| You can access the svn repository from the control room computers by something like {{{svn co file:///cvs/cds/caltech/svn/trunk/}}}. However, it is strongly discouraged to do so unless you are absolutely sure about what you are doing. Use the method below even from the control room computers. | |
| Line 7: | Line 14: |
| Yoichi will write something here. | == Uploading a New Directory to the Repository == The command svn import will take a local directory and move its contents (not the directory itself, though) to a specified directory in the repository. It is to be run on files that are not yet in the repository (not for updating files that already are). For example: {{{ svn import --username ./test https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test -m "Notes regarding the import go here."}}} will take everything in the local directory {{{./test}}} and copy it into the repository under the path {{{https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test}}}. If the path in the repository does not exit, it will create the necessary directories. The import command does ''not'' set the new directory up for editing; i.e., commands like add, commit, update, etc. will not work. In order to set up the local system for working with these commands, the checkout command must be used (described below). '''Note:''' {{{svn import}}} copies the contents of the local file, not the file itself. Thus, {{{ svn import --username ./test https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/ }}} will put the contents of {{{./test}}} (not {{{./test}}} itself) in the folder docs, which may not be desired. '''Another Note:''' As with commit, import ''requires'' the {{{-m}}} flag and a following blurb of texting describing the import. |
| Line 10: | Line 32: |
| The command {{{svn checkout}}} (or svn co) copies a directory from the repository to the local computer. It will also set-up the newly created local directory for use with commands such as add, commit, etc. For example: | |
| Line 11: | Line 34: |
| You can do something like this: | {{{ svn checkout --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test/ ./workingCopy-test }}} |
| Line 13: | Line 36: |
| {{{svn co svn+ssh://controls@nodus.ligo.caltech.edu/cvs/cds/caltech/svn/trunk/medm}}} | will copy the contents of {{{https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test/}}} and to the path {{{./workingCopy-test}}}. If the required path does not exist, it will create the required directories. It also creates a {{{.svn}}} file inside {{{./workingCopy-test}}} and every sub-directory of {{{./workingCopy-test}}}. It is this file that allows commands like add and commit to work. If you want to check out an older version of a directory, use the flag {{{-r}}} followed by the desired version number. '''Note:''' Like import, check out copies the contents of a directory, not the directory itself. Be careful you don't copy one directory too shallow. '''Another Note:''' The command {{{svn checkout svn+ssh://controls@nodus.ligo.caltech.edu/cvs/cds/caltech/svn/trunk/test/ ./workingCopy-test}}} also works, though it should be avoided in favor of the previous method whenever possible. == A sample session == '''Task''': Making your own directory under trunk/docs/ and put a draft of your potentially Nobel prize winning paper. (1) Make your own directory in the repository. {{{svn mkdir --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/mydir}}} (2) Check out the directory you just created to your machine. {{{svn co --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/mydir}}} (3) Move to the checked out directory. {{{cd mydir}}} (4) Put your draft into the directory. {{{cp /somewhere/ProofOfEverything.tex . }}} (5) Put the file under the svn's control. {{{svn add ProofOfEverything.tex}}} (6) Check it in to the svn repository. {{{svn ci -m "The first draft"}}} You have to put your comment after {{{-m}}} (7) Update your working copy. {{{svn up}}} (8) Now delete the file from the repository because you realized it is totally bullshit. {{{svn delete ProofOfEverything.tex}}} {{{svn ci -m "Oops, I was wrong"}}} However, your crappy paper can still be retrieved from the repository by requesting an old version, because all the history is recorded in the svn world. |
SVN! aka, Subversion!
The SVN repository is set up in /cvs/cds/caltech/svn. Do not try to modify it or put anything on the directory. It is the job of svn command.
An apache web server dedicated to handle svn queries is running on nodus.
For more information about svn, please refer to the following web page. http://svnbook.red-bean.com/
Using SVN in the control room
You can access the svn repository from the control room computers by something like svn co file:///cvs/cds/caltech/svn/trunk/. However, it is strongly discouraged to do so unless you are absolutely sure about what you are doing. Use the method below even from the control room computers.
Uploading a New Directory to the Repository
The command svn import will take a local directory and move its contents (not the directory itself, though) to a specified directory in the repository. It is to be run on files that are not yet in the repository (not for updating files that already are). For example:
svn import --username ./test https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test -m "Notes regarding the import go here."
will take everything in the local directory ./test and copy it into the repository under the path https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test. If the path in the repository does not exit, it will create the necessary directories.
The import command does not set the new directory up for editing; i.e., commands like add, commit, update, etc. will not work. In order to set up the local system for working with these commands, the checkout command must be used (described below).
Note: svn import copies the contents of the local file, not the file itself. Thus,
svn import --username ./test https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/
will put the contents of ./test (not ./test itself) in the folder docs, which may not be desired.
Another Note: As with commit, import requires the -m flag and a following blurb of texting describing the import.
Getting files from off-site
The command svn checkout (or svn co) copies a directory from the repository to the local computer. It will also set-up the newly created local directory for use with commands such as add, commit, etc. For example:
svn checkout --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test/ ./workingCopy-test
will copy the contents of https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/test/ and to the path ./workingCopy-test. If the required path does not exist, it will create the required directories. It also creates a .svn file inside ./workingCopy-test and every sub-directory of ./workingCopy-test. It is this file that allows commands like add and commit to work. If you want to check out an older version of a directory, use the flag -r followed by the desired version number.
Note: Like import, check out copies the contents of a directory, not the directory itself. Be careful you don't copy one directory too shallow.
Another Note: The command
svn checkout svn+ssh://controls@nodus.ligo.caltech.edu/cvs/cds/caltech/svn/trunk/test/ ./workingCopy-test
also works, though it should be avoided in favor of the previous method whenever possible.
A sample session
Task: Making your own directory under trunk/docs/ and put a draft of your potentially Nobel prize winning paper.
(1) Make your own directory in the repository.
svn mkdir --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/mydir
(2) Check out the directory you just created to your machine.
svn co --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/docs/mydir
(3) Move to the checked out directory.
cd mydir
(4) Put your draft into the directory.
cp /somewhere/ProofOfEverything.tex .
(5) Put the file under the svn's control.
svn add ProofOfEverything.tex
(6) Check it in to the svn repository.
svn ci -m "The first draft"
You have to put your comment after -m
(7) Update your working copy.
svn up
(8) Now delete the file from the repository because you realized it is totally bullshit.
svn delete ProofOfEverything.tex
svn ci -m "Oops, I was wrong"
However, your crappy paper can still be retrieved from the repository by requesting an old version, because all the history is recorded in the svn world.
