subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1609003 - in /subversion/branches/1.8.x: ./ STATUS subversion/bindings/swig/python/tests/client.py subversion/bindings/swig/svn_client.i
Date Wed, 09 Jul 2014 04:00:18 GMT
Author: svn-role
Date: Wed Jul  9 04:00:17 2014
New Revision: 1609003

URL: http://svn.apache.org/r1609003
Log:
Merge the r1594794 group from trunk:

 * r1594794, r1594814, r1594834, r1595061
   Fix the notify_func callbacks in Python bindings.
   Justification:
     Slightly broken implementation made them impossible to use.
   Votes:
     +1: breser, philip
     +0: rhuijben

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/bindings/swig/python/tests/client.py
    subversion/branches/1.8.x/subversion/bindings/swig/svn_client.i

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1594794,1594814,1594834,1595061

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1609003&r1=1609002&r2=1609003&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Jul  9 04:00:17 2014
@@ -220,14 +220,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1594794, r1594814, r1594834, r1595061
-   Fix the notify_func callbacks in Python bindings.
-   Justification:
-     Slightly broken implementation made them impossible to use.
-   Votes:
-     +1: breser, philip
-     +0: rhuijben
-
  * r1594156
    Fix a problem with the Unix build that could result in linking to the wrong
    Subversion libraries at build time or at run time.

Modified: subversion/branches/1.8.x/subversion/bindings/swig/python/tests/client.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/python/tests/client.py?rev=1609003&r1=1609002&r2=1609003&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/python/tests/client.py (original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/python/tests/client.py Wed Jul  9 04:00:17
2014
@@ -437,6 +437,68 @@ class SubversionClientTestCase(unittest.
                      self.proplist_receiver_dir1, self.client_ctx)
     self.assertEquals(self.proplist_receiver_dir1_calls, 1)
 
+  def test_update4(self):
+    """Test update and the notify function callbacks"""
+
+    rev = core.svn_opt_revision_t()
+    rev.kind = core.svn_opt_revision_number
+    rev.value.number = 0
+
+    path = self.temper.alloc_empty_dir('-update')
+
+    self.assertRaises(ValueError, client.checkout2,
+                      self.repos_uri, path, None, None, True, True,
+                      self.client_ctx)
+
+    client.checkout2(self.repos_uri, path, rev, rev, True, True,
+            self.client_ctx)
+
+    def notify_func(path, action, kind, mime_type, content_state, prop_state, rev):
+        self.notified_paths.append(path)
+
+    self.client_ctx.notify_func = client.svn_swig_py_notify_func
+    self.client_ctx.notify_baton = notify_func
+    rev.value.number = 1
+    self.notified_paths = []
+    client.update4((path,), rev, core.svn_depth_unknown, True, False, False,
+                   False, False, self.client_ctx)
+    expected_paths = [
+        path,
+        os.path.join(path, 'branches'),
+        os.path.join(path, 'tags'),
+        os.path.join(path, 'trunk'),
+        path,
+        path
+    ]
+    # All normal subversion apis process paths in Subversion's canonical format,
+    # which isn't the platform specific format
+    expected_paths = [x.replace(os.path.sep, '/') for x in expected_paths]
+    self.notified_paths.sort()
+    expected_paths.sort()
+
+    self.assertEquals(self.notified_paths, expected_paths)
+
+    def notify_func2(notify, pool):
+        self.notified_paths.append(notify.path)
+
+    self.client_ctx.notify_func2 = client.svn_swig_py_notify_func2
+    self.client_ctx.notify_baton2 = notify_func2
+    rev.value.number = 2
+    self.notified_paths = []
+    expected_paths = [
+        path,
+        os.path.join(path, 'trunk', 'README.txt'),
+        os.path.join(path, 'trunk'),
+        path,
+        path
+    ]
+    expected_paths = [x.replace(os.path.sep, '/') for x in expected_paths]
+    client.update4((path,), rev, core.svn_depth_unknown, True, False, False,
+                   False, False, self.client_ctx)
+    self.notified_paths.sort()
+    expected_paths.sort()
+    self.assertEquals(self.notified_paths, expected_paths)
+
 
 def suite():
     return unittest.defaultTestLoader.loadTestsFromTestCase(

Modified: subversion/branches/1.8.x/subversion/bindings/swig/svn_client.i
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/svn_client.i?rev=1609003&r1=1609002&r2=1609003&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/svn_client.i (original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/svn_client.i Wed Jul  9 04:00:17 2014
@@ -385,7 +385,8 @@ Callback: svn_client_diff_summarize_func
 /* provide Python with access to some thunks. */
 %constant svn_cancel_func_t svn_swig_py_cancel_func;
 %constant svn_client_get_commit_log3_t svn_swig_py_get_commit_log_func;
-%constant svn_wc_notify_func2_t svn_swig_py_notify_func;
+%constant svn_wc_notify_func_t svn_swig_py_notify_func;
+%constant svn_wc_notify_func2_t svn_swig_py_notify_func2;
 
 #endif
 



Mime
View raw message