You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/08/05 17:07:25 UTC

svn commit: r982653 [4/4] - in /subversion/branches/issue-2779-dev: ./ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ subversion/bindings/swig/ subversion/bindings/swig...

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/patch_tests.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/patch_tests.py Thu Aug  5 15:07:22 2010
@@ -935,9 +935,10 @@ def patch_add_new_dir(sbox):
   patch_file_path = make_patch_path(sbox)
 
   # The first diff is adding 'new' with two missing dirs. The second is
-  # adding 'new' with one missing dir to a 'A' that is locally deleted
-  # (should be skipped). The third is adding 'new' with a directory that
-  # is unversioned (should be skipped as well).
+  # adding 'new' with one missing dir to a 'A/B/E' that is locally deleted
+  # (should be skipped). The third is adding 'new' to 'A/C' that is locally
+  # deleted (should be skipped too). The fourth is adding 'new' with a
+  # directory that is unversioned (should be skipped as well).
   unidiff_patch = [
     "Index: new\n",
     "===================================================================\n",
@@ -947,8 +948,14 @@ def patch_add_new_dir(sbox):
     "+new\n",
     "Index: new\n",
     "===================================================================\n",
-    "--- A/C/Y/new\t(revision 0)\n",
-    "+++ A/C/Y/new\t(revision 0)\n",
+    "--- A/B/E/Y/new\t(revision 0)\n",
+    "+++ A/B/E/Y/new\t(revision 0)\n",
+    "@@ -0,0 +1 @@\n",
+    "+new\n",
+    "Index: new\n",
+    "===================================================================\n",
+    "--- A/C/new\t(revision 0)\n",
+    "+++ A/C/new\t(revision 0)\n",
     "@@ -0,0 +1 @@\n",
     "+new\n",
     "Index: new\n",
@@ -960,22 +967,25 @@ def patch_add_new_dir(sbox):
   ]
 
   C_path = os.path.join(wc_dir, 'A', 'C')
+  E_path = os.path.join(wc_dir, 'A', 'B', 'E')
   svntest.actions.run_and_verify_svn("Deleting C failed", None, [],
                                      'rm', C_path)
+  svntest.actions.run_and_verify_svn("Deleting E failed", None, [],
+                                     'rm', E_path)
   svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
 
-  A_C_Y_new_path = os.path.join(wc_dir, 'A', 'C', 'Y', 'new')
+  A_B_E_Y_new_path = os.path.join(wc_dir, 'A', 'B', 'E', 'Y', 'new')
+  A_C_new_path = os.path.join(wc_dir, 'A', 'C', 'new')
   A_Z_new_path = os.path.join(wc_dir, 'A', 'Z', 'new')
   expected_output = [
     'A         %s\n' % os.path.join(wc_dir, 'X'),
     'A         %s\n' % os.path.join(wc_dir, 'X', 'Y'),
     'A         %s\n' % os.path.join(wc_dir, 'X', 'Y', 'new'),
-    'A         %s\n' % os.path.join(wc_dir, 'A', 'C'),
-    'A         %s\n' % os.path.join(wc_dir, 'A', 'C', 'Y'),
-    'A         %s\n' % os.path.join(wc_dir, 'A', 'C', 'Y', 'new'),
+    'Skipped missing target: \'%s\'\n' % A_B_E_Y_new_path,
+    'Skipped missing target: \'%s\'\n' % A_C_new_path,
     'Skipped missing target: \'%s\'\n' % A_Z_new_path,
     'Summary of conflicts:\n',
-    '  Skipped paths: 1\n',
+    '  Skipped paths: 3\n',
   ]
 
   # Create the unversioned obstructing directory
@@ -984,21 +994,25 @@ def patch_add_new_dir(sbox):
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({
            'X/Y/new'   : Item(contents='new\n'),
-           'A/C/Y/new' : Item(contents='new\n'),
-           'A/Z'       : Item(),
+           'A/Z'       : Item()
   })
+  expected_disk.remove('A/B/E/alpha')
+  expected_disk.remove('A/B/E/beta')
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.add({
            'X'         : Item(status='A ', wc_rev=0),
            'X/Y'       : Item(status='A ', wc_rev=0),
            'X/Y/new'   : Item(status='A ', wc_rev=0),
-           'A/C'       : Item(status='R ', wc_rev=1),
-           'A/C/Y'     : Item(status='A ', wc_rev=0),
-           'A/C/Y/new' : Item(status='A ', wc_rev=0),
+           'A/B/E'     : Item(status='D ', wc_rev=1),
+           'A/B/E/alpha': Item(status='D ', wc_rev=1),
+           'A/B/E/beta': Item(status='D ', wc_rev=1),
+           'A/C'       : Item(status='D ', wc_rev=1),
   })
 
