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

Re: [PATCH]: SWIG/Python interface bug

From: Marshall White <cscidork_at_yahoo.com>
Date: 2003-02-02 03:45:44 CET

--- Marshall White <cscidork@yahoo.com> wrote:
> At the bottom of this email is the patch for the bug I wrote about in my last email.
> Here is a before and after:
> mwhite@big-dog:/storage/code/python# ./py_broke.py /home/svnrepos /trunk
> commit date = `_60141a08_p_char`
> commit author = `_f0371a08_p_char`
> mwhite@big-dog:/storage/code/python# ./py_broke.py /home/svnrepos /trunk
> commit date = `2003-01-31T04:46:32.052521Z`
> commit author = `mwhite`
> Comments/suggestions?
> Marshall

I still think my patch is okay, but my original test script wasn't great.

For those of you who tried it (if anyone did), it leaves open transactions in your repository.
Thank goodness for "svnadmin."

Here is the updated test script.


#!/usr/bin/env python
# SVN SWIG Python interface test:
# Tests the interface with functions that have const char ** arguments.
# The argument should be a return value of a Python string.

import os
import sys

from svn import fs, util, repos

def test_this(pool, ctx):
  t_repos = repos.svn_repos_open(ctx.repospath, pool)
  t_fs = repos.svn_repos_fs(t_repos)

  rev = fs.youngest_rev(t_fs, pool)
  txn = fs.begin_txn(t_fs, rev, pool)
  root = fs.txn_root(txn, pool)

  cr, cd, la = repos.svn_repos_get_committed_info(root, ctx.filepath, pool)
  txn_name = fs.txn_name(txn, pool)

  # Be sure to abort the transaction before exiting.

  print 'commit date = `%s`' % cd
  print 'commit author = `%s`' % la
  print 'trxn name = `%s`' % txn_name

class _ctx:

def usage(ctx):
  print 'USAGE: %s svn-repos-path repos-file' % os.path.basename(sys.argv[0])
  print ' svn-repos-path - A path to a valid repository'
  print ' repos-file - A path to a file in that repository'

def main():
  # prepare the operation context
  ctx = _ctx()

  if len(sys.argv) != 3:

  ctx.repospath = sys.argv[1]
  ctx.filepath = sys.argv[2]

  util.run_app(test_this, ctx)

if __name__ == '__main__':

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 2 03:46:26 2003

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