subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1544688 - /subversion/trunk/subversion/tests/cmdline/stat_tests.py
Date Fri, 22 Nov 2013 21:29:34 GMT
Author: rhuijben
Date: Fri Nov 22 21:29:33 2013
New Revision: 1544688

URL: http://svn.apache.org/r1544688
Log:
Following up on r1544597, add another test that covers a similar case that
shows that the moved_to detection code for the root of status appears to
work when a completely unrelated BASE node exists.

The only problem is that it shows moves from different layers than when the
node is not the root of the status walk.

* cmdline/stat_tests.py
  (status_move_missing_direct_base): New function.
  (test_list): Add status_move_missing_direct_base.

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

Modified: subversion/trunk/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/stat_tests.py?rev=1544688&r1=1544687&r2=1544688&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/stat_tests.py Fri Nov 22 21:29:33 2013
@@ -2151,12 +2151,63 @@ def status_move_missing_direct(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'status',
                                      sbox.ospath('ZB'), '--depth', 'immediates')
 
-  # And calling svn status on just 'ZB/E' should have the same result for this node     
                               
-  expected_output.pop(0)                                     
-  expected_output.pop(0)
+  # And calling svn status on just 'ZB/E' should have the same result for this node
+  # except that we calculate the relative path from a different base
+  expected_output = [
+    'D  +    %s\n' % sbox.ospath('ZB/E'),
+    '        > moved to %s\n' % os.path.join('..', '..', 'Z', 'B', 'E'),
+  ]
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'status',
                                      sbox.ospath('ZB/E'), '--depth', 'empty')
 
+def status_move_missing_direct_base(sbox):
+  "move when status is called directly with base"
+  
+  sbox.build()
+  sbox.simple_copy('A', 'Z')
+  sbox.simple_mkdir('Q')
+  sbox.simple_mkdir('Q/ZB')
+  sbox.simple_mkdir('Q/ZB/E')
+  sbox.simple_commit('')
+  sbox.simple_update('')
+  
+  sbox.simple_rm('Q')
+  sbox.simple_mkdir('Q')
+  
+  sbox.simple_move('Z', 'ZZ')
+  sbox.simple_move('A', 'Z')
+  sbox.simple_move('Z/B', 'Q/ZB')
+  sbox.simple_mkdir('Z/B')
+  sbox.simple_move('Q/ZB/E', 'Z/B/E')
+
+  # Somehow 'svn status' now shows different output for 'Q/ZB/E'
+  # when called directly and via an ancestor, as this handles
+  # multi-layer in a different way
+  
+  # Note that the status output may change over different Subversion revisions,
+  # but the status on a node should be identical anyway 'svn status' is called
+  # on it.
+  
+  # This test had a different result as status_move_missing_direct at the time of
+  # writing this test.
+  
+  expected_output = [
+    'A  +    %s\n' % sbox.ospath('Q/ZB'),
+    '        > moved from %s\n' % os.path.join('..', '..', 'Z', 'B'),
+    'D  +    %s\n' % sbox.ospath('Q/ZB/E'),
+    '        > moved to %s\n' % os.path.join('..', '..', 'Z', 'B', 'E'),
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [], 'status',
+                                     sbox.ospath('Q/ZB'), '--depth', 'immediates')
+
+  # And calling svn status on just 'ZB/E' should have the same result for this node,
+  # except that the moved_to information is calculated from the node itself
+  expected_output = [
+    'D  +    %s\n' % sbox.ospath('Q/ZB/E'),
+    '        > moved to %s\n' % os.path.join('..', '..', '..', 'Z', 'B', 'E'),
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [], 'status',
+                                     sbox.ospath('Q/ZB/E'), '--depth', 'empty')
 
 ########################################################################
 # Run the tests
@@ -2207,6 +2258,7 @@ test_list = [ None,
               move_update_timestamps,
               status_path_handling,
               status_move_missing_direct,
+              status_move_missing_direct_base,
              ]
 
 if __name__ == '__main__':



Mime
View raw message