[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Fix issue #877 - work around in test suite bug

From: Marcos Chaves <mchvs_at_hotmail.com>
Date: 2004-08-04 21:35:37 CEST

Fix issue #877 by adding regular expression for the 'Restored' output
from 'svn update'.

* update_tests.py
   (update_missing): Fixed commented out test cases.

* tree.py
   (build_tree_from_checkout): Regular expression for 'Restored'
   during 'svn update' added.

Index: update_tests.py
===================================================================
--- update_tests.py (revision 10462)
+++ update_tests.py (working copy)
@@ -310,10 +310,9 @@
   E_path = os.path.join(wc_dir, 'A', 'B', 'E')
   H_path = os.path.join(wc_dir, 'A', 'D', 'H')

- ### FIXME run_and_verify_update doesn't appear to understand 'Restored'
- ### feedback
- #os.remove(mu_path)
- #os.remove(rho_path)
+ # remove two files to verify if they will be restored
+ os.remove(mu_path)
+ os.remove(rho_path)

   ### FIXME I think directories work because they generate 'A'
   ### feedback, is this the correct feedback?
@@ -322,8 +321,8 @@

   # Create expected output tree for an update of the missing items by name
   expected_output = svntest.wc.State(wc_dir, {
- #'A/mu' : Item(status='A '),
- #'A/D/G/rho' : Item(status='A '),
+ 'A/mu' : Item(verb='Restored'),
+ 'A/D/G/rho' : Item(verb='Restored'),
     'A/B/E' : Item(status='A '),
     'A/B/E/alpha' : Item(status='A '),
     'A/B/E/beta' : Item(status='A '),
Index: svntest/tree.py
===================================================================
--- svntest/tree.py (revision 10462)
+++ svntest/tree.py (working copy)
@@ -104,8 +104,10 @@
# depending on the parsing context:

# - in the 'svn co/up' use-case, each line of output starts with two
-# characters from the set of (A, D, G, U, C, _). This status code
-# is stored in a attribute named 'status'.
+# characters from the set of (A, D, G, U, C, _) or 'Restored'. The
+# status code is stored in a attribute named 'status'. In the case
+# of a restored file, the word 'Restored' is stored in a attribute
+# named 'verb'.

# - in the 'svn ci/im' use-case, each line of output starts with one
# of the words (Adding, Deleting, Sending). This verb is stored in
@@ -561,14 +563,21 @@
   "Return a tree derived by parsing the output LINES from 'co' or 'up'."

   root = SVNTreeNode(root_node_name)
- rm = re.compile ('^([MAGCUD_ ][MAGCUD_ ])\s+(.+)')
+ rm1 = re.compile ('^([MAGCUD_ ][MAGCUD_ ])\s+(.+)')
+ rm2 = re.compile ('^(\w+)\s+\'(.+)\'')

   for line in lines:
- match = rm.search(line)
+ match = rm1.search(line)
     if match and match.groups():
       new_branch = create_from_path(match.group(2), None, {},
                                     {'status' : match.group(1)})
       root.add_child(new_branch)
+ else:
+ match = rm2.search(line)
+ if match and match.groups():
+ new_branch = create_from_path(match.group(2), None, {},
+ {'verb' : match.group(1)})
+ root.add_child(new_branch)

   return root

_________________________________________________________________
MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 4 21:35:55 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.