subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1688987 - in /subversion/branches/move-tracking-2/subversion/tests/cmdline: svnmover_tests.py svntest/wc.py
Date Fri, 03 Jul 2015 09:58:27 GMT
Author: philip
Date: Fri Jul  3 09:58:27 2015
New Revision: 1688987

URL: http://svn.apache.org/r1688987
Log:
* build/ac-macros/apache.m4 (SVN_FIND_APACHE): Use two separate -e as some
   platforms (e.g Solaris) do not support separating with a semi-colon.

Modified:
    subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py?rev=1688987&r1=1688986&r2=1688987&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py Fri Jul
 3 09:58:27 2015
@@ -1356,12 +1356,10 @@ def merge_swap_abc(sbox):
   test_svnmover3(sbox, '', None, expected_eids,
                  'branch X Y')
 
-  expected_eids.tweak('X/A', eid=6)
-  expected_eids.tweak('X/A/B/C', eid=3)
-  expected_eids.remove('X/A/a1', 'X/A/B/C/c1')
-  expected_eids.add({
-    'X/A/c1'     : Item(eid=7),
-    'X/A/B/C/a1' : Item(eid=4),
+  expected_eids.rename({
+    'X/A/B/C' : 'X/A',
+    'X/A/B'   : 'X/A/B',
+    'X/A'     : 'X/A/B/C',
   })
   test_svnmover3(sbox, '',
                  reported_br_diff('X') +
@@ -1374,12 +1372,10 @@ def merge_swap_abc(sbox):
                  'mv X/A X/C/B/C ' +
                  'mv X/C X/A')
 
-  expected_eids.tweak('Y/A', eid=6)
-  expected_eids.tweak('Y/A/B/C', eid=3)
-  expected_eids.remove('Y/A/a1', 'Y/A/B/C/c1')
-  expected_eids.add({
-    'Y/A/c1'     : Item(eid=7),
-    'Y/A/B/C/a1' : Item(eid=4),
+  expected_eids.rename({
+    'Y/A'     : 'Y/A/B/C',
+    'Y/A/B'   : 'Y/A/B',
+    'Y/A/B/C' : 'Y/A',
   })
   test_svnmover3(sbox, '',
                  reported_br_diff('Y') +

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py?rev=1688987&r1=1688986&r2=1688987&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py Fri Jul  3
09:58:27 2015
@@ -216,6 +216,30 @@ class State:
       if list(filter(path, item)):
         item.tweak(**kw)
 
+  def rename(self, moves):
+    """Change the path of some items.
+
+    MOVES is a dictionary mapping source path to destination
+    path. Children move with moved parents.  All subtrees are moved in
+    reverse depth order to temporary storage before being moved in
+    depth order to the final location.  This allows nested moves.
+
+    """
+    temp = {}
+    for src, dst in sorted(moves.items(), key=lambda (src, dst): src)[::-1]:
+      temp[src] = {}
+      for path, item in self.desc.items():
+        if path == src or path[:len(src) + 1] == src + '/':
+          temp[src][path] = item;
+          del self.desc[path]
+    for src, dst in sorted(moves.items(), key=lambda (src, dst): dst):
+      for path, item in temp[src].items():
+        if path == src:
+          new_path = dst
+        else:
+          new_path = dst + path[len(src):]
+        self.desc[new_path] = item
+
   def subtree(self, subtree_path):
     """Return a State object which is a deep copy of the sub-tree
     beneath SUBTREE_PATH (which is assumed to be rooted at the tree of



Mime
View raw message