Index: mergebot/branches/ticket-2/README.txt
===================================================================
--- mergebot/branches/ticket-2/README.txt	(revision 20)
+++ mergebot/branches/ticket-2/README.txt	(revision 21)
@@ -3,5 +3,5 @@
 $ svn co <url> mergebot-0.11
 $ cd mergebot-0.11
-$ ./rpm/makerpm
+$ python setup.py bdist_rpm
 $ su -c "rpm --install dist/TracMergeBot*.noarch.rpm"
 # Create the mergebot work area
Index: mergebot/branches/ticket-2/mergebot/Actor.py
===================================================================
--- mergebot/branches/ticket-2/mergebot/Actor.py	(revision 20)
+++ mergebot/branches/ticket-2/mergebot/Actor.py	(revision 21)
@@ -1,5 +1,9 @@
+"""Base class for mergebot actors that do the various kinds of tasks
+"""
 import os
+from mergebot import SvnOps
 
 class Actor(object):
+    """Base class for mergebot actors"""
     def __init__(self, work_dir, repo_url, repo_dir, ticket, component,
                  version, summary, requestor):
@@ -23,8 +27,10 @@
 
     def logfilename(self):
+        """Returns the absolute path of the logfile for this ticket"""
         return os.path.abspath(os.path.join(os.path.dirname(self.work_dir),
             'ticket-%s.log' % self.ticket))
 
     def public_url(self):
+        """Returns the public URL for this component"""
         return '%s/%s' % (self.repo_url, self.component)
 
@@ -35,4 +41,5 @@
 
     def local_url(self):
+        """Returns the local URL for this component"""
         return 'file://%s/%s' % (self.repo_dir, self.component)
 
@@ -48,4 +55,5 @@
 
     def version_subdir(self):
+        """Returns the subdirectory name for the version"""
         if self.version == 'trunk':
             subdir = 'trunk'
@@ -58,2 +66,15 @@
         return subdir
 
+    def check_required_directories(self):
+        """Make sure the various urls we require do exist"""
+        if not SvnOps.does_url_exist(self.local_url()):
+            return 'Component %s does not exist in the repository.' \
+                % self.component
+        if not SvnOps.does_url_exist(self.local_url() + '/branches'):
+            return 'No directory in which to create branches for ' \
+                'component %s in the repository.' % self.component
+        if not SvnOps.does_url_exist(self.baseline_local_url()):
+            return 'Version %s for component %s does not exist in the ' \
+                'repository.' % (self.version, self.component)
+        return None
+
Index: mergebot/branches/ticket-2/mergebot/BranchActor.py
===================================================================
--- mergebot/branches/ticket-2/mergebot/BranchActor.py	(revision 20)
+++ mergebot/branches/ticket-2/mergebot/BranchActor.py	(revision 21)
@@ -2,5 +2,4 @@
 """Module for creating new branches for tickets"""
 
-import os
 import time
 
@@ -20,14 +19,7 @@
 
         # Make sure the various urls we require do exist
-        if not SvnOps.get_branch_info(self.local_url(), logfile):
-            comment = 'Component %s does not exist in the repository.' \
-                % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.local_url() + '/branches', logfile):
-            comment = 'No directory in which to create branches for component %s in the repository.' % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.baseline_local_url(), logfile):
-            comment = 'Version %s for component %s does not exist in the repository.' % (self.version, self.component)
-            return results, comment, False
+        problems = self.check_required_directories()
+        if problems:
+            return results, problems, False
 
         commit_header = 'Ticket #%s: %s' % (self.ticket, self.summary)
@@ -35,5 +27,5 @@
         # Delete the branch if it already exists.  This can happen if the branch
         # was merged, but we're still working on it.
