download_baselines: allow user to select which builder's images to download
BUG=806
Review URL: https://codereview.appspot.com/6492091

git-svn-id: http://skia.googlecode.com/svn/trunk@5435 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/svn.py b/tools/svn.py
index b9ef618..9bac8e1 100644
--- a/tools/svn.py
+++ b/tools/svn.py
@@ -52,6 +52,19 @@
         """
         return self._RunCommand(['svn', 'checkout', url, path])
 
+    def ListSubdirs(self, url):
+        """Returns a list of all subdirectories (not files) within a given SVN
+        url.
+
+        @param url remote directory to list subdirectories of
+        """
+        subdirs = []
+        filenames = self._RunCommand(['svn', 'ls', url]).split('\n')
+        for filename in filenames:
+            if filename.endswith('/'):
+                subdirs.append(filename.strip('/'))
+        return subdirs
+
     def GetNewFiles(self):
         """Return a list of files which are in this directory but NOT under
         SVN control.