subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1445105 - /subversion/trunk/subversion/tests/cmdline/diff_tests.py
Date Tue, 12 Feb 2013 11:24:28 GMT
Author: rhuijben
Date: Tue Feb 12 11:24:27 2013
New Revision: 1445105

URL: http://svn.apache.org/r1445105
Log:
* subversion/tests/cmdline/diff_tests.py
  (local_tree_replace): Add new test verifying the ordering constraints of a
    notice ancestry diff against a revision. Currently marked XFail
  (test_list): Add local_tree_replace.

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=1445105&r1=1445104&r2=1445105&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Tue Feb 12 11:24:27 2013
@@ -4298,6 +4298,99 @@ def simple_ancestry(sbox):
                                         '--show-copies-as-adds',
                                         '--no-diff-added')
 
+@XFail()
+def local_tree_replace(sbox):
+  "diff a replaced tree"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_add_text('extra', 'A/B/F/extra')
+  sbox.simple_commit()
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'rm', '--keep-local',
+                                     sbox.ospath('A/B'))
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'add', sbox.ospath('A/B'))
+
+  # By default we ignore ancestry, so there are no differences against r1
+  expected_output = []
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', wc_dir,
+                                     '-r', '2',
+                                     '--show-copies-as-adds')
+  # Note that 'svn diff' without revision diffs against pristine, which would
+  # would show differences!
+
+  # And now check with ancestry
+
+  line = '===================================================================\n'
+
+  expected_output = svntest.verify.UnorderedOutput([
+    'Index: %s (deleted)\n' % sbox.path('A/B/lambda'),
+    line,
+    'Index: %s (deleted)\n' % sbox.path('A/B/E/alpha'),
+    line,
+    'Index: %s (deleted)\n' % sbox.path('A/B/E/beta'),
+    line,
+    'Index: %s (deleted)\n' % sbox.path('A/B/F/extra'),
+    line,
+    'Index: %s (added)\n' % sbox.path('A/B/lambda'),
+    line,
+    'Index: %s (added)\n' % sbox.path('A/B/E/alpha'),
+    line,
+    'Index: %s (added)\n' % sbox.path('A/B/E/beta'),
+    line,
+    'Index: %s (added)\n' % sbox.path('A/B/F/extra'),
+    line,
+  ])
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', wc_dir,
+                                     '-r', '2',
+                                     '--notice-ancestry',
+                                     '--show-copies-as-adds',
+                                     '--no-diff-added',
+                                     '--no-diff-deleted')
+
+  # Now create patches to verify the tree ordering
+  patch = os.path.abspath(os.path.join(wc_dir, 'ancestry.patch'))
+
+  cwd = os.getcwd()
+  os.chdir(wc_dir)
+  _, out, _ = svntest.actions.run_and_verify_svn(None, None, [],
+                                                 'diff', '.',
+                                                 '-r', '2',
+                                                 '--notice-ancestry',
+                                                 '--show-copies-as-adds')
+  svntest.main.file_append(patch, ''.join(out))
+  os.chdir(cwd)
+
+  # And try to apply it
+  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
+
+  expected_output = svntest.verify.UnorderedOutput([
+    'D         %s\n' % sbox.ospath('A/B/F/extra'),
+    'D         %s\n' % sbox.ospath('A/B/F'),
+    'D         %s\n' % sbox.ospath('A/B/E/beta'),
+    'D         %s\n' % sbox.ospath('A/B/E/alpha'),
+    'D         %s\n' % sbox.ospath('A/B/E'),
+    'D         %s\n' % sbox.ospath('A/B'),
+    'A         %s\n' % sbox.ospath('A/B'),
+    'A         %s\n' % sbox.ospath('A/B/lambda'),
+    'A         %s\n' % sbox.ospath('A/B/F'),
+    'A         %s\n' % sbox.ospath('A/B/F/extra'),
+    'A         %s\n' % sbox.ospath('A/B/E'),
+    'A         %s\n' % sbox.ospath('A/B/E/beta'),
+    'A         %s\n' % sbox.ospath('A/B/E/alpha'),
+    'A         %s\n' % sbox.ospath('A/B/lambda'),
+  ])
+  # And this currently fails because the ordering is broken, but also
+  # because it hits an issue in 'svn patch'
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'patch', patch, wc_dir)
+
 
 ########################################################################
 #Run the tests
@@ -4374,6 +4467,7 @@ test_list = [ None,
               diff_arbitrary_same,
               diff_git_format_wc_wc_dir_mv,
               simple_ancestry,
+              local_tree_replace,
               ]
 
 if __name__ == '__main__':



Mime
View raw message