Index: buildbot/steps/source.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v
retrieving revision 1.3
diff -u -r1.3 source.py
--- buildbot/steps/source.py	25 Sep 2006 07:46:56 -0000	1.3
+++ buildbot/steps/source.py	7 Dec 2006 19:47:35 -0000
@@ -347,7 +347,7 @@
     name = 'svn'
 
     def __init__(self, svnurl=None, baseURL=None, defaultBranch=None,
-                 directory=None, **kwargs):
+                 directory=None, svndir=None, **kwargs):
         """
         @type  svnurl: string
         @param svnurl: the URL which points to the Subversion server,
@@ -368,6 +368,12 @@
                               explicitly. It will simply be appended
                               to C{baseURL} and the result handed to
                               the SVN command.
+
+        @param svndir: if branches are enabled, this is the directory
+                       to append to the URL after C{baseURL} and the branch
+                       have been appended.  You can use this to check out a
+                       subdirectory of the repository.  It should start with
+                       a slash.                              
         """
 
         if not kwargs.has_key('workdir') and directory is not None:
@@ -379,6 +385,7 @@
         self.svnurl = svnurl
         self.baseURL = baseURL
         self.branch = defaultBranch
+        self.svndir = svndir
 
         Source.__init__(self, **kwargs)
 
@@ -448,12 +455,19 @@
             self.args['svnurl'] = self.svnurl
         else:
             self.args['svnurl'] = self.baseURL + branch
+            if self.svndir is not None:
+                self.args['svnurl'] = self.args['svnurl'] + self.svndir
+
+        # add peg-revision to svnurl
+        if revision is not None and revision != "HEAD":
+            self.args['svnurl'] = self.args['svnurl'] + "@" + str(revision)
+            
         self.args['revision'] = revision
         self.args['patch'] = patch
 
         revstuff = []
         if branch is not None and branch != self.branch:
-            revstuff.append("[branch]")
+            revstuff.append("[%s]" % branch)
         if revision is not None:
             revstuff.append("r%s" % revision)
         self.description.extend(revstuff)

