Example #1
0
 def alloc_empty_dir(self, suffix=""):
     """Create an empty temporary directory. Returns its full path
    in canonical internal form."""
     temp_dir_name = core.svn_dirent_internal_style(
         tempfile.mkdtemp(suffix))
     self._cleanup_list.append((temp_dir_name, core.svn_io_remove_dir))
     return temp_dir_name
Example #2
0
 def alloc_empty_dir(self, suffix=""):
     """Create an empty temporary directory. Returns its full path
    in canonical internal form."""
     if isinstance(suffix, bytes):
         suffix = suffix.decode('UTF-8')
     temp_dir_name = tempfile.mkdtemp(suffix).encode('UTF-8')
     temp_dir_name = core.svn_dirent_internal_style(temp_dir_name)
     self._cleanup_list.append((temp_dir_name, core.svn_io_remove_dir))
     return temp_dir_name
Example #3
0
 def alloc_empty_repo(self, suffix=""):
     """Create an empty repository. Returns a tuple of its handle, path and
    file: URI in canonical internal form."""
     temp_path = tempfile.mkdtemp(suffix)
     repo_path = core.svn_dirent_internal_style(temp_path)
     repo_uri = core.svn_uri_canonicalize(file_uri_for_path(temp_path))
     handle = repos.create(repo_path, None, None, None, None)
     self._cleanup_list.append((repo_path, repos.svn_repos_delete))
     return (handle, repo_path, repo_uri)
 def alloc_empty_repo(self, suffix = ""):
   """Create an empty repository. Returns a tuple of its handle, path and
      file: URI in canonical internal form."""
   temp_path = tempfile.mkdtemp(suffix)
   repo_path = core.svn_dirent_internal_style(temp_path)
   repo_uri = core.svn_uri_canonicalize(file_uri_for_path(temp_path))
   handle = repos.create(repo_path, None, None, None, None)
   self._cleanup_list.append((repo_path, repos.svn_repos_delete))
   return (handle, repo_path, repo_uri)
Example #5
0
    from io import StringIO
else:
    # Python <3.0
    try:
        from cStringIO import StringIO
    except ImportError:
        from StringIO import StringIO

from svn import core, repos

from trac.test import TestSetup
from trac.versioncontrol import Changeset, Node
from trac.versioncontrol.svn_fs import SubversionRepository

temp_path = tempfile.mktemp("-trac-svnrepos")
REPOS_PATH = core.svn_dirent_internal_style(temp_path)
REPOS_URL = pathname2url(temp_path)
del temp_path

if REPOS_URL.startswith("///"):
    # Don't add extra slashes if they're already present.
    # (This is important for Windows compatibility).
    REPOS_URL = "file:" + REPOS_URL
else:
    # If the URL simply starts with '/', we need to add two
    # extra slashes to make it a valid 'file://' URL
    REPOS_URL = "file://" + REPOS_URL

REPOS_URL = core.svn_uri_canonicalize(REPOS_URL)

Example #6
0
if sys.version_info[0] >= 3:
    # Python >=3.0
    from urllib.request import pathname2url
else:
    # Python <3.0
    from urllib import pathname2url

from svn import core, repos

from trac.test import TestSetup
from trac.versioncontrol import Changeset, Node
from trac.versioncontrol.svn_fs import SubversionRepository

temp_path = tempfile.mktemp("-trac-svnrepos")
REPOS_PATH = core.svn_dirent_internal_style(temp_path.encode('UTF-8'))
REPOS_URL = pathname2url(temp_path).encode('UTF-8')
del temp_path

if REPOS_URL.startswith(b"///"):
    # Don't add extra slashes if they're already present.
    # (This is important for Windows compatibility).
    REPOS_URL = b"file:" + REPOS_URL
else:
    # If the URL simply starts with '/', we need to add two
    # extra slashes to make it a valid 'file://' URL
    REPOS_URL = b"file://" + REPOS_URL

REPOS_URL = core.svn_uri_canonicalize(REPOS_URL)

 def alloc_empty_dir(self, suffix = ""):
   """Create an empty temporary directory. Returns its full path
      in canonical internal form."""
   temp_dir_name = core.svn_dirent_internal_style(tempfile.mkdtemp(suffix))
   self._cleanup_list.append((temp_dir_name, core.svn_io_remove_dir))
   return temp_dir_name
  from io import StringIO
else:
  # Python <3.0
  try:
    from cStringIO import StringIO
  except ImportError:
    from StringIO import StringIO

from svn import core, repos

from trac.test import TestSetup
from trac.versioncontrol import Changeset, Node
from trac.versioncontrol.svn_fs import SubversionRepository

temp_path = tempfile.mktemp("-trac-svnrepos")
REPOS_PATH = core.svn_dirent_internal_style(temp_path)
REPOS_URL = pathname2url(temp_path)
del temp_path

if REPOS_URL.startswith("///"):
  # Don't add extra slashes if they're already present.
  # (This is important for Windows compatibility).
  REPOS_URL = "file:" + REPOS_URL
else:
  # If the URL simply starts with '/', we need to add two
  # extra slashes to make it a valid 'file://' URL
  REPOS_URL = "file://" + REPOS_URL

REPOS_URL = core.svn_uri_canonicalize(REPOS_URL)

class SubversionRepositoryTestSetup(TestSetup):