Commit b779f8ad authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 1.5.0dfsg

parent 78ea107a
......@@ -19,13 +19,25 @@ for line in file( version_details ):
key, value = [s.strip() for s in line.split('=',1)]
branding_info[ key ] = value
build_revision = os.popen( 'svnversion -c "%s" 2>&1' % os.environ.get( 'PYSVN_EXPORTED_FROM', '..' ), 'r' ).read().strip()
svnversion_image = os.environ.get( 'PYSVN_SVNVERSION', 'svnversion' )
if ' ' in svnversion_image:
cmd = ('"%s" -c "%s" 2>&1' %
(svnversion_image
,os.environ.get( 'PYSVN_EXPORTED_FROM', '..' )))
else:
cmd = ('%s -c "%s" 2>&1' %
(svnversion_image
,os.environ.get( 'PYSVN_EXPORTED_FROM', '..' )))
print 'Info: Running %s' % cmd
build_revision = os.popen( cmd, 'r' ).read().strip()
# build_revision is either a range nnn:mmm or mmm
# we only want the mmm
build_revision = build_revision.split(':')[-1]
print 'Info: revision %s' % build_revision
if build_revision.find( 'exported' ) >= 0:
if build_revision[0] not in '0123456789':
branding_info['BUILD'] = '0'
else:
revision, modifiers = re.compile( '(\d+)(.*)' ).search( build_revision ).groups()
......
......@@ -16,10 +16,11 @@ rem in development the version info can be found
rem otherwise the builder will have run it already
set COMPILER=msvc60
if "%PY_MIN%" == "4" set COMPILER=msvc71
if "%PY_MIN%" == "5" set COMPILER=msvc71
if exist ..\..\ReleaseEngineering\win32-%COMPILER%\software-versions.cmd call ..\..\ReleaseEngineering\win32-%COMPILER%\software-versions.cmd off
set PYCXX=%WORKDIR%\Import\pycxx_%PYCXX_VER%
set PYCXX=%WORKDIR%\Import\pycxx-%PYCXX_VER%
set OPENSSL=%TARGET%\openssl-%OPENSSL_VER%
set SUBVERSION=%TARGET%\subversion-%SVN_VER%
set APR=%SUBVERSION%
......
......@@ -9,7 +9,7 @@ clean: ../Source/Makefile
rm -rf ../Kit/Linux/tmp
../Source/Makefile: ../Source/setup.py
cd ../Source && $(PYTHON) setup.py configure
cd ../Source && $(PYTHON) setup.py configure $(CONFIG_ARGS)
kit:
......
......@@ -8,7 +8,7 @@ clean: ../Source/Makefile
cd ../Tests && $(MAKE) clean
../Source/Makefile: ../Source/setup.py
cd ../Source && $(PYTHON) setup.py configure
cd ../Source && $(PYTHON) setup.py configure $(CONFIG_ARGS)
kit:
cd ../Kit/MacOSX && $(PYTHON) make_pkg.py
......
MAJOR=1
MINOR=4
PATCH=2
MINOR=5
PATCH=0
BUILD=0
......@@ -164,6 +164,9 @@ class XhtmlParser:
elif child.nodeType == xml.dom.minidom.Node.ELEMENT_NODE:
debug( '__extractText ELEMENT_NODE %r' % child.nodeName )
if child.nodeName in ['h1','h2','h3','h4']:
break
include_children = True
# check for conditional span and div sections
if child.nodeName in ['span','div']:
......
......@@ -205,7 +205,7 @@ diff_text = client.diff('./tmp-file-prefix-', '.')
<pre>import pysvn
client = pysvn.Client()
entry = client.info('.')
print 'Url:',info.url
print 'Url:',entry.url
</pre>
<h2>Repository Tasks</h2>
......
This diff is collapsed.
......@@ -7,9 +7,9 @@
//
// ====================================================================
//
all_versions = new Array( 1001000, 1002000, 1003000 )
all_versions = new Array( 1001000, 1002000, 1003000, 1004000 )
current_version = 1003000;
current_version = 1004000;
change_style = "hilite";
function changeDisplay( version )
......
......@@ -358,7 +358,9 @@ class SvnCommand:
tmpdir = os.path.join( tmpdir, 'svn_tmp' )
self.debug( 'cmd_diff %r, %r, %r, %r, %r' % (tmpdir, positional_args[0], recurse, revision1, revision2) )
diff_text = self.client.diff( tmpdir, positional_args[0], recurse=recurse, revision1=revision1, revision2=revision2 )
diff_text = self.client.diff( tmpdir, positional_args[0], recurse=recurse,
revision1=revision1, revision2=revision2,
diff_options=['-u'] )
print diff_text
def cmd_export( self, args ):
......@@ -424,7 +426,7 @@ class SvnCommand:
print 'Last Changed Date:', fmtDateTime( entry.commit_time )
if entry.text_time:
print 'Text Last Updated:', fmtDateTime( entry.text_time )
if entry.properties_time:
if entry.properties_time and self.pysvn_testing == '99.99.99':
print 'Properties Last Updated:', fmtDateTime( entry.properties_time )
if entry.checksum:
print 'Checksum:', entry.checksum
......@@ -451,55 +453,56 @@ class SvnCommand:
print
print 'Path:',path
if info['URL']:
print 'Url:',info['URL']
if info['rev']:
print 'Revision:',info['rev'].number
if info['repos_root_URL'] and self.pysvn_testing >= '01.03.00':
print 'Repository root URL:',info['repos_root_URL']
if info['repos_UUID']:
print 'Repository UUID:',info['repos_UUID']
if info['last_changed_author']:
print 'Last changed author:',info['last_changed_author']
if info['last_changed_date']:
print 'Last Changed Date:', fmtDateTime( info['last_changed_date'] )
if info['last_changed_rev'].kind == pysvn.opt_revision_kind.number:
print 'Last changed revision:',info['last_changed_rev'].number
if info['kind'] == pysvn.node_kind.file:
if info.URL:
print 'Url:',info.URL
if info.rev:
print 'Revision:',info.rev.number
if info.repos_root_URL and self.pysvn_testing >= '01.03.00':
print 'Repository root URL:',info.repos_root_URL
if info.repos_UUID:
print 'Repository UUID:',info.repos_UUID
if info.last_changed_author:
print 'Last changed author:',info.last_changed_author
if info.last_changed_date:
print 'Last Changed Date:', fmtDateTime( info.last_changed_date )
if info.last_changed_rev.kind == pysvn.opt_revision_kind.number:
print 'Last changed revision:',info.last_changed_rev.number
if info.kind == pysvn.node_kind.file:
print 'Node kind: file'
elif info['kind'] == pysvn.node_kind.dir:
elif info.kind == pysvn.node_kind.dir:
print 'Node kind: directory'
elif info['kind'] == pysvn.node_kind.none:
elif info.kind == pysvn.node_kind.none:
print 'Node kind: none'
else:
print 'Node kind: unknown'
if info['lock']:
print 'Lock Owner:',info['lock']['owner']
print 'Lock Creation Date:',fmtDateTime( info['lock']['creation_date'] )
if info['lock']['expiration_date'] is not None:
print 'Lock Expiration Date:',fmtDateTime( info['lock']['expiration_date'] )
print 'Lock Token:',info['lock']['token']
if info.lock:
print 'Lock Owner:',info.lock.owner
print 'Lock Creation Date:',fmtDateTime( info.lock.creation_date )
if info.lock.expiration_date is not None:
print 'Lock Expiration Date:',fmtDateTime( info.lock.expiration_date )
print 'Lock Token:',info.lock.token
print 'Lock Comment:'
print info['lock']['comment']
if info['wc_info']:
wc_info = info['wc_info']
if wc_info['schedule'] == pysvn.wc_schedule.normal:
if info.lock.comment not in ['', None]:
print info.lock.comment
if info.wc_info:
wc_info = info.wc_info
if wc_info.schedule == pysvn.wc_schedule.normal:
print "Schedule: normal"
elif wc_info['schedule'] == pysvn.wc_schedule.add:
elif wc_info.schedule == pysvn.wc_schedule.add:
print "Schedule: add"
elif wc_info['schedule'] == pysvn.wc_schedule.delete:
elif wc_info.schedule == pysvn.wc_schedule.delete:
print "Schedule: delete"
elif wc_info['schedule'] == pysvn.wc_schedule.replace:
elif wc_info.schedule == pysvn.wc_schedule.replace:
print "Schedule: replace"
if wc_info['copyfrom_url']:
print 'Copied From URL:', wc_info['copyfrom_url']
print 'Copied From Rev:', wc_info['copyfrom_rev'].number
if wc_info['text_time']:
print 'Text Last Updated:', fmtDateTime( wc_info['text_time'] )
if wc_info['prop_time']:
print 'Properties Last Updated:', fmtDateTime( wc_info['prop_time'] )
if wc_info['checksum']:
print 'Checksum:', wc_info['checksum']
if wc_info.copyfrom_url:
print 'Copied From URL:', wc_info.copyfrom_url
print 'Copied From Rev:', wc_info.copyfrom_rev.number
if wc_info.text_time:
print 'Text Last Updated:', fmtDateTime( wc_info.text_time )
if wc_info.prop_time and self.pysvn_testing == '99.99.99':
print 'Properties Last Updated:', fmtDateTime( wc_info.prop_time )
if wc_info.checksum:
print 'Checksum:', wc_info.checksum
def cmd_import( self, args ):
......@@ -526,20 +529,20 @@ class SvnCommand:
for log in all_logs:
print '-'*60
print 'rev %d: %s | %s | %d lines' % \
(log['revision'].number, log['author'], fmtDateTime( log['date'] ),
len(log['message'].split('\n')))
(log.revision.number, log.author, fmtDateTime( log.date ),
len(log.message.split('\n')))
if len(log['changed_paths']) > 0:
if len(log.changed_paths) > 0:
print 'Changed paths:'
for change_info in log['changed_paths']:
if change_info['copyfrom_path'] is None:
print ' %s %s' % (change_info['action'], change_info['path'])
for change_info in log.changed_paths:
if change_info.copyfrom_path is None:
print ' %s %s' % (change_info.action, change_info.path)
else:
print ' %s %s (from %s:%d)' % \
(change_info['action'], change_info['path'],
change_info['copyfrom_path'], change_info['copyfrom_revision'].number)
(change_info.action, change_info.path,
change_info.copyfrom_path, change_info.copyfrom_revision.number)
print log['message']
print log.message
print '-'*60
......@@ -555,9 +558,11 @@ class SvnCommand:
all_files = self.client.ls( arg, revision=revision, recurse=recurse )
if verbose:
for file in all_files:
file['time_str'] = fmtDateTime( file['time'] )
file['created_rev_num'] = file['created_rev'].number
print '%(created_rev_num)7d %(last_author)-10s %(size)6d %(time_str)s %(name)s' % file
args = {}
args.update( file )
args['time_str'] = fmtDateTime( file.time )
args['created_rev_num'] = file.created_rev.number
print '%(created_rev_num)7d %(last_author)-10s %(size)6d %(time_str)s %(name)s' % args
else:
for file in all_files:
print '%(name)s' % file
......
......@@ -24,13 +24,13 @@ code {background-color: #dddddd; }
<li>Python pyexpat package
</ul>
</li>
<li><a href="http://subversion.tigris.org">subversion</a> 1.2.x or 1.3.x with these options:
<li><a href="http://subversion.tigris.org">subversion</a> 1.2.x, 1.3.x or 1.4.x with these options:
<ul>
<li>Subversion client package
<li>Subversion development package
</ul>
</li>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=3180">PyCXX V5.3.5</a> which is included in the pysvn source kit.</li>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=3180">PyCXX V5.3.6</a> which is included in the pysvn source kit.</li>
</ul>
<p>Some distributions will split python and subversion into more the one package.</p>
<p>You will need to find all the packages that give you the options listed above.</p>
......@@ -39,12 +39,12 @@ code {background-color: #dddddd; }
<p>These instructions assume you have Microsoft Visual C++ 6.0 to compile the code
and <a href="http://www.jrsoftware.org/">INNO</a> 4.0.10 to create the installation kit.</p>
<p>Note: You must build with MSVC 6.0 as python 2.3 and earlier was built with that version.</p>
<p>Note: You must build with MSVC 2003.NET for python 2.4 or later.</p>
<p>Note: You must build with MSVC 2003.NET for python 2.4, Python 2.5 or later.</p>
<ol>
<li>build subversion (tested with SVN 1.2.3 and SVN 1.3.0)</li>
<li>build subversion (tested with SVN 1.3.2 and svn 1.4.0)</li>
<li>fetch and expand the pysvn source code into <em>extdir</em></li>
<li>Expand pycxx_5_3_5.tar.gz into <em>extdir</em>\Import if not using a source kit</li>
<li>Expand pycxx-5.3.6.tar.gz into <em>extdir</em>\Import if not using a source kit</li>
<li>edit Builder\builder_custom_init.cmd to match the locations of the sources.</li>
<li><code>cd Builder</code></li>
<li><code>builder_custom_init.cmd</code></li>
......@@ -63,7 +63,7 @@ and <a href="http://www.jrsoftware.org/">INNO</a> 4.0.10 to create the installat
<ol>
<li>Install subversion</li>
<li>get the pysvn source code</li>
<li><code>tar xzf pycxx_5_3_5.tar.gz</code> into <em>extdir</em>/Import if not using a source kit</li>
<li><code>tar xzf pycxx-5.3.6.tar.gz</code> into <em>extdir</em>/Import if not using a source kit</li>
<li><code>cd Source</code></li>
<li>Create the Makefile using <code>python setup.py configure</code></li>
<li><code>make</code></li>
......
......@@ -70,5 +70,12 @@
# define TEMPLATE_TYPENAME class
#endif
// before 2.5 Py_ssize_t was missing
#ifndef PY_MAJOR_VERSION
#error not defined PY_MAJOR_VERSION
#endif
#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
typedef int Py_ssize_t;
#endif
#endif // __PyCXX_config_hh__
//----------------------------------*-C++-*----------------------------------//
// Copyright 1998 The Regents of the University of California.
// All rights reserved. See LEGAL.LLNL for full text and disclaimer.
//---------------------------------------------------------------------------//
#ifndef __CXX_Exception_h
#define __CXX_Exception_h
#include "Python.h"
#include "CXX/Version.hxx"
#include "CXX/Config.hxx"
#include "CXX/IndirectPythonInterface.hxx"
#include <string>
#include <iostream>
// This mimics the Python structure, in order to minimize confusion
namespace Py
{
class ExtensionExceptionType;
class Object;
class Exception
{
public:
Exception( ExtensionExceptionType &exception, const std::string& reason );
Exception( ExtensionExceptionType &exception, Object &reason );
explicit Exception ()
{}
Exception (const std::string& reason)
{
PyErr_SetString (Py::_Exc_RuntimeError(), reason.c_str());
}
Exception (PyObject* exception, const std::string& reason)
{
PyErr_SetString (exception, reason.c_str());
}
Exception (PyObject* exception, Object &reason);
void clear() // clear the error
// technically but not philosophically const
{
PyErr_Clear();
}
};
// Abstract
class StandardError: public Exception
{
protected:
explicit StandardError()
{}
};
class LookupError: public StandardError
{
protected:
explicit LookupError()
{}
};
class ArithmeticError: public StandardError
{
protected:
explicit ArithmeticError()
{}
};
class EnvironmentError: public StandardError
{
protected:
explicit EnvironmentError()
{}
};
// Concrete
class TypeError: public StandardError
{
public:
TypeError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_TypeError(),reason.c_str());
}
};
class IndexError: public LookupError
{
public:
IndexError (const std::string& reason)
: LookupError()
{
PyErr_SetString (Py::_Exc_IndexError(), reason.c_str());
}
};
class AttributeError: public StandardError
{
public:
AttributeError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_AttributeError(), reason.c_str());
}
};
class NameError: public StandardError
{
public:
NameError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_NameError(), reason.c_str());
}
};
class RuntimeError: public StandardError
{
public:
RuntimeError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_RuntimeError(), reason.c_str());
}
};
class SystemError: public StandardError
{
public:
SystemError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_SystemError(),reason.c_str());
}
};
class KeyError: public LookupError
{
public:
KeyError (const std::string& reason)
: LookupError()
{
PyErr_SetString (Py::_Exc_KeyError(),reason.c_str());
}
};
class ValueError: public StandardError
{
public:
ValueError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_ValueError(), reason.c_str());
}
};
class OverflowError: public ArithmeticError
{
public:
OverflowError (const std::string& reason)
: ArithmeticError()
{
PyErr_SetString (Py::_Exc_OverflowError(), reason.c_str());
}
};
class ZeroDivisionError: public ArithmeticError
{
public:
ZeroDivisionError (const std::string& reason)
: ArithmeticError()
{
PyErr_SetString (Py::_Exc_ZeroDivisionError(), reason.c_str());
}
};
class FloatingPointError: public ArithmeticError
{
public:
FloatingPointError (const std::string& reason)
: ArithmeticError()
{
PyErr_SetString (Py::_Exc_FloatingPointError(), reason.c_str());
}
};
class MemoryError: public StandardError
{
public:
MemoryError (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_MemoryError(), reason.c_str());
}
};
class SystemExit: public StandardError
{
public:
SystemExit (const std::string& reason)
: StandardError()
{
PyErr_SetString (Py::_Exc_SystemExit(),reason.c_str());
}
};
}// Py
#endif
This diff is collapsed.
......@@ -8,7 +8,7 @@ namespace Py
bool InitialisePythonIndirectInterface();
//
// Wrap Exception variables as function calls
// Wrap Exception variables as function calls
//
PyObject * _Exc_Exception();
PyObject * _Exc_StandardError();
......@@ -51,13 +51,13 @@ PyObject * _Exc_UnicodeError();
#endif
//
// Wrap Object variables as function calls
// Wrap Object variables as function calls
//
PyObject * _None();
//
// Wrap Type variables as function calls
// Wrap Type variables as function calls
//
PyTypeObject * _List_Type();
bool _List_Check( PyObject *o );
......@@ -153,4 +153,4 @@ void _XDECREF( PyObject *op );
char *__Py_PackageContext();
};
#endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__
#endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__
This diff is collapsed.
//
// CXX/Version.hxx
//
#ifndef __PyCXX_version_hxx__
#define __PyCXX_version_hxx__
#define PYCXX_VERSION_MAJOR 5
#define PYCXX_VERSION_MINOR 3
#define PYCXX_VERSION_PATCH 5
#define PYCXX_MAKEVERSION( major, minor, patch ) ((major<<16)|(minor<<8)|(patch))
#define PYCXX_VERSION PYCXX_MAKEVERSION( PYCXX_VERSION_MAJOR, PYCXX_VERSION_MINOR, PYCXX_VERSION_PATCH )
#endif
//
// CXX/Version.hxx
//
#ifndef __PyCXX_version_hxx__
#define __PyCXX_version_hxx__
#define PYCXX_VERSION_MAJOR 5
#define PYCXX_VERSION_MINOR 3
#define PYCXX_VERSION_PATCH 6
#define PYCXX_MAKEVERSION( major, minor, patch ) ((major<<16)|(minor<<8)|(patch))
#define PYCXX_VERSION PYCXX_MAKEVERSION( PYCXX_VERSION_MAJOR, PYCXX_VERSION_MINOR, PYCXX_VERSION_PATCH )
#endif
This diff is collapsed.
#include "pycxx_iter.hxx"
#include "Python.h"
#include "CXX/Objects.hxx"
void IterT::init_type()
{
behaviors().name("IterT");
behaviors().doc("IterT(ini_count)");
// you must have overwritten the virtual functions
// Py::Object iter() and Py::Object iternext()
behaviors().supportIter(); // set entries in the Type Table
behaviors().supportRepr();
add_varargs_method("reversed",&IterT::reversed,"reversed()");
}
class MyIterModule : public Py::ExtensionModule<MyIterModule>
{
public:
MyIterModule() : Py::ExtensionModule<MyIterModule>("pycxx_iter")
{
IterT::init_type();
add_varargs_method("IterT",&MyIterModule::new_IterT,"IterT(from,last)");
initialize("MyIterModule documentation"); // register with Python
}
virtual ~MyIterModule() {}
private:
Py::Object new_IterT(const Py::Tuple& args)
{
if (args.length() != 2)
{
throw Py::RuntimeError("Incorrect # of args to IterT(from,to).");
}
return Py::asObject(new IterT(Py::Int(args[0]),Py::Int(args[1])));
}
};
extern "C" void initpycxx_iter()
{
// the following constructor call registers our extension module
// with the Python runtime system
static MyIterModule* IterTest = new MyIterModule;
}
#include "CXX/Extensions.hxx"
#include <iostream>
#include <sstream>
#include <string>
class IterT : public Py::PythonExtension<IterT>
{
int from, count, last;
int fwd_iter;
bool do_it_reversed;
public:
static void init_type(void); // announce properties and methods
IterT(int _from, int _last)
: from(_from)
, last(_last)
, fwd_iter(0)
, do_it_reversed(false)
{}
Py::Object repr()
{
std::string s;
std::ostringstream s_out;
s_out << "IterT count(" << count << ")";
return Py::String(s_out.str());
}