Пример #1
0
 def test_platform_providers(self):
   providers = core.svn_auth_get_platform_specific_client_providers(None, None)
   # Not much more we can test in this minimal environment.
   self.assert_(isinstance(providers, list))
   self.assert_(not filter(lambda x:
                            not isinstance(x, core.svn_auth_provider_object_t),
                           providers))
Пример #2
0
 def test_platform_providers(self):
     providers = core.svn_auth_get_platform_specific_client_providers(
         None, None)
     # Not much more we can test in this minimal environment.
     self.assertTrue(isinstance(providers, list))
     self.assert_all_instances_of(providers,
                                  core.svn_auth_provider_object_t)
def main():
    try:
        url, peg_revision, start_revision, end_revision = parse_args(
            sys.argv[1:])
    except Exception as e:
        sys.stderr.write("""Usage: %s URL[@PEG-REV] [START-REV[:END-REV]]

Trace the history of URL@PEG-REV, printing the location(s) of its
existence between START-REV and END-REV.  If START-REV is not
provided, the entire history of URL@PEG-REV back to its origin will be
displayed.  If provided, START-REV must not be younger than PEG-REV.
If END-REV is provided, it must not be younger than START-REV.

(This is a wrapper around Subversion's svn_ra_get_location_segments() API.)

ERROR: %s
""" % (os.path.basename(sys.argv[0]), str(e)))
        sys.exit(1)

    core.svn_config_ensure(None)
    ctx = client.svn_client_create_context()
    ctx.config = core.svn_config_get_config(None)

    # Make sure that these are at the start of the list, so passwords from
    # gnome-keyring / kwallet are checked before asking for new passwords.
    providers = core.svn_auth_get_platform_specific_client_providers(
        ctx.config['config'], None)
    providers.extend([
        client.get_simple_provider(),
        core.svn_auth_get_ssl_server_trust_file_provider(),
        core.svn_auth_get_simple_prompt_provider(prompt_func_simple_prompt, 2),
        core.svn_auth_get_ssl_server_trust_prompt_provider(
            prompt_func_ssl_unknown_cert),
        client.get_username_provider(),
        client.get_ssl_server_trust_file_provider(),
        client.get_ssl_client_cert_file_provider(),
        client.get_ssl_client_cert_pw_file_provider(),
    ])

    ctx.auth_baton = core.svn_auth_open(providers)

    if hasattr(core, 'svn_auth_set_gnome_keyring_unlock_prompt_func'):
        core.svn_auth_set_gnome_keyring_unlock_prompt_func(
            ctx.auth_baton, prompt_func_gnome_keyring_prompt)

    ra_callbacks = ra.callbacks_t()
    ra_callbacks.auth_baton = ctx.auth_baton
    ra_session = ra.open(url, ra_callbacks, None, ctx.config)
    ra.get_location_segments(ra_session, "", peg_revision, start_revision,
                             end_revision, printer)
def main():
  try:
    url, peg_revision, start_revision, end_revision = parse_args(sys.argv[1:])
  except Exception as e:
    sys.stderr.write("""Usage: %s URL[@PEG-REV] [START-REV[:END-REV]]

Trace the history of URL@PEG-REV, printing the location(s) of its
existence between START-REV and END-REV.  If START-REV is not
provided, the entire history of URL@PEG-REV back to its origin will be
displayed.  If provided, START-REV must not be younger than PEG-REV.
If END-REV is provided, it must not be younger than START-REV.

(This is a wrapper around Subversion's svn_ra_get_location_segments() API.)

ERROR: %s
""" % (os.path.basename(sys.argv[0]), str(e)))
    sys.exit(1)

  core.svn_config_ensure(None)
  ctx = client.svn_client_create_context()
  ctx.config = core.svn_config_get_config(None)

  # Make sure that these are at the start of the list, so passwords from
  # gnome-keyring / kwallet are checked before asking for new passwords.
  providers = core.svn_auth_get_platform_specific_client_providers(ctx.config['config'], None)
  providers.extend([
    client.get_simple_provider(),
    core.svn_auth_get_ssl_server_trust_file_provider(),
    core.svn_auth_get_simple_prompt_provider(prompt_func_simple_prompt, 2),
    core.svn_auth_get_ssl_server_trust_prompt_provider(prompt_func_ssl_unknown_cert),
    client.get_username_provider(),
    client.get_ssl_server_trust_file_provider(),
    client.get_ssl_client_cert_file_provider(),
    client.get_ssl_client_cert_pw_file_provider(),
  ])

  ctx.auth_baton = core.svn_auth_open(providers)

  if hasattr(core, 'svn_auth_set_gnome_keyring_unlock_prompt_func'):
    core.svn_auth_set_gnome_keyring_unlock_prompt_func(ctx.auth_baton, prompt_func_gnome_keyring_prompt)

  ra_callbacks = ra.callbacks_t()
  ra_callbacks.auth_baton = ctx.auth_baton
  ra_session = ra.open(url, ra_callbacks, None, ctx.config)
  ra.get_location_segments(ra_session, "", peg_revision,
                           start_revision, end_revision, printer)
