93: Creating a review request chokes on newly-added files

natb****@gmai***** (Google Code) (Is this you? Claim this profile.)
June 9, 2007
If you upload a diff containing a newly-created file (i.e. a file in the
repo didn't exist in revision A, but it got created in revision B), you get
an error like the following:

The file 'trunk/app/views/questionnaires/edit.rhtml' (r183) could not be
found in the repository

To reproduce, point against the Subversion repository at
http://svn.natbudin.com/svn/journey, and create a new review request using
"trunk" as the base diff path.
Index: app/views/questionnaires/edit.rhtml
===================================================================
--- app/views/questionnaires/edit.rhtml	(revision 183)
+++ app/views/questionnaires/edit.rhtml	(revision 184)
@@ -44,17 +44,20 @@
   </tr>
   <tr>
     <td id="pages">
-      <ul>
+      <ul id="pagelist">
         <% @questionnaire.pages.each do |page| -%>
           <li id="page_<%=page.id%>" class="page">
             <div class="caption">
               <%=h page.title%>
             </div>
-            <%=image_tag "delete.png"%>
-            <%=image_tag "edit.png"%>
+            <%=link_to_function(image_tag("delete.png"), 
+              "if (confirm('Do you really want to delete the page \"#{page.title}\"?')) { deletePage(#{page.id}); }")%>
+            <%=link_to_function(image_tag("edit.png"), "switchPage(#{page.id})")%>
           </li>
         <% end -%>
       </ul>
+      <%= sortable_element("pagelist") %>
+      <button>Create New Page
david
#1 david
This diff file doesn't show trunk/app/views/questionnaires/edit.rhtml as being newly
added -- rather, it contains an incremental diff from some revision that presumably
exists in your local repository.  New files in svn diffs look something like this:

--- foo (revision 0)
+++ foo (revision 0)
david
#2 david
  • +Invalid