You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/02/21 18:02:35 UTC

svn commit: r1570637 - /subversion/trunk/subversion/tests/cmdline/diff_tests.py

Author: rhuijben
Date: Fri Feb 21 17:02:35 2014
New Revision: 1570637

URL: http://svn.apache.org/r1570637
Log:
* subversion/tests/cmdline/diff_tests.py
  (diff_switched_file): Add regression test on switched file behavior.
  (test_list): Add test.

Modified:
    subversion/trunk/subversion/tests/cmdline/diff_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=1570637&r1=1570636&r2=1570637&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Fri Feb 21 17:02:35 2014
@@ -4809,6 +4809,45 @@ def diff_repo_repo_added_file_mime_type(
     svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
                                        '-r2:1', newfile)
 
+def diff_switched_file(sbox):
+  "diff a switched file against repository"
+
+  sbox.build()
+  svntest.actions.run_and_verify_svn(None, None, [], 'switch',
+                                     sbox.repo_url + '/A/mu',
+                                     sbox.ospath('iota'), '--ignore-ancestry')
+  sbox.simple_append('iota', 'Mu????')
+
+  # This diffs the file against its origin
+  expected_output = [
+    'Index: %s\n' % sbox.path('iota'),
+    '===================================================================\n',
+    '--- %s\t(.../A/mu)\t(revision 1)\n' % sbox.path('iota'),
+    '+++ %s\t(.../iota)\t(working copy)\n' % sbox.path('iota'),
+    '@@ -1 +1,2 @@\n',
+    ' This is the file \'mu\'.\n',
+    '+Mu????\n',
+    '\ No newline at end of file\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', '-r', '1', sbox.ospath('iota'))
+
+  # And this undoes the switch for the diff
+  expected_output = [
+    'Index: %s\n' % sbox.path('iota'),
+    '===================================================================\n',
+    '--- %s\t(revision 1)\n' % sbox.path('iota'),
+    '+++ %s\t(working copy)\n' % sbox.path('iota'),
+    '@@ -1 +1,2 @@\n',
+    '-This is the file \'iota\'.\n',
+    '+This is the file \'mu\'.\n',
+    '+Mu????\n',
+    '\ No newline at end of file\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', '-r', '1', sbox.ospath(''))
+
+
 ########################################################################
 #Run the tests
 
@@ -4894,6 +4933,7 @@ test_list = [ None,
               diff_repo_wc_copies,
               diff_repo_wc_file_props,
               diff_repo_repo_added_file_mime_type,
+              diff_switched_file,
               ]
 
 if __name__ == '__main__':