Пример #5
0
displayed.  If provided, START-REV must not be younger than PEG-REV.
If END-REV is provided, it must not be younger than START-REV.

(This is a wrapper around Subversion's svn_ra_get_location_segments() API.)

ERROR: %s
""" % (os.path.basename(sys.argv[0]), str(e)))
        sys.exit(1)

    core.svn_config_ensure(None)
    ctx = client.svn_client_create_context()
    ctx.config = core.svn_config_get_config(None)

    # Make sure that these are at the start of the list, so passwords from
    # gnome-keyring / kwallet are checked before asking for new passwords.
    providers = core.svn_auth_get_platform_specific_client_providers(
        ctx.config['config'], None)
    providers.extend([
        client.get_simple_provider(),
        core.svn_auth_get_ssl_server_trust_file_provider(),
        core.svn_auth_get_simple_prompt_provider(prompt_func_simple_prompt, 2),
        core.svn_auth_get_ssl_server_trust_prompt_provider(
            prompt_func_ssl_unknown_cert),
        client.get_username_provider(),
        client.get_ssl_server_trust_file_provider(),
        client.get_ssl_client_cert_file_provider(),
        client.get_ssl_client_cert_pw_file_provider(),
    ])

    ctx.auth_baton = core.svn_auth_open(providers)

    if hasattr(core, 'svn_auth_set_gnome_keyring_unlock_prompt_func'):
Пример #6
0
displayed.  If provided, START-REV must not be younger than PEG-REV.
If END-REV is provided, it must not be younger than START-REV.

(This is a wrapper around Subversion's svn_ra_get_location_segments() API.)

ERROR: %s
""" % (os.path.basename(sys.argv[0]), str(e)))
    sys.exit(1)

  core.svn_config_ensure(None)
  ctx = client.svn_client_create_context()
  ctx.config = core.svn_config_get_config(None)

  # Make sure that these are at the start of the list, so passwords from
  # gnome-keyring / kwallet are checked before asking for new passwords.
  providers = core.svn_auth_get_platform_specific_client_providers(ctx.config['config'], None)
  providers.extend([
    client.get_simple_provider(),
    core.svn_auth_get_ssl_server_trust_file_provider(),
    core.svn_auth_get_simple_prompt_provider(prompt_func_simple_prompt, 2),
    core.svn_auth_get_ssl_server_trust_prompt_provider(prompt_func_ssl_unknown_cert),
    client.get_username_provider(),
    client.get_ssl_server_trust_file_provider(),
    client.get_ssl_client_cert_file_provider(),
    client.get_ssl_client_cert_pw_file_provider(),
  ])

  ctx.auth_baton = core.svn_auth_open(providers)

  if hasattr(core, 'svn_auth_set_gnome_keyring_unlock_prompt_func'):
    core.svn_auth_set_gnome_keyring_unlock_prompt_func(ctx.auth_baton, prompt_func_gnome_keyring_prompt)
Пример #7
0
If END-REV is provided, it must not be younger than START-REV.

(This is a wrapper around Subversion's svn_ra_get_location_segments() API.)

ERROR: %s
""" % (os.path.basename(sys.argv[0]), str(e)))
    sys.exit(1)

  core.svn_config_ensure(None)
  ctx = client.ctx_t()

  # Make sure that these are at the start of the list, so passwords from
  # gnome-keyring / kwallet are checked before asking for new passwords.
  # Note that we don't pass our config here, since we can't seem to access
  # ctx.config.config (ctx.config is opaque).
  providers = core.svn_auth_get_platform_specific_client_providers(None, None)
  providers.extend([
    client.get_simple_provider(),
    client.get_username_provider(),
    client.get_ssl_server_trust_file_provider(),
    client.get_ssl_client_cert_file_provider(),
    client.get_ssl_client_cert_pw_file_provider(),
  ])

  ctx.auth_baton = core.svn_auth_open(providers)
  ctx.config = core.svn_config_get_config(None)

  ra_callbacks = ra.callbacks_t()
  ra_callbacks.auth_baton = ctx.auth_baton
  ra_session = ra.open(url, ra_callbacks, None, ctx.config)
  ra.get_location_segments(ra_session, "", peg_revision,