~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/swig/python/svn/core.py

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import libsvn.core as _libsvncore
28
28
import atexit as _atexit
29
29
import sys
30
 
__all__ = [
31
 
  # Symbols that 'import *' used to pull (in 1.7)
32
 
  'Pool',
33
 
  'SVNSYNC_PROP_CURRENTLY_COPYING',
34
 
  'SVNSYNC_PROP_FROM_URL',
35
 
  'SVNSYNC_PROP_FROM_UUID',
36
 
  'SVNSYNC_PROP_LAST_MERGED_REV',
37
 
  'SVNSYNC_PROP_LOCK',
38
 
  'SVNSYNC_PROP_PREFIX',
39
 
  'SubversionException',
40
 
  # 'apr_array_header_t',
41
 
  # 'apr_file_open_stderr',
42
 
  # 'apr_file_open_stdout',
43
 
  # 'apr_file_t',
44
 
  # 'apr_hash_t',
45
 
  # 'apr_initialize',
46
 
  # 'apr_pool_clear',
47
 
  # 'apr_pool_destroy',
48
 
  # 'apr_pool_t',
49
 
  # 'apr_terminate',
50
 
  # 'apr_time_ansi_put',
51
 
  # 'run_app',
 
30
# __all__ is defined later, since some svn_* functions are implemented below.
52
31
 
53
 
  # Symbols defined explicitly below.
54
 
  'SVN_IGNORED_REVNUM',
55
 
  'SVN_INVALID_REVNUM',
56
 
  'svn_path_compare_paths',
57
 
  'svn_mergeinfo_merge',
58
 
  'svn_mergeinfo_sort',
59
 
  'svn_rangelist_merge',
60
 
  'svn_rangelist_reverse',
61
 
  # 'Stream',
62
 
  # 'apr_initialize',
63
 
  # 'apr_terminate',
64
 
  'svn_pool_create',
65
 
  'svn_pool_destroy',
66
 
  'svn_pool_clear',
67
 
]
68
32
 
69
33
class SubversionException(Exception):
70
34
 
205
169
    self._stream = stream
206
170
 
207
171
  def read(self, amt=None):
 
172
    if self._stream is None:
 
173
      raise ValueError
208
174
    if amt is None:
209
175
      # read the rest of the stream
210
176
      chunks = [ ]
219
185
    return svn_stream_read(self._stream, int(amt))
220
186
 
221
187
  def write(self, buf):
 
188
    if self._stream is None:
 
189
      raise ValueError
222
190
    ### what to do with the amount written? (the result value)
223
191
    svn_stream_write(self._stream, buf)
224
192
 
 
193
  def close(self):
 
194
    if self._stream is not None:
 
195
      svn_stream_close(self._stream)
 
196
      self._stream = None
 
197
 
225
198
def secs_from_timestr(svn_datetime, pool=None):
226
199
  """Convert a Subversion datetime string into seconds since the Epoch."""
227
200
  aprtime = svn_time_from_cstring(svn_datetime, pool)
343
316
  performed as the function exits (normally or via an exception).
344
317
  '''
345
318
  return func(application_pool, *args, **kw)
 
319
 
 
320
# Currently, this excludes:
 
321
# 'FALSE' 'TRUE'
 
322
# 'apr_array_header_t' 'apr_file_t' 'apr_hash_t'
 
323
# 'apr_file_open_stderr' 'apr_file_open_stdout'
 
324
# 'apr_initialize' 'apr_terminate'
 
325
# 'apr_pool_clear' 'apr_pool_destroy' 'apr_pool_t'
 
326
# 'apr_time_ansi_put'
 
327
# 'run_app'
 
328
# 'svn_relpath__internal_style' 'svn_uri__is_ancestor'
 
329
# 'svn_tristate__from_word' 'svn_tristate__to_word'
 
330
__all__ = filter(lambda s: (s.startswith('svn_')
 
331
                            or s.startswith('SVN_')
 
332
                            or s.startswith('SVNSYNC_')
 
333
                            or s in ('Pool', 'SubversionException'))
 
334
                           and '__' not in s,
 
335
                 locals())
 
336