-        if SvnOps.get_branch_info(self.branch_local_url(), logfile):
+        if SvnOps.does_url_exist(self.branch_local_url()):
             # This branch already exists.
             commit_message = "\n".join([commit_header,
@@ -63,5 +55,6 @@
             'Created branch from %s for %s.' % (self.version, self.requestor),
             '',
-            'Browse branch [source:%s/branches/ticket-%s source code] and [log:%s/branches/ticket-%s commit log].' % 
+            'Browse branch [source:%s/branches/ticket-%s source code] and ' \
+                '[log:%s/branches/ticket-%s commit log].' % 
                 (self.component, self.ticket, self.component, self.ticket),
             '',
Index: mergebot/branches/ticket-2/mergebot/CheckMergeActor.py
===================================================================
--- mergebot/branches/ticket-2/mergebot/CheckMergeActor.py	(revision 20)
+++ mergebot/branches/ticket-2/mergebot/CheckMergeActor.py	(revision 21)
@@ -28,16 +28,7 @@
 
         # Make sure the various urls we require do exist
-        if not SvnOps.get_branch_info(self.local_url(), logfile):
-            comment = 'Component %s does not exist in the repository.' \
-                % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.local_url() + '/branches', logfile):
-            comment = 'No directory in which to create branches for ' \
-                'component %s in the repository.' % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.baseline_local_url(), logfile):
-            comment = 'Version %s for component %s does not exist in the ' \
-                'repository.' % (self.version, self.component)
-            return results, comment, False
+        problems = self.check_required_directories()
+        if problems:
+            return results, problems, False
 
         branch_info = SvnOps.get_branch_info(self.branch_local_url(), logfile)
Index: mergebot/branches/ticket-2/mergebot/MergeActor.py
===================================================================
--- mergebot/branches/ticket-2/mergebot/MergeActor.py	(revision 20)
+++ mergebot/branches/ticket-2/mergebot/MergeActor.py	(revision 21)
@@ -26,18 +26,12 @@
 
         # Make sure the various urls we require do exist
-        if not SvnOps.get_branch_info(self.local_url(), logfile):
-            comment = 'Component %s does not exist in the repository.' \
-                % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.local_url() + '/branches', logfile):
-            comment = 'No directory in which to create branches for component %s in the repository.' % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.baseline_local_url(), logfile):
-            comment = 'Version %s for component %s does not exist in the repository.' % (self.version, self.component)
-            return results, comment, False
+        problems = self.check_required_directories()
+        if problems:
+            return results, problems, False
 
         rev_info = SvnOps.get_branch_info(self.branch_local_url(), logfile)
         if not rev_info:
-            comment = 'Branch for ticket %s does not exist in the repository.' % (self.ticket)
+            comment = 'Branch for ticket %s does not exist in the repository.' \
+                % (self.ticket)
             return results, comment, False
         startrev, endrev = rev_info
Index: mergebot/branches/ticket-2/mergebot/RebranchActor.py
===================================================================
--- mergebot/branches/ticket-2/mergebot/RebranchActor.py	(revision 20)
+++ mergebot/branches/ticket-2/mergebot/RebranchActor.py	(revision 21)
@@ -36,16 +36,7 @@
 
         # Make sure the various urls we require do exist
-        if not SvnOps.get_branch_info(self.local_url(), logfile):
-            comment = 'Component %s does not exist in the repository.' \
-                % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.local_url() + '/branches', logfile):
-            comment = 'No directory in which to create branches for ' \
-                'component %s in the repository.' % self.component
-            return results, comment, False
-        if not SvnOps.get_branch_info(self.baseline_local_url(), logfile):
-            comment = 'Version %s for component %s does not exist in the ' \
-                'repository.' % (self.version, self.component)
-            return results, comment, False
+        problems = self.check_required_directories()
+        if problems:
+            return results, problems, False
 
         rev_info = SvnOps.get_branch_info(self.branch_local_url(), logfile)
Index: mergebot/branches/ticket-2/mergebot/SvnOps.py
===================================================================
--- mergebot/branches/ticket-2/mergebot/SvnOps.py	(revision 20)
+++ mergebot/branches/ticket-2/mergebot/SvnOps.py	(revision 21)
@@ -8,4 +8,5 @@
 import time
 import re
+import subprocess
 
 def shell_quote(string):
@@ -24,4 +25,11 @@
     """Given a log entry split out of svn log, return its revision number"""
     return int(logentry.split()[0][1:])
+
+def does_url_exist(url):
+    """Given a subversion url return true if it exists, false otherwise."""
+    return not subprocess.call(['svn', 'ls', '--depth', 'empty',
+                                '--non-interactive', url],
+                    stdout=open('/dev/null', 'w'),
+                    stderr=open('/dev/null', 'w'))
 
 def get_branch_info(url, logfile):