-  expected_skip = wc.State('', {A_Z_new_path : Item() })
+  expected_skip = wc.State('', {A_Z_new_path : Item(),
+                                A_B_E_Y_new_path : Item(),
+                                A_C_new_path : Item()})
 
   svntest.actions.run_and_verify_patch(wc_dir,
                                        os.path.abspath(patch_file_path),
@@ -1089,6 +1103,10 @@ def patch_remove_empty_dirs(sbox):
   expected_disk.remove('A/B/lambda')
   expected_disk.remove('A/B/E/alpha')
   expected_disk.remove('A/B/E/beta')
+  if svntest.main.wc_is_singledb(wc_dir):
+    expected_disk.remove('A/B/E')
+    expected_disk.remove('A/B/F')
+    expected_disk.remove('A/B')
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.add({'A/D/H/chi' : Item(status='! ', wc_rev=1)})
@@ -2977,7 +2995,7 @@ test_list = [ None,
               patch_with_ignore_whitespace,
               patch_replace_locally_deleted_file,
               patch_no_eol_at_eof,
-              XFail(patch_with_properties),
+              patch_with_properties,
               patch_same_twice,
               XFail(patch_dir_properties),
               XFail(patch_add_path_with_props),

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/resolved_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/resolved_tests.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/resolved_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/resolved_tests.py Thu Aug  5 15:07:22 2010
@@ -112,6 +112,8 @@ def resolved_on_wc_root(sbox):
                        'A/B/lambda',
                        'A/B/E/alpha', 'A/B/E/beta',
                        'A/D/gamma')
+  if svntest.main.wc_is_singledb(sbox.wc_dir):
+    expected_disk.remove('A/B/E', 'A/B/F', 'A/B')
 
   expected_status = svntest.actions.get_virginal_state(wc, 2)
   expected_status.tweak('iota', 'A/B', 'A/D/gamma',

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/stat_tests.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/stat_tests.py Thu Aug  5 15:07:22 2010
@@ -39,6 +39,7 @@ Skip = svntest.testcase.Skip
 SkipUnless = svntest.testcase.SkipUnless
 XFail = svntest.testcase.XFail
 Item = svntest.wc.StateItem
+UnorderedOutput = svntest.verify.UnorderedOutput
 
 
 
@@ -180,7 +181,8 @@ def status_type_change(sbox):
         '~       iota\n',
     ]
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [], 'status')
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status')
 
   # Now change the file that is obstructing the versioned dir into an
   # unversioned dir.
@@ -220,7 +222,8 @@ def status_type_change(sbox):
         '~       iota\n',
     ]
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [], 'status')
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status')
 
   # Now change the versioned dir that is obstructing the file into an
   # unversioned dir.
@@ -235,7 +238,8 @@ def status_type_change(sbox):
         '~       iota\n',
     ]
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [], 'status')
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status')
 
 #----------------------------------------------------------------------
 
@@ -394,7 +398,7 @@ def status_nonrecursive_update_different
 
   os.chdir('A')
   svntest.actions.run_and_verify_svn(None,
-                                     expected_output,
+                                     UnorderedOutput(expected_output),
                                      [],
                                      'status', '-v', '-N', '-u', 'C')
 
@@ -406,7 +410,7 @@ def status_nonrecursive_update_different
 
   os.chdir('C')
   svntest.actions.run_and_verify_svn(None,
-                                     expected_output,
+                                     UnorderedOutput(expected_output),
                                      [],
                                      'status', '-v', '-N', '-u', '.')
 
@@ -831,8 +835,11 @@ def missing_dir_in_anchor(sbox):
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   # At one point this caused a "foo not locked" error
+  is_singledb = svntest.main.wc_is_singledb(foo_path)
   svntest.main.safe_rmtree(foo_path)
   expected_status.tweak('foo', status='! ', wc_rev='?')
+  if is_singledb:
+    expected_status.tweak('foo', entry_status='A ', entry_rev='0')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 
@@ -947,26 +954,27 @@ def status_missing_dir(sbox):
   else:
     expected = ["!       " + a_d_g + "\n"]
 
-  svntest.actions.run_and_verify_svn(None, expected, [], "status", wc_dir)
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected), [],
+                                     "status", wc_dir)
 
   if svntest.main.wc_is_singledb(wc_dir):
