Subversion is used for revision control system
I have started using subversion, a concurrent version control system, to track written documents as well as source code (for more details on subversion then provided here click on this). The advantages of this approach are:- Allows very fine-grain editing, switching back between authors.
- Removes the need for email attachments and administrative messages.
- Ensures that no changes get lost.
To ensure that the everyone has the latest copy, one should update and commit often (see below), and one should coordinate with others that are working on the same project. Even if you don't, subversion ensures that no changes will be lost, but the procedure for resolving the conflicts are tedious--since each conflict needs to be examined and resolved.
You are assumed to have subversion, ssh, and python installed on your client. (Python is needed only if you run ssh-installkeys described below.)
The steps are:
- click here to get instructions to set up things on rites and your client.
- Checkout an existing project (needs to be done once per project)
- Edit and modify the project (can be repeated arbitrary number of times)
- Resolving conflicts--oops! (what happens if there are concurrent updates to the same part of the document).
- Tools to compare different latex versions
Checking out a project for the first time
You will first need to checkout the document, that is get a copy of the document which exists in the repository:- svn checkout svn+ssh://rites.uic.edu/home/svn/type/proj
Editing
The basic workflow for checked out files is described here. In consists of:- updating: ensuring you have the latest copy
- the edit cycle: where you change your copy and
- commit: where you put your copy back into the repository
Updating
If you checked out this file a while ago, and/or someone may have made changes to it, you need to update it:- svn update
The edit cycle
You can now edit the files in the directory with the editor of your choice.If you want to copy, move, add, or delete files or create a directory you need to type:
- svn copy filename1 filename2
- svn move filename1 filename2
- svn add filename
- svn delete filename
- svn mkdir filename
The information kept in the repository for text are the .tex, .bib, the figure source (eg. x.dia) and the source converted to pdf (eg. x.pdf). The idea is that, using only pdflatex and bibtex you can modify and latex the files; you do not have to have the figure drawing package unless you want to modify the figures.
For source code, it is the source, documentation, and build software which is kept in the repository, although documentation may be kept externally.
Saving the results
It is best to save early and often. This is accomplished by:- svn commit
If you want to see what changes have been made, type
- svn log
Resolving conflicts
If you try to commit your document and someone else has committed a document since your last checkout/update, the commit will be refused. You'll need to do an update. If the changes you made and those made by the other person are near each other, than they will conflict and subversion will be unable to automatically resolve them. Assume that the conflict is on fullModel.tex.- Then svn update will create files fullModel.tex.rN, fullModel.tex.rM for the two versions of the file, and perhaps fullModel.tex.mine if its different from fullModel.tex.
- fullModel.tex now contains some kind of "markers" indicating where the differences are.
- your choices are:
- edit fullModel.tex and resolve differences
- copy over one of fullModel.tex.r{M,N} fullModel.tex to keep one version of the changes and throw away others.
- type svn revert to throw away your changes.
diff fullModel.tex.r{M,N} to have some idea of what they are and what to search for. - when you are done resolving the changes, type
svn resolved fullModel.tex (which removes fullModel.tex.{mine,rM,rN}). - now you can commit
Tools to compare different latex versions
Subversion keeps track of a global version number for the repository. Hence, if there are multiple projects in the repository, the version number of a project can increase without any changes to the project.We have been using latexdiff, with some success, to compare different versions of latex documents. Its not perfect, and its available from CTAN, but I've included a copy here.
To use it with subversion, I've hacked together a small script called svndiff available here. Install both scripts and make them executable.
To use it type
- svndiff type proj date paper
- svndiff papers securityProperty {2005-07-01\} paper