72
72
static const char name_notice_ancestry[] = "notice_ancestry";
73
73
static const char name_number[] = "number";
74
74
static const char name_path[] = "path";
75
static const char name_password[] = "password";
75
76
static const char name_peg_revision[] = "peg_revision";
76
77
static const char name_prop_name[] = "prop_name";
77
78
static const char name_prop_value[] = "prop_value";
95
96
static const char name_url_or_path[] = "url_or_path";
96
97
static const char name_url_or_path1[] = "url_or_path1";
97
98
static const char name_url_or_path2[] = "url_or_path2";
99
static const char name_username[] = "username";
98
100
static const char name_utf8[] = "UTF-8";
351
// There are cases when the author has been passed as NULL
352
// protect against NULL passed for any of the strings
349
360
std::list<AnnotatedLineInfo> *entries = (std::list<AnnotatedLineInfo> *)baton;
350
361
entries->push_back( AnnotatedLineInfo( line_no, revision, author, date, line ) );
1749
1760
if( SVN_IS_VALID_REVNUM( change_entry.m_copy_from_revision ) )
1750
1761
changed_entry_dict[name_copyfrom_revision] = Py::asObject( new pysvn_revision( svn_opt_revision_number, 0, change_entry.m_copy_from_revision ) );
1752
changed_entry_dict[name_copyfrom_revision] = Py::Nothing();
1763
changed_entry_dict[name_copyfrom_revision] = Py::None();
1754
1765
changed_paths_list.append( changed_entry_dict );
3048
3059
PythonAllowThreads permission( m_context );
3050
3061
svn_revnum_t revnum;
3051
svn_opt_revision_t rev = { svn_opt_revision_head, 0 };
3062
svn_opt_revision_t rev = { svn_opt_revision_head, {0} };
3053
3064
StatusEntriesBaton baton;
3358
Py::Object pysvn_client::helper_boolean_auth_set( FunctionArguments &a_args, const char *a_arg_name, const char *a_param_name )
3362
bool enable( a_args.getBoolean( a_arg_name ) );
3367
param = (void *)"1";
3369
svn_auth_set_parameter
3371
m_context.ctx()->auth_baton,
3376
catch( SvnException &e )
3378
// use callback error over ClientException
3379
m_context.checkForError( m_module.client_error );
3381
throw_client_error( e );
3387
Py::Object pysvn_client::helper_boolean_auth_get( FunctionArguments &a_args, const char *a_param_name )
3394
param = (char *)svn_auth_get_parameter
3396
m_context.ctx()->auth_baton,
3400
catch( SvnException &e )
3402
// use callback error over ClientException
3403
m_context.checkForError( m_module.client_error );
3405
throw_client_error( e );
3408
bool not_set = param != NULL && param[0] == '1';
3410
return Py::Int( 0 );
3411
return Py::Int( 1 );
3414
Py::Object pysvn_client::helper_string_auth_set
3416
FunctionArguments &a_args,
3417
const char *a_arg_name,
3418
const char *a_param_name,
3419
std::string &ctx_str
3424
const char *param = NULL;
3425
Py::Object param_obj( a_args.getArg( a_arg_name ) );
3426
if( !param_obj.is( Py::None() ) )
3428
Py::String param_str( param_obj );
3429
ctx_str = param_str.as_std_string();
3430
param = ctx_str.c_str();
3435
svn_auth_set_parameter
3437
m_context.ctx()->auth_baton,
3442
catch( SvnException &e )
3444
// use callback error over ClientException
3445
m_context.checkForError( m_module.client_error );
3447
throw_client_error( e );
3453
Py::Object pysvn_client::helper_string_auth_get( FunctionArguments &a_args, const char *a_param_name )
3460
param = (char *)svn_auth_get_parameter
3462
m_context.ctx()->auth_baton,
3466
catch( SvnException &e )
3468
// use callback error over ClientException
3469
m_context.checkForError( m_module.client_error );
3471
throw_client_error( e );
3475
return Py::String( param );
3347
3480
Py::Object pysvn_client::get_auth_cache( const Py::Tuple &a_args, const Py::Dict &a_kws )
3349
3482
static argument_description args_desc[] =
3351
3484
{ false, NULL }
3353
3486
FunctionArguments args( "get_auth_cache", args_desc, a_args, a_kws );
3359
param = (char *)svn_auth_get_parameter
3361
m_context.ctx()->auth_baton,
3362
SVN_AUTH_PARAM_NO_AUTH_CACHE
3365
catch( SvnException &e )
3367
// use callback error over ClientException
3368
m_context.checkForError( m_module.client_error );
3370
throw_client_error( e );
3373
bool no_auth_cache = (param != NULL && param[0] == '1');
3375
return Py::Int( 0 );
3376
return Py::Int( 1 );
3488
return helper_boolean_auth_get( args, SVN_AUTH_PARAM_NO_AUTH_CACHE );
3491
Py::Object pysvn_client::get_interactive( const Py::Tuple &a_args, const Py::Dict &a_kws )
3493
static argument_description args_desc[] =
3497
FunctionArguments args( "get_interactive", args_desc, a_args, a_kws );
3499
return helper_boolean_auth_get( args, SVN_AUTH_PARAM_NON_INTERACTIVE );
3502
Py::Object pysvn_client::get_store_passwords( const Py::Tuple &a_args, const Py::Dict &a_kws )
3504
static argument_description args_desc[] =
3508
FunctionArguments args( "get_store_passwords", args_desc, a_args, a_kws );
3510
return helper_boolean_auth_get( args, SVN_AUTH_PARAM_DONT_STORE_PASSWORDS );
3513
Py::Object pysvn_client::get_default_username( const Py::Tuple &a_args, const Py::Dict &a_kws )
3515
static argument_description args_desc[] =
3519
FunctionArguments args( "get_default_username", args_desc, a_args, a_kws );
3521
return helper_string_auth_get( args, SVN_AUTH_PARAM_DEFAULT_USERNAME );
3524
Py::Object pysvn_client::get_default_password( const Py::Tuple &a_args, const Py::Dict &a_kws )
3526
static argument_description args_desc[] =
3530
FunctionArguments args( "get_default_password", args_desc, a_args, a_kws );
3532
return helper_string_auth_get( args, SVN_AUTH_PARAM_DEFAULT_PASSWORD );
3379
3535
Py::Object pysvn_client::set_auth_cache( const Py::Tuple &a_args, const Py::Dict &a_kws )
3384
3540
{ false, NULL }
3386
3542
FunctionArguments args( "set_auth_cache", args_desc, a_args, a_kws );
3389
bool enable( args.getBoolean( name_enable ) );
3394
param = (void *)"1";
3396
svn_auth_set_parameter
3398
m_context.ctx()->auth_baton,
3399
SVN_AUTH_PARAM_NO_AUTH_CACHE,
3403
catch( SvnException &e )
3405
// use callback error over ClientException
3406
m_context.checkForError( m_module.client_error );
3408
throw_client_error( e );
3411
return Py::Nothing();
3544
return helper_boolean_auth_set( args, name_enable, SVN_AUTH_PARAM_NO_AUTH_CACHE );
3547
Py::Object pysvn_client::set_interactive( const Py::Tuple &a_args, const Py::Dict &a_kws )
3549
static argument_description args_desc[] =
3551
{ true, name_enable },
3554
FunctionArguments args( "set_interactive", args_desc, a_args, a_kws );
3556
return helper_boolean_auth_set( args, name_enable, SVN_AUTH_PARAM_NON_INTERACTIVE );
3559
Py::Object pysvn_client::set_store_passwords( const Py::Tuple &a_args, const Py::Dict &a_kws )
3561
static argument_description args_desc[] =
3563
{ true, name_enable },
3566
FunctionArguments args( "set_store_passwords", args_desc, a_args, a_kws );
3568
return helper_boolean_auth_set( args, name_enable, SVN_AUTH_PARAM_DONT_STORE_PASSWORDS );
3571
Py::Object pysvn_client::set_default_username( const Py::Tuple &a_args, const Py::Dict &a_kws )
3573
static argument_description args_desc[] =
3575
{ true, name_username },
3578
FunctionArguments args( "set_default_username", args_desc, a_args, a_kws );
3580
return helper_string_auth_set( args, name_username, SVN_AUTH_PARAM_DEFAULT_USERNAME, m_context.m_default_username );
3583
Py::Object pysvn_client::set_default_password( const Py::Tuple &a_args, const Py::Dict &a_kws )
3585
static argument_description args_desc[] =
3587
{ true, name_password },
3590
FunctionArguments args( "set_default_password", args_desc, a_args, a_kws );
3592
return helper_string_auth_set( args, name_password, SVN_AUTH_PARAM_DEFAULT_PASSWORD, m_context.m_default_password );
3414
3595
Py::Object pysvn_client::get_auto_props( const Py::Tuple &a_args, const Py::Dict &a_kws )
3539
3720
add_keyword_method("copy", &pysvn_client::cmd_copy, pysvn_client_copy_doc );
3540
3721
add_keyword_method("diff", &pysvn_client::cmd_diff, pysvn_client_diff_doc );
3541
3722
add_keyword_method("export", &pysvn_client::cmd_export, pysvn_client_export_doc );
3723
add_keyword_method("get_auth_cache", &pysvn_client::get_auth_cache, pysvn_client_get_auth_cache_doc );
3724
add_keyword_method("get_auto_props", &pysvn_client::get_auto_props, pysvn_client_get_auto_props_doc );
3725
add_keyword_method("get_default_password", &pysvn_client::get_default_password, pysvn_client_get_default_password_doc );
3726
add_keyword_method("get_default_username", &pysvn_client::get_default_username, pysvn_client_get_default_username_doc );
3727
add_keyword_method("get_interactive", &pysvn_client::get_interactive, pysvn_client_get_interactive_doc );
3728
add_keyword_method("get_store_passwords", &pysvn_client::get_store_passwords, pysvn_client_get_store_passwords_doc );
3542
3729
add_keyword_method("import_", &pysvn_client::cmd_import, pysvn_client_import__doc );
3543
3730
add_keyword_method("info", &pysvn_client::cmd_info, pysvn_client_info_doc );
3566
3753
add_keyword_method("revpropget", &pysvn_client::cmd_revpropget, pysvn_client_revpropget_doc );
3567
3754
add_keyword_method("revproplist", &pysvn_client::cmd_revproplist, pysvn_client_revproplist_doc );
3568
3755
add_keyword_method("revpropset", &pysvn_client::cmd_revpropset, pysvn_client_revpropset_doc );
3569
add_keyword_method("get_auth_cache", &pysvn_client::get_auth_cache, pysvn_client_get_auth_cache_doc );
3570
3756
add_keyword_method("set_auth_cache", &pysvn_client::set_auth_cache, pysvn_client_set_auth_cache_doc );
3571
add_keyword_method("get_auto_props", &pysvn_client::get_auto_props, pysvn_client_get_auto_props_doc );
3572
3757
add_keyword_method("set_auto_props", &pysvn_client::set_auto_props, pysvn_client_set_auto_props_doc );
3758
add_keyword_method("set_default_password", &pysvn_client::set_default_password, pysvn_client_set_default_password_doc );
3759
add_keyword_method("set_default_username", &pysvn_client::set_default_username, pysvn_client_set_default_username_doc );
3760
add_keyword_method("set_interactive", &pysvn_client::set_interactive, pysvn_client_set_interactive_doc );
3761
add_keyword_method("set_store_passwords", &pysvn_client::set_store_passwords, pysvn_client_set_store_passwords_doc );
3573
3762
add_keyword_method("status", &pysvn_client::cmd_status, pysvn_client_status_doc );
3574
3763
add_keyword_method("switch", &pysvn_client::cmd_switch, pysvn_client_switch_doc );
3575
3764
#ifdef PYSVN_HAS_CLIENT_LOCK