-    expected = svntest.verify.UnorderedOutput([
+    expected = [
           "!                1   " + a_d_g + "\n",
           "!                1   " + os.path.join(a_d_g, "rho") + "\n",
           "!                1   " + os.path.join(a_d_g, "pi") + "\n",
           "!                1   " + os.path.join(a_d_g, "tau") + "\n",
-          "Status against revision:      1\n" ])
+          "Status against revision:      1\n" ]
   else:
-    expected = svntest.verify.UnorderedOutput(
-         ["        *            " + os.path.join(a_d_g, "pi") + "\n",
+    expected = [
+          "        *            " + os.path.join(a_d_g, "pi") + "\n",
           "        *            " + os.path.join(a_d_g, "rho") + "\n",
           "        *            " + os.path.join(a_d_g, "tau") + "\n",
           "!       *       ?    " + a_d_g + "\n",
           "        *        1   " + os.path.join(wc_dir, "A", "D") + "\n",
-          "Status against revision:      1\n" ])
+          "Status against revision:      1\n" ]
 
   # now run status -u, we should be able to do this without crashing
-  svntest.actions.run_and_verify_svn(None, expected, [],
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected), [],
                                      "status", "-u", wc_dir)
 
   # Finally run an explicit status request directly on the missing directory.
@@ -981,7 +989,8 @@ def status_missing_dir(sbox):
                  for s in expected ]
   else:
     expected = ["!       " + a_d_g + "\n"]
-  svntest.actions.run_and_verify_svn(None, expected, [], "status", a_d_g)
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected), [],
+                                     "status", a_d_g)
 
 def status_add_plus_conflict(sbox):
   "status on conflicted added file"

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnrdump_tests.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnrdump_tests.py Thu Aug  5 15:07:22 2010
@@ -175,8 +175,10 @@ test_list = [ None,
               basic_dump,
               revision_0_dump,
               revision_0_load,
-              skeleton_load,
-              copy_and_modify_load,
+              XFail(XFail(skeleton_load, svntest.main.is_ra_type_dav),
+                    svntest.main.is_ra_type_svn),
+              Wimp("Need to interpret response 501", copy_and_modify_load,
+                   svntest.main.is_ra_type_dav),
               Wimp("Need to fix headers in RA layer", copy_and_modify_dump),
              ]
 

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/main.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/main.py Thu Aug  5 15:07:22 2010
@@ -277,6 +277,8 @@ def wc_is_singledb(wcpath):
   if not os.path.exists(pristine):
     return True
 
+  # Now we must be looking at a multi-db WC dir or the root dir of a
+  # single-DB WC.  Sharded 'pristine' dir => single-db, else => multi-db.
   for name in os.listdir(pristine):
     if len(name) == 2:
       return True

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/sandbox.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/sandbox.py Thu Aug  5 15:07:22 2010
@@ -133,6 +133,20 @@ class Sandbox:
     self.add_test_path(path, remove)
     return path
 
+  tempname_offs = 0 # Counter for get_tempname
+
+  def get_tempname(self, prefix='tmp'):
+    """Get a stable name for a temporary file that will be removed after
+       running the test"""
+
+    dir = self.add_wc_path('tmp')
+    if not os.path.exists(dir):
+      os.mkdir(dir)
+
+    self.tempname_offs = self.tempname_offs + 1
+
+    return os.path.join(dir, '%s-%s' % (prefix, self.tempname_offs))
+
   def cleanup_test_paths(self):
     "Clean up detritus from this sandbox, and any dependents."
     if self.dependents:

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/wc.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/wc.py Thu Aug  5 15:07:22 2010
@@ -323,6 +323,10 @@ class State:
           if item.entry_rev is not None:
             item.wc_rev = item.entry_rev
             item.entry_rev = None
+          # status might vary as well, e.g. when a directory is missing
+          if item.entry_status is not None:
+            item.status = item.entry_status
+            item.entry_status = None
       if item.writelocked:
         # we don't contact the repository, so our only information is what
         # is in the working copy. 'K' means we have one and it matches the
