INFORMATION ABOUT COLLABORATION USING SubVersion
(including instructions for downloading Core Library)


BASIC INFORMATION

  1. The URL for our SVN repository is "https://subversive.cims.nyu.edu/exact/".
  2. To access any module in this repository, just append the name of the module to the svn home.
    Most modules of interest to users are submodules of the following two: E.g., to get to the "mac" module (containing latex macros), under collab, you would go to
    https://subversive.cims.nyu.edu/exact/collab/mac/
  3. In general, you will need a user name with password. Please contact us if you are collaborating with us, and want access to these modules.
    However, if you just want to browse the source code of Core Library, you can use a guest account (see next).

BASIC USER SIDE INFORMATION

  1. You can access our SVN repository in three ways: (1) by pointing your browser at
    https://subversive.cims.nyu.edu/exact
    or (2) by issuing "svn" commands from a terminal, or (3) use some GUI interface such as TortoiseSVN.
  2. You may access the Core Library anonymously with the user name of "guest" (the password is also "guest").
  3. To test our guest account, point a browser at https://subversive.cims.nyu.edu/exact/svn-test,
    using user name "guest" with password also "guest".
    If you have svn and internet connection, you can test your ability to checkout from this test directory:
    		> svn checkout https://subversive.cims.nyu.edu/exact/svn-test
    		
    or, to list the files in this directory, you can do:
    		> svn ls https://subversive.cims.nyu.edu/exact/svn-test
    		
    You should see the two files there (named "test" and "nontest").
  4. To browse the source code of our Core Library, go to https://subversive.cims.nyu.edu/exact/corelib2/trunk,
  5. HOW TO DOWNLOAD Core Library from SVN
    You need internet connection and two software: "svn" and "make". Execute this in your command line:
    		> svn checkout --depth immediates \
    		     https://subversive.cims.nyu.edu/exact/corelib2/trunk \
    		     core2
    		
    This creates a folder "core2" in your current local directory, with all the top level files and folders of Core Library.
    Next, check out the remaining files using the "make" program:
    		> cd core2
    		> make zeroth
    		
    Now follow in instructions in the README file to get started.
  6. In general, you need a user name and password to access the svn.
    Say your user name is "yap", and you wish to check out a svn module (say) "collab/mac",
    it is best to issue the terminal command:
    		> svn checkout --username yap https://subversive.cims.nyu.edu/exact/collab/mac
    		
    or (if you have a Courant account "yap")
    		> svn checkout https://yap@subversive.cims.nyu.edu/exact/collab/mac
    		
    NOTE: instead of using a command terminal, you could use an interface or app such as TortoiseSVN that is available on standard OS platforms.
  7. Following the above instructions,
    after listing the folder information, if you want to create a directory under the folder, you also need a user name and password.
    Say your user name is "yap", and you wish to create a folder (say) "test" under "collab/",
    please issue the terminal command:
                    > svn mkdir --username yap https://subversive.cims.nyu.edu/exact/collab/test
        

    If you have any questions, feel free to send an email to yap@cs.nyu.edu.

BASIC SERVER SIDE INFORMATION

  1. To add a new svn user:
    		> ssh exact@access.cims.nyu.edu
    		> su exact
    		> htpasswd /home/svn/exact/auth/passwd [user-name]
    		
    You will be asked to provide a password for the user. If [user-name] is already in the system, this will just update the password.
  2. To edit user permissions
    		> ssh exact@access.cims.nyu.edu
    		> gvim /home/svn/exact/auth/access
    		
    The format for this access file is illustrated in Courant Subversion Info page

SERVER SIDE JOBS

  1. Create a repository for exact.
    	  > svnadmin create /home/exact/svn/exact
    		
    Actually, this repository is locally administered by exact.
    The repository that the Courant svn server uses is /home/svn/exact.


  2. Import the selected repository from the CVS to the SVN.

    	  > cvs2svn -s /home/exact/svn/exact/corelib2
    	  	/home/exact/cvsroot/exact/corelib2
    	  >c vs2svn -s /home/svn/exact/corelib2
    	  	/home/exact/cvsroot/exact/corelib2
    	
  3. The Courant svn server is always running. To install the local SVN server for exact (in case it is not running in background):

    	  >svnserve -d
    	  

