What is Subversion?
Subversion is an open-source cross-platform version control system[1]. Its official website is http://subversion.tigris.org. What is version control system (VCS)? It's a software for managing the whole development progress of a project (software project, documentation project, and so on). It stores all the development history in a place called repository. It manages privileges of developers. For example, who can add stuff to the repository, who can modify stuff in the repository, and who can delete stuff from the repository, are all managed by the VCS. It also deals with the conflict when two or more developers are trying to modify the same file in the repository simultaneously.
Why use VCS to organize digital photos?
The photos are safe, once they are imported into VCS's repository. Here "safe" means you can do any post-processing to the photos without losing the original copy. Because the repository stores the whole history of the files, and you can get a copy of any historical time.
You can tidy up your photo folders by deleting all bad photos without hesitation. If you later find you deleted a good photo which you thought it's bad, you can restore it.
To backup the photos is easy. VCS provides simple commands to backup and recover a repository.
Why use Subversion, not other VCS?
Subversion is open-source, so you can use it free of charge.
Subversion is cross-platform. No matter what operating system you are using, you can install Subversion on it. At least it supports Windows, Mac OS X, Linux, FreeBSD, OpenBSD[2].
CVS is another popular open-source cross-platform VCS. Subversion is a newer generation VCS than CVS. The most important difference in our case, is that digital photos (jpeg, RAW) are binary files and Subversion handles binary files more gracefully than CVS does[1].
How to organize photos with Subversion?
Install Subversion on Windows
Download latest Subversion package for Windows from Subversion official website. There're a lot of packages there. In our case we should download the one described as "Windows installer with the basic win32 binaries" and named svn-x.x.x-setup.exe, with "x.x.x" the latest version number.
Run the file we just downloaded to install Subversion.
Install Subversion on FreeBSD from ports
Make sure you've already installed ports and updated them to the latest version.
Execute the following commands with the root account:
cd /usr/ports/devel/subversion/
make install clean
For installing Subversion on other operating systems, please refer to the Subversion documentation and the OS documentation.
On Windows, almost all Subversion operations will be executed under "Command Prompt." When you read "run the following commands" in this article, you are supposed to open a "Command Prompt" and type the commands in it to run. There's a GUI tool called TortoiseSVN, which can let you operate Subversion on a graphical interface. You can get it and its documentation on its official website http://tortoisesvn.tigris.org. I'm not going to use this tool in this article.
Create a repository
Choose where to put the repository. Suppose originally we store all the photos in D:\photo . Now we are going to create a repository at D:\repos\photo . Please note that the deepest repository folder name should be the same as the one where the photos originally stored. For example, you can choose to put the repository at C:\1\2\3\photo , but you're not supposed to choose a folder like D:\repos\foto .
Run the following command:
svnadmin create D:\repos\photoNow we created an empty repository.
Import the photos into the repository
If you don't have any photo yet, you can ignore this importing step.
Run the following commands:
D:
cd \
svn import photo file:///d:/repos/photo -m "Initial import"If the screen displays "Committed revision 1" at the end, the importing is successful. Now we can delete the folder D:\photo , and we are supposed to do so. If you're afraid of losing the original data, you can rename the folder.
Initial checkout to make a working copy
Make sure the original photo folder D:\photo is deleted or renamed.
Run the following commands:
D:
cd \
svn checkout file:///d:/repos/photoNow you get the folder D:\photo again. And it's called the working copy. Remember, you are supposed to process your photos on the working copy, not the repository. The repository stores the whole history of the working copy.
How to organize the photos?
I'll give an example to describe all the basic operations of organizing the photos. Suppose you take three photos today, named 01.jpg, 02.jpg, and 03.jpg in your memory card.
Importing the photos
Create a new folder D:\photo\20070901 .
Directly copy the three photos into the new folder D:\photo\20070901 .
Run the following commands:
D:
cd \photo
svn add 20070901
svn commit -m "Added 20070901"If "Committed revision X" is displayed with X the repository version number, the new photos have been successfully imported into the repository. Please make sure the photos are successfully imported into the repository before you go on to next step.
Deleting a bad photo
Suppose you took two pictures, say 01.jpg and 02.jpg, of a same scenery. Now you compare the two pictures and decide to keep only 02.jpg and delete 01.jpg .
Run the following command:
svn delete D:\photo\20070901\01.jpgThis will only affect the working copy. We will submit the deletion to the repository later.
Remeber to use the above command to delete a photo. Don't simply delete it using "delete" or "rm" command or delete it in Windows Explorer.
If you now you change your mind and want to recover 01.jpg, run the following command:
svn revert D:\photo\20070901\01.jpg
Post-processing a photo
Suppose you want to process 03.jpg with Photoshop. Just open 03.jpg with Photoshop and process it as you nornally do.
When done, save to the same file 03.jpg, overwrite it. Don't worry, the repository already saved the original 03.jpg. So you can feel free to make any modification to the 03.jpg in the working copy.
If you don't like your modification, run the following command:
svn revert D:\photo\20070901\03.jpgPlease note that your modification has not been stored in the repository yet. By running the above command, you lose your modification.
Commit all modifications to the repository
Run the following commands:
D:
cd \photo\20070901
svn commit -m "Modified some photos of 20070901"Now only the most beautiful photos stay in D:\photo\20070901 , with the original photos stored in the repository.
Summary
From the above example, we learned these Subversion commands:
svn add (adding new photos)
svn delete (deleting bad photos)
svn commit (committing changes to the repository)
With these commands, we can basically manage our photos. Subversion is a powerful tool, with which we can do more jobs to organize our photos more nicely and safely. We will discuss this in Organizing digital photos with Subversion (advanced).
Reference
[1] Version Control with Subversion (can be obtained from http://svnbook.red-bean.com)
[2] http://subversion.tigris.org




User login

