Index: mergebot/trunk/mergebot/svn.py
===================================================================
--- mergebot/trunk/mergebot/svn.py	(revision 56)
+++ mergebot/trunk/mergebot/svn.py	(revision 57)
@@ -153,5 +153,6 @@
             elif line.startswith('  Text conflicts:'):
                 continue # ignore the line
-            # TODO: Tree conflicts
+            elif line.startswith('  Tree conflicts:'):
+                continue # ignore the line
             else:
                 assert len(line) > 4 and line[4] == ' ', "Unexpected output " \
Index: mergebot/trunk/utils/test.py
===================================================================
--- mergebot/trunk/utils/test.py	(revision 56)
+++ mergebot/trunk/utils/test.py	(revision 57)
@@ -102,5 +102,5 @@
             raise Exception('svn ls failed with exit code %s' % retval)
 
-    def rebranch(self, ticket_id, component, timeout=15):
+    def _rebranch(self, ticket_id, component, search, timeout=15):
         """timeout is in seconds."""
         self.go_to_mergebot()
@@ -112,9 +112,15 @@
         tc.find('CheckMerge')
         self.go_to_ticket(ticket_id)
-        tc.find('(Rebranched from .* for .*|There were conflicts on rebranching)')
+        tc.find(search)
         retval = call(['svn', 'ls', self.repo_url + '/' + component + '/branches/ticket-%s' % ticket_id],
                     stdout=logfile, stderr=logfile)
         if retval:
             raise Exception('svn ls failed with exit code %s' % retval)
+
+    def rebranch(self, ticket_id, component, timeout=15):
+        self._rebranch(ticket_id, component, 'Rebranched from .* for .*', timeout)
+
+    def rebranch_conflict(self, ticket_id, component, timeout=15):
+        self._rebranch(ticket_id, component, 'There were conflicts on rebranching', timeout)
 
     def merge(self, ticket_id, component, timeout=5):
@@ -233,4 +239,10 @@
         self.assertEqual(retval, 0, "svn commit failed with error %s" % (retval))
 
+    def mv(self, oldname, newname):
+        retval = call(['svn', 'mv', oldname, newname],
+            cwd=self.get_workdir(),
+            stdout=logfile, stderr=logfile)
+        self.assertEqual(retval, 0, "svn mv failed with error %s" % (retval))
+
 
 class MergeBotTestEnabled(FunctionalTwillTestCaseSetup):
@@ -351,5 +363,33 @@
         self.commit('Modify the file on branch')
 
-        self._tester.rebranch(ticket_id, 'stuff')
+        # rebranch, make sure it shows a conflict
+        self._tester.rebranch_conflict(ticket_id, 'stuff')
+
+
+class MergeBotTestRebranchWithBranchRenameConflict(FunctionalSvnTestCaseSetup):
+    def runTest(self):
+        """Verify that the 'rebranch' button works when a file renamed on the branch was modified on trunk"""
+        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
+            info={'component':'stuff', 'version':'trunk'})
+        basename = self.__class__.__name__
+
+        # create a file in which to have conflicts
+        self.checkout()
+        self.add_new_file(basename)
+        self.commit('Add a new file on trunk')
+
+        # create the branch
+        self._tester.branch(ticket_id, 'stuff')
+
+        # modify the file on trunk
+        open(os.path.join(self.get_workdir(), basename), 'a').write(random_sentence())
+        self.commit('Modify the file on trunk')
+
+        # rename the file on the branch
+        self.switch(ticket_id)
+        self.mv(basename, basename + '-renamed')
+        self.commit('Rename the file on branch')
+
+        self._tester.rebranch_conflict(ticket_id, 'stuff')
 
 
@@ -395,4 +435,5 @@
     suite.addTest(MergeBotTestRebranchWithChangeAndTrunkChange())
     suite.addTest(MergeBotTestRebranchWithConflict())
+    suite.addTest(MergeBotTestRebranchWithBranchRenameConflict())
     suite.addTest(MergeBotTestSingleUseCase())
     return suite