CLIENT SIDE JOBS

  1. Set up environment variables

    Assign a text editor to the SVN.
    	  > export SVN_EDITOR=vim
    	  
    Project developers can access the SVN through SSH protocol.
    	  > export SVN_ROOT=svn+ssh://exact@access.cims.nyu.edu/home/exact/svn/exact
    	  
  2. Checking out the SVN remotely (assuming pre-existing repository, e.g., corelib2)

    For developers who has access to the repository, (see the section B of Collaboration Using CVS to obtain access.)
    	  > svn co $SVN_ROOT/corelib2  [LOCALDIR]
    	  
    This will check out corelib2 to [LOCALDIR]. Although [LOCALDIR] is optional, it is useful to have (else you get a long path).
  3. Commitment after your modifications to a file

    First resolve conflicts (if any) and then commit:
    	  > svn resolved [filename]
    	  > svn commit [filename]
    	  
  4. Adding or deleting a file or directory
    	  > svn add [file-or-dirname]
    	  > svn delete [file-or-dirname]
    	  
  5. Renaming or Copying
    	  > svn move [orig-filename] [new-filename]
    	  > svn copy [source-filename] [destination-filename]
    	  
  6. Creating a new repository from a current directory NEWDIR:
    	  > cd NEWDIR
    	  > svn import [PATH=.]
    	  	https://subversive.cims.nyu.edu/exact/collab/etc/etc.
    	  
    Note that PATH is optional (defaults to ".").

  7. Selective Checkouts of a directory [foobar]:
    	 > svn co --depth immediates $(SVN_ROOT)/[foobar] [local-foobar]
    	 
    will checkout only the top-level files and folders to [local-foobar]. Instead of "immediates", you may want "files" or "empty". Default depth is "infinity". For selective checkouts, use "empty" or "immediates".
    If [foobar] has file1, folder1 and folder2, you now see a copy of these 3 files in [local-foobar]. To check out the all the contents of folder1, do this:
    	 > svn up --set-depth infinity [local-foobar]/[folder1]
    	 
    Note that we call "svn up" not "svn co" here. If you want to find out the current depth of a folder foobar, do this:
    	 > svn info [foobar] | grep "Depth"
    	 
    Nothing is printed if the Depth is infinity. Otherwise, it might print "Depth: immediates" or similar.

  8. How to lookup or revert to older versions of file [foo]:

    First, find out which versions are available by doing:
    	 > svn log [foo]
    	 
    There are probably many output lines with this format:
    	 r4321 | yap | 2019-02-01 15:32:49 -0400 (Sat, 01 Feb 2019) | 1 line
    	 
    indicating revision No.4321 with one line change was commited by yap on Feb 1st, 2019.

    You can put a version of the file in [foo-v4321] with
    	 > svn cat -r 4321 [foo] > foo-v4321
    	 
    or just look at this version on the screen using programs such as "more" or "less":
    	 > svn cat -r 4321 [foo] | less
    	 
    Of course, you can also update your latest version to v.4321:
    	 > svn update -r 4321 [foo]
    	 
  9. How to compare (i.e., diff) two versions of file [foo]:

    (1) The simplest usage is to compare your local copy of [foo] with the version in svn. Here are 3 equivalent ways to do this:
    	 > svn diff [foo]
    	 > svn diff [foo] > [bar] 
    	 > svn diff -r4321 [foo] 
    	 
    The first form is simplest. The second form is used to re-direct the screen output into a file called [bar]. The third form is equivalent the first two forms provided the latest revision number of [foo] is 4321. Of course, you can replace 4321 by any older revision number.

    (2) Suppose you want to compare two previous revisions of [foo] that are already in svn.
    First, find out which revisions are available:
    	 > svn log [foo]
    	 
    From the output, suppose you decide to compare revisions 4321 and 4322. Then do:
    	 > svn diff -r 4321:4322 [foo]
    	 

USEFUL LINKS