You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2014/12/16 19:51:45 UTC

svn commit: r1646043 - in /subversion/trunk/subversion: libsvn_client/patch.c tests/cmdline/patch_tests.py

Author: philip
Date: Tue Dec 16 18:51:45 2014
New Revision: 1646043

URL: http://svn.apache.org/r1646043
Log:
* subversion/libsvn_client/patch.c
  (get_hunk_info): Add comment with question.

* subversion/tests/cmdline/patch_tests.py
  (patch_delete_modified): Extend.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/tests/cmdline/patch_tests.py

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1646043&r1=1646042&r2=1646043&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Dec 16 18:51:45 2014
@@ -1710,7 +1710,9 @@ get_hunk_info(hunk_info_t **hi, patch_ta
               modified_start = svn_diff_hunk_get_modified_start(hunk);
               if (modified_start == 0)
                 {
-                  /* Patch wants to delete the file. */
+                  /* Patch wants to delete the file.
+
+                     ### locally_deleted is always false here? */
                   already_applied = target->locally_deleted;
                 }
               else

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1646043&r1=1646042&r2=1646043&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Tue Dec 16 18:51:45 2014
@@ -5044,7 +5044,20 @@ def patch_delete_modified(sbox):
                                        expected_output, expected_disk,
                                        expected_status, expected_skip)
 
-  # With modifed beta, we get a text conflict.
+  # Third application, with file present even though state is 'D', also skips
+  sbox.simple_append('A/B/E/beta', 'Modified', truncate=True)
+  expected_disk.add({'A/B/E/beta' : Item(contents='Modified')})
+  expected_output = [
+    'Skipped \'%s\'\n' % sbox.ospath('A/B/E/beta'),
+  ] + svntest.main.summary_of_conflicts(skipped_paths=1)
+  expected_skip = wc.State('', {
+    sbox.ospath('A/B/E/beta') :  Item(verb='Skipped'),
+  })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  # Revert and modify beta, fourth application gives a text conflict.
   sbox.simple_revert('A/B/E/beta')
   sbox.simple_append('A/B/E/beta', 'Modified', truncate=True)
 
@@ -5059,9 +5072,7 @@ def patch_delete_modified(sbox):
     "@@ -1,1 +0,0 @@\n",
     "-This is the file 'beta'.\n",
   ]
-  expected_disk.add({'A/B/E/beta'
-                     : Item(contents='Modified'),
-                     'A/B/E/beta.svnpatch.rej'
+  expected_disk.add({'A/B/E/beta.svnpatch.rej'
                      : Item(contents=''.join(reject_file_contents))
                      })
   expected_status.tweak('A/B/E/beta', status='M ')