@@ -612,7 +616,8 @@ class StateItem:
   """
 
   def __init__(self, contents=None, props=None,
-               status=None, verb=None, wc_rev=None, entry_rev=None,
+               status=None, verb=None, wc_rev=None,
+               entry_rev=None, entry_status=None,
                locked=None, copied=None, switched=None, writelocked=None,
                treeconflict=None):
     # provide an empty prop dict if it wasn't provided
@@ -635,9 +640,10 @@ class StateItem:
     self.verb = verb
     # The base revision number of the node in the WC, as a string.
     self.wc_rev = wc_rev
-    # This one will be set when we expect the wc_rev to differ from the one
-    # found ni the entries code.
+    # These will be set when we expect the wc_rev/status to differ from those
+    # found in the entries code.
     self.entry_rev = entry_rev
+    self.entry_status = entry_status
     # For the following attributes, the value is the status character of that
     # field from 'svn status', except using value None instead of status ' '.
     self.locked = locked

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py Thu Aug  5 15:07:22 2010
@@ -567,7 +567,10 @@ def relocate_deleted_missing_copied(sbox
     'A/D2/H/omega' : Item(status='  ', wc_rev='-', copied='+'),
     'A/D2/H/psi'   : Item(status='  ', wc_rev='-', copied='+'),
     })
-  expected_status.tweak('A/B/F', status='! ', wc_rev='?')
+  if svntest.main.wc_is_singledb(wc_dir):
+    expected_status.tweak('A/B/F', status='! ', wc_rev='1')
+  else:
+    expected_status.tweak('A/B/F', status='! ', wc_rev='?')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   # Relocate
@@ -581,20 +584,28 @@ def relocate_deleted_missing_copied(sbox
 
   # Deleted and missing entries should be preserved, so update should
   # show only A/B/F being reinstated
-  expected_output = svntest.wc.State(wc_dir, {
-    'A/B/F' : Item(status='A '),
-    })
+  if svntest.main.wc_is_singledb(wc_dir):
+    expected_output = svntest.wc.State(wc_dir, {
+        'A/B/F' : Item(verb='Restored'),
+        })
+  else:
+    expected_output = svntest.wc.State(wc_dir, {
+        'A/B/F' : Item(status='A '),
+        })
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.remove('A/mu')
   expected_disk.add({
     'A/D2'       : Item(),
     'A/D2/gamma'   : Item("This is the file 'gamma'.\n"),
-    'A/D2/G'       : Item(),
     'A/D2/H'       : Item(),
     'A/D2/H/chi'   : Item("This is the file 'chi'.\n"),
     'A/D2/H/omega' : Item("This is the file 'omega'.\n"),
     'A/D2/H/psi'   : Item("This is the file 'psi'.\n"),
     })
+  if not svntest.main.wc_is_singledb(wc_dir):
+    expected_disk.add({
+        'A/D2/G'       : Item(),
+        })
   expected_status.add({
     'A/B/F'       : Item(status='  ', wc_rev='2'),
     })

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py Thu Aug  5 15:07:22 2010
@@ -5582,6 +5582,49 @@ def mergeinfo_updates_merge_with_local_m
                                      'pg', SVN_PROP_MERGEINFO, '-R',
                                      A_COPY_path)
 
+#----------------------------------------------------------------------
+# Test for receiving modified properties on added files that were originally
+# moved from somewhere else. (Triggers locate_copyfrom behavior)
+def add_moved_file_has_props(sbox):
+  """update adding moved file receives modified props"""
+  sbox.build()
+
+  wc_dir = sbox.wc_dir
+
+  G = os.path.join(os.path.join(wc_dir, 'A', 'D', 'G'))
+  pi  = os.path.join(G, 'pi')
+  G_new = os.path.join(wc_dir, 'G_new')
+
+  # Give pi some property
+  svntest.main.run_svn(None, 'ps', 'svn:eol-style', 'native', pi)
+  svntest.main.run_svn(None, 'ci', wc_dir, '-m', 'added eol-style')
+
+  svntest.actions.run_and_verify_svn(None, 'At revision 2.', [], 'up', wc_dir)
+
+  # Now move pi to a different place
+  svntest.main.run_svn(None, 'mkdir', G_new)
+  svntest.main.run_svn(None, 'mv', pi, G_new)
+  svntest.main.run_svn(None, 'ci', wc_dir, '-m', 'Moved pi to G_new')
+
+  svntest.actions.run_and_verify_svn(None, 'At revision 3.', [], 'up', wc_dir)
+
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+  expected_status.remove('A/D/G/pi')
+  expected_status.add({
+    'G_new'    : Item (status='  ', wc_rev=3),
+    'G_new/pi' : Item (status='  ', wc_rev=3),
+  })
+
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  svntest.main.run_svn(None, 'up', '-r', '0', G_new)
+  svntest.main.run_svn(None, 'up', wc_dir)
+
+  # This shouldn't show property modifications, but at r982550 it did.
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+
 #######################################################################
 # Run the tests
 
@@ -5650,6 +5693,7 @@ test_list = [ None,
               XFail(update_deleted_locked_files),
               XFail(update_empty_hides_entries),
               mergeinfo_updates_merge_with_local_mods,
+              XFail(add_moved_file_has_props),
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c Thu Aug  5 15:07:22 2010
@@ -92,8 +92,8 @@ static const char *git_tree_and_text_uni
   "Index: A/mu.moved"                                                   NL
   "===================================================================" NL
   "git --diff a/A/mu b/A/mu.moved"                                      NL
-  "move from A/mu"                                                      NL
-  "move to A/mu.moved"                                                  NL
+  "rename from A/mu"                                                    NL
+  "rename to A/mu.moved"                                                NL
   "@@ -1 +1,2 @@"                                                       NL
   " This is the file 'mu'."                                             NL
   "+some more bytes to 'mu'"                                            NL
@@ -214,6 +214,17 @@ static const char *bad_git_diff_header =
   "+## -1,2 +1,4 ##"                                                    NL
   ""                                                                    NL;
 
+  /* A unidiff containing paths with spaces. */
+  static const char *path_with_spaces_unidiff =
+  "git --diff a/path 1 b/path 1"                                        NL
+  "new file mode 100644"                                                NL
+  "git --diff a/path one 1 b/path one 1"                                NL
+  "new file mode 100644"                                                NL
+  "git --diff a/dir/ b/path b/dir/ b/path"                              NL
+  "new file mode 100644"                                                NL
+  "git --diff a/ b/path 1 b/ b/path 1"                                  NL
+  "new file mode 100644"                                                NL;
+
 
 /* Create a PATCH_FILE with name FNAME containing the contents of DIFF. */
 static svn_error_t *
@@ -788,6 +799,59 @@ test_parse_diff_symbols_in_prop_unidiff(
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_git_diffs_with_spaces_diff(apr_pool_t *pool)
+{
+  apr_file_t *patch_file;
+  svn_patch_t *patch;
+  const char *fname = "test_git_diffs_with_spaces_diff.patch";
+
+  SVN_ERR(create_patch_file(&patch_file, fname, path_with_spaces_unidiff,
+                            pool));
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "path 1"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "path 1"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+  
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "path one 1"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "path one 1"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_DBG(("%s\n", patch->old_filename));
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "dir/ b/path"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "dir/ b/path"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, " b/path 1"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, " b/path 1"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+
+  return SVN_NO_ERROR;
+}
 /* ========================================================================== */
 
 struct svn_test_descriptor_t test_funcs[] =
@@ -807,5 +871,7 @@ struct svn_test_descriptor_t test_funcs[
                    "test property and text unidiff parsing"),
     SVN_TEST_PASS2(test_parse_diff_symbols_in_prop_unidiff,
                    "test property diffs with odd symbols"),
+    SVN_TEST_PASS2(test_git_diffs_with_spaces_diff,
+                   "test git diffs with spaces in paths"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/issue-2779-dev/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/libsvn_wc/pristine-store-test.c?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/libsvn_wc/pristine-store-test.c Thu Aug  5 15:07:22 2010
@@ -162,7 +162,7 @@ pristine_write_read(const svn_test_opts_
     svn_boolean_t present;
 
     SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1,
-                                      svn_wc__db_checkmode_usable, pool));
+                                      pool));
     SVN_ERR_ASSERT(! present);
   }
 
@@ -175,7 +175,7 @@ pristine_write_read(const svn_test_opts_
     svn_boolean_t present;
 
     SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1,
-                                      svn_wc__db_checkmode_usable, pool));
+                                      pool));
     SVN_ERR_ASSERT(present);
   }
 
@@ -220,7 +220,7 @@ pristine_write_read(const svn_test_opts_
     svn_boolean_t present;
 
     SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1,
-                                      svn_wc__db_checkmode_usable, pool));
+                                      pool));
     SVN_ERR_ASSERT(! present);
   }
 

Modified: subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn?rev=982653&r1=982652&r2=982653&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn Thu Aug  5 15:07:22 2010
@@ -129,7 +129,7 @@ nuke:
 			yes)    echo "You said $$ANSWER. I will continue."; \
 				echo rm -rf $(SRCDIR) $(OBJDIR) $(PREFIX); \
 				rm -rf $(SRCDIR) $(OBJDIR) $(PREFIX); \
-				echo "Remember to reset the build!"; \
+				$(MAKE) reset; \
 				;; \
 			"")     echo "You said no."; \
 				;; \