3. Getting Out of Trouble
By now, I’m guessing you might have noticed that each folder that gets added to the repository has a new read-only hidden folder. This is illustrated in Listing 9, in which I display the contents of the container folder and I then display the hidden files.
Listing 9 The hidden files
C:\repworkarea\repo>dir 07/20/2007 05:43 PM 11 aFile.txt 07/20/2007 05:43 PM 11 anotherFile.txt 07/20/2007 05:29 PM 19,456 WDoc.doc C:\repworkarea\repo>dir /AH 07/20/2007 06:38 PM <DIR> .svn
In the lower half of Listing 9, the listing command (dir) includes the flag /AH. This has the effect of displaying hidden files and folders, and in this case we see the hidden folder named .svn. You’ll see one of these in each folder of your working copy.
It is this file that helps to provide much of the Subversion magic. For 99.999 percent of the time, you won’t care about the contents of the .svn folder. However, let’s have a little poke around, as illustrated in Listing 10.
Listing 10 Inside the .svn folder
C:\repworkarea\repo>cd .svn C:\repworkarea\repo\.svn>dir Volume in drive C has no label. Volume Serial Number is C05C-1CEC Directory of C:\repworkarea\repo\.svn 07/20/2007 05:43 PM 0 empty-file 07/20/2007 06:38 PM 1,181 entries 07/20/2007 05:43 PM 2 format 07/20/2007 06:38 PM <DIR> prop-base 07/20/2007 05:44 PM <DIR> props 07/20/2007 05:43 PM 120 README.txt 07/20/2007 06:38 PM <DIR> text-base 07/20/2007 06:38 PM <DIR> tmp 07/20/2007 05:43 PM <DIR> wcprops
There’s one item in Listing 10 that is worth a look: the entries file. The contents of the entries file are illustrated in Listing 11, which, as you can see, is XML-based.
Listing 11 The entries file contents
<?xml version="1.0" encoding="utf-8"?> <wc-entries xmlns="svn:"> <entry committed-rev="1" name="" committed-date="2007-07-20T15:26:07.140625Z" url="file:///c:/repository/repo" last-author="Stephen" kind="dir" uuid="c4d4b254-7f37-4741-9e14-aed34f2e59a2" repos="file:///c:/repository/repo" revision="1"/> <entry committed-rev="2" name="WDoc.doc" text-time="2007-07-20T16:29:31.968000Z" committed-date="2007-07-20T17:38:54.734375Z" checksum="a78597ec1bcea5d0ebb476b07a68975b" last-author="Stephen" kind="file" prop-time="2007-07-20T16:44:32.390625Z" revision="2"/> <entry committed-rev="1" name="aFile.txt" text-time="2007-07-20T16:43:57.718750Z" committed-date="2007-07-20T15:26:07.140625Z" checksum="aaab83c5e2e5f09969b8437805e41b8d" last-author="Stephen" kind="file" prop-time="2007-07-20T16:43:57.671875Z"/> <entry committed-rev="1" name="anotherFile.txt" text-time="2007-07-20T16:43:57.734375Z" committed-date="2007-07-20T15:26:07.140625Z" checksum="aaab83c5e2e5f09969b8437805e41b8d" last-author="Stephen" kind="file" prop-time="2007-07-20T16:43:57.703125Z"/> </wc-entries>
Looking at Listing 11, the entries file keeps a record of all the Subversion activities that relate to the folder in question, namely C:\repworkarea. Details maintained in this file include revision levels, file names, timestamps, checksums, author, type, and so on.
Clearly, modifying this file is a perilous pastime, so I won’t go into any more details about it! It is interesting just to look.