* lib/vclib/svn/__init__.py
Bump version requirement to Subversion 1.3.1. Also, remove unnecessary pools from the entirety of the module. * lib/vclib/svn_ra/__init__.py Bump version requirement to Subversion 1.3.1. * INSTALL Bump Subversion version requirement to Subversion 1.3.1. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1475 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/options-overhaul
parent
d83ff39472
commit
fa035c8ae7
2
INSTALL
2
INSTALL
|
@ -31,7 +31,7 @@ Congratulations on getting this far. :-)
|
||||||
|
|
||||||
* Python 2.0 or later
|
* Python 2.0 or later
|
||||||
(http://www.python.org/)
|
(http://www.python.org/)
|
||||||
* Subversion, Version Control System, 1.2.0 or later
|
* Subversion, Version Control System, 1.3.1 or later
|
||||||
(binary installation and Python bindings)
|
(binary installation and Python bindings)
|
||||||
(http://subversion.tigris.org/)
|
(http://subversion.tigris.org/)
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,9 @@ import re
|
||||||
from svn import fs, repos, core, delta
|
from svn import fs, repos, core, delta
|
||||||
|
|
||||||
|
|
||||||
### Require Subversion 1.2.0 or better.
|
### Require Subversion 1.3.1 or better.
|
||||||
if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_PATCH) < (1, 2, 0):
|
if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_PATCH) < (1, 3, 1):
|
||||||
raise Exception, "Version requirement not met (needs 1.2.0 or better)"
|
raise Exception, "Version requirement not met (needs 1.3.1 or better)"
|
||||||
|
|
||||||
|
|
||||||
def _allow_all(root, path, pool):
|
def _allow_all(root, path, pool):
|
||||||
|
@ -84,32 +84,28 @@ def _compare_paths(path1, path2):
|
||||||
return cmp(char1, char2)
|
return cmp(char1, char2)
|
||||||
|
|
||||||
|
|
||||||
def _datestr_to_date(datestr, pool):
|
def _datestr_to_date(datestr):
|
||||||
if datestr is None:
|
return datestr and core.svn_time_from_cstring(datestr) / 1000000 or None
|
||||||
return None
|
|
||||||
return core.svn_time_from_cstring(datestr, pool) / 1000000
|
|
||||||
|
|
||||||
|
|
||||||
def _fs_rev_props(fsptr, rev, pool):
|
def _fs_rev_props(fsptr, rev):
|
||||||
author = fs.revision_prop(fsptr, rev, core.SVN_PROP_REVISION_AUTHOR, pool)
|
author = fs.revision_prop(fsptr, rev, core.SVN_PROP_REVISION_AUTHOR)
|
||||||
msg = fs.revision_prop(fsptr, rev, core.SVN_PROP_REVISION_LOG, pool)
|
msg = fs.revision_prop(fsptr, rev, core.SVN_PROP_REVISION_LOG)
|
||||||
date = fs.revision_prop(fsptr, rev, core.SVN_PROP_REVISION_DATE, pool)
|
date = fs.revision_prop(fsptr, rev, core.SVN_PROP_REVISION_DATE)
|
||||||
return date, author, msg
|
return date, author, msg
|
||||||
|
|
||||||
|
|
||||||
def date_from_rev(svnrepos, rev):
|
def date_from_rev(svnrepos, rev):
|
||||||
if (rev < 0) or (rev > svnrepos.youngest):
|
if (rev < 0) or (rev > svnrepos.youngest):
|
||||||
raise vclib.InvalidRevision(rev)
|
raise vclib.InvalidRevision(rev)
|
||||||
datestr = fs.revision_prop(svnrepos.fs_ptr, rev,
|
return _datestr_to_date(fs.revision_prop(svnrepos.fs_ptr, rev,
|
||||||
core.SVN_PROP_REVISION_DATE, svnrepos.pool)
|
core.SVN_PROP_REVISION_DATE))
|
||||||
return _datestr_to_date(datestr, svnrepos.pool)
|
|
||||||
|
|
||||||
|
|
||||||
def get_location(svnrepos, path, rev, old_rev):
|
def get_location(svnrepos, path, rev, old_rev):
|
||||||
try:
|
try:
|
||||||
results = repos.svn_repos_trace_node_locations(svnrepos.fs_ptr, path,
|
results = repos.svn_repos_trace_node_locations(svnrepos.fs_ptr, path,
|
||||||
rev, [old_rev],
|
rev, [old_rev], _allow_all)
|
||||||
_allow_all, svnrepos.pool)
|
|
||||||
except core.SubversionException, e:
|
except core.SubversionException, e:
|
||||||
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
|
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
|
||||||
raise vclib.ItemNotFound(path)
|
raise vclib.ItemNotFound(path)
|
||||||
|
@ -145,23 +141,19 @@ def last_rev(svnrepos, path, peg_revision, limit_revision=None):
|
||||||
return peg_revision, path
|
return peg_revision, path
|
||||||
elif peg_revision > limit_revision:
|
elif peg_revision > limit_revision:
|
||||||
fsroot = svnrepos._getroot(peg_revision)
|
fsroot = svnrepos._getroot(peg_revision)
|
||||||
history = fs.node_history(fsroot, path, svnrepos.scratch_pool)
|
history = fs.node_history(fsroot, path)
|
||||||
while history:
|
while history:
|
||||||
path, peg_revision = fs.history_location(history,
|
path, peg_revision = fs.history_location(history)
|
||||||
svnrepos.scratch_pool);
|
|
||||||
if peg_revision <= limit_revision:
|
if peg_revision <= limit_revision:
|
||||||
return max(peg_revision, limit_revision), _cleanup_path(path)
|
return max(peg_revision, limit_revision), _cleanup_path(path)
|
||||||
history = fs.history_prev(history, 1, svnrepos.scratch_pool)
|
history = fs.history_prev(history, 1)
|
||||||
return peg_revision, _cleanup_path(path)
|
return peg_revision, _cleanup_path(path)
|
||||||
else:
|
else:
|
||||||
### Warning: this is *not* an example of good pool usage.
|
orig_id = fs.node_id(svnrepos._getroot(peg_revision), path)
|
||||||
orig_id = fs.node_id(svnrepos._getroot(peg_revision), path,
|
|
||||||
svnrepos.scratch_pool)
|
|
||||||
while peg_revision != limit_revision:
|
while peg_revision != limit_revision:
|
||||||
mid = (peg_revision + 1 + limit_revision) / 2
|
mid = (peg_revision + 1 + limit_revision) / 2
|
||||||
try:
|
try:
|
||||||
mid_id = fs.node_id(svnrepos._getroot(mid), path,
|
mid_id = fs.node_id(svnrepos._getroot(mid), path)
|
||||||
svnrepos.scratch_pool)
|
|
||||||
except core.SubversionException, e:
|
except core.SubversionException, e:
|
||||||
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
|
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
|
||||||
cmp = -1
|
cmp = -1
|
||||||
|
@ -179,12 +171,11 @@ def last_rev(svnrepos, path, peg_revision, limit_revision=None):
|
||||||
|
|
||||||
return peg_revision, path
|
return peg_revision, path
|
||||||
finally:
|
finally:
|
||||||
svnrepos._scratch_clear()
|
pass
|
||||||
|
|
||||||
|
|
||||||
def created_rev(svnrepos, full_name, rev):
|
def created_rev(svnrepos, full_name, rev):
|
||||||
fsroot = svnrepos._getroot(rev)
|
return fs.node_created_rev(svnrepos._getroot(rev), full_name)
|
||||||
return fs.node_created_rev(fsroot, full_name, svnrepos.pool)
|
|
||||||
|
|
||||||
|
|
||||||
class Revision(vclib.Revision):
|
class Revision(vclib.Revision):
|
||||||
|
@ -210,27 +201,23 @@ class NodeHistory:
|
||||||
# was copied). This is useful for omitting bubble-up directory
|
# was copied). This is useful for omitting bubble-up directory
|
||||||
# changes.
|
# changes.
|
||||||
if not self.show_all_logs:
|
if not self.show_all_logs:
|
||||||
rev_root = fs.revision_root(self.fs_ptr, revision, pool)
|
rev_root = fs.revision_root(self.fs_ptr, revision)
|
||||||
changed_paths = fs.paths_changed(rev_root, pool)
|
changed_paths = fs.paths_changed(rev_root)
|
||||||
paths = changed_paths.keys()
|
paths = changed_paths.keys()
|
||||||
if path not in paths:
|
if path not in paths:
|
||||||
# Look for a copied parent
|
# Look for a copied parent
|
||||||
test_path = path
|
test_path = path
|
||||||
found = 0
|
found = 0
|
||||||
subpool = core.svn_pool_create(pool)
|
|
||||||
while 1:
|
while 1:
|
||||||
core.svn_pool_clear(subpool)
|
|
||||||
off = string.rfind(test_path, '/')
|
off = string.rfind(test_path, '/')
|
||||||
if off < 0:
|
if off < 0:
|
||||||
break
|
break
|
||||||
test_path = test_path[0:off]
|
test_path = test_path[0:off]
|
||||||
if test_path in paths:
|
if test_path in paths:
|
||||||
copyfrom_rev, copyfrom_path = \
|
copyfrom_rev, copyfrom_path = fs.copied_from(rev_root, test_path)
|
||||||
fs.copied_from(rev_root, test_path, subpool)
|
|
||||||
if copyfrom_rev >= 0 and copyfrom_path:
|
if copyfrom_rev >= 0 and copyfrom_path:
|
||||||
found = 1
|
found = 1
|
||||||
break
|
break
|
||||||
core.svn_pool_destroy(subpool)
|
|
||||||
if not found:
|
if not found:
|
||||||
return
|
return
|
||||||
self.histories[revision] = _cleanup_path(path)
|
self.histories[revision] = _cleanup_path(path)
|
||||||
|
@ -241,7 +228,7 @@ def _get_history(svnrepos, full_name, rev, options={}):
|
||||||
show_all_logs = options.get('svn_show_all_dir_logs', 0)
|
show_all_logs = options.get('svn_show_all_dir_logs', 0)
|
||||||
if not show_all_logs:
|
if not show_all_logs:
|
||||||
# See if the path is a file or directory.
|
# See if the path is a file or directory.
|
||||||
kind = fs.check_path(fsroot, full_name, svnrepos.pool)
|
kind = fs.check_path(fsroot, full_name)
|
||||||
if kind is core.svn_node_file:
|
if kind is core.svn_node_file:
|
||||||
show_all_logs = 1
|
show_all_logs = 1
|
||||||
|
|
||||||
|
@ -253,7 +240,7 @@ def _get_history(svnrepos, full_name, rev, options={}):
|
||||||
|
|
||||||
# Get the history items for PATH.
|
# Get the history items for PATH.
|
||||||
repos.svn_repos_history(svnrepos.fs_ptr, full_name, history.add_history,
|
repos.svn_repos_history(svnrepos.fs_ptr, full_name, history.add_history,
|
||||||
1, rev, cross_copies, svnrepos.pool)
|
1, rev, cross_copies)
|
||||||
return history.histories
|
return history.histories
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,9 +261,9 @@ def get_revision_info(svnrepos, rev):
|
||||||
fsroot = svnrepos._getroot(rev)
|
fsroot = svnrepos._getroot(rev)
|
||||||
|
|
||||||
# Get the changes for the revision
|
# Get the changes for the revision
|
||||||
editor = repos.ChangeCollector(svnrepos.fs_ptr, fsroot, svnrepos.pool)
|
editor = repos.ChangeCollector(svnrepos.fs_ptr, fsroot)
|
||||||
e_ptr, e_baton = delta.make_editor(editor, svnrepos.pool)
|
e_ptr, e_baton = delta.make_editor(editor)
|
||||||
repos.svn_repos_replay(fsroot, e_ptr, e_baton, svnrepos.pool)
|
repos.svn_repos_replay(fsroot, e_ptr, e_baton)
|
||||||
changes = editor.get_changes()
|
changes = editor.get_changes()
|
||||||
changedpaths = {}
|
changedpaths = {}
|
||||||
|
|
||||||
|
@ -330,23 +317,23 @@ def get_revision_info(svnrepos, rev):
|
||||||
|
|
||||||
# Now get the revision property info. Would use
|
# Now get the revision property info. Would use
|
||||||
# editor.get_root_props(), but something is broken there...
|
# editor.get_root_props(), but something is broken there...
|
||||||
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev, svnrepos.pool)
|
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev)
|
||||||
date = _datestr_to_date(datestr, svnrepos.pool)
|
date = _datestr_to_date(datestr)
|
||||||
|
|
||||||
return date, author, msg, change_items
|
return date, author, msg, change_items
|
||||||
|
|
||||||
|
|
||||||
def _log_helper(svnrepos, rev, path, pool):
|
def _log_helper(svnrepos, rev, path):
|
||||||
rev_root = fs.revision_root(svnrepos.fs_ptr, rev, pool)
|
rev_root = fs.revision_root(svnrepos.fs_ptr, rev)
|
||||||
|
|
||||||
# Was this path@rev the target of a copy?
|
# Was this path@rev the target of a copy?
|
||||||
copyfrom_rev, copyfrom_path = fs.copied_from(rev_root, path, pool)
|
copyfrom_rev, copyfrom_path = fs.copied_from(rev_root, path)
|
||||||
|
|
||||||
# Assemble our LogEntry
|
# Assemble our LogEntry
|
||||||
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev, pool)
|
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev)
|
||||||
date = _datestr_to_date(datestr, pool)
|
date = _datestr_to_date(datestr)
|
||||||
if fs.is_file(rev_root, path, pool):
|
if fs.is_file(rev_root, path):
|
||||||
size = fs.file_length(rev_root, path, pool)
|
size = fs.file_length(rev_root, path)
|
||||||
else:
|
else:
|
||||||
size = None
|
size = None
|
||||||
entry = Revision(rev, date, author, msg, size, path,
|
entry = Revision(rev, date, author, msg, size, path,
|
||||||
|
@ -355,11 +342,11 @@ def _log_helper(svnrepos, rev, path, pool):
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
|
||||||
def _fetch_log(svnrepos, full_name, which_rev, options, pool):
|
def _fetch_log(svnrepos, full_name, which_rev, options):
|
||||||
revs = []
|
revs = []
|
||||||
|
|
||||||
if options.get('svn_latest_log', 0):
|
if options.get('svn_latest_log', 0):
|
||||||
rev = _log_helper(svnrepos, which_rev, full_name, pool)
|
rev = _log_helper(svnrepos, which_rev, full_name)
|
||||||
if rev:
|
if rev:
|
||||||
revs.append(rev)
|
revs.append(rev)
|
||||||
else:
|
else:
|
||||||
|
@ -367,52 +354,45 @@ def _fetch_log(svnrepos, full_name, which_rev, options, pool):
|
||||||
history_revs = history_set.keys()
|
history_revs = history_set.keys()
|
||||||
history_revs.sort()
|
history_revs.sort()
|
||||||
history_revs.reverse()
|
history_revs.reverse()
|
||||||
subpool = core.svn_pool_create(pool)
|
|
||||||
for history_rev in history_revs:
|
for history_rev in history_revs:
|
||||||
core.svn_pool_clear(subpool)
|
rev = _log_helper(svnrepos, history_rev, history_set[history_rev])
|
||||||
rev = _log_helper(svnrepos, history_rev, history_set[history_rev],
|
|
||||||
subpool)
|
|
||||||
if rev:
|
if rev:
|
||||||
revs.append(rev)
|
revs.append(rev)
|
||||||
core.svn_pool_destroy(subpool)
|
|
||||||
return revs
|
return revs
|
||||||
|
|
||||||
|
|
||||||
def _get_last_history_rev(fsroot, path, pool):
|
def _get_last_history_rev(fsroot, path):
|
||||||
history = fs.node_history(fsroot, path, pool)
|
history = fs.node_history(fsroot, path)
|
||||||
history = fs.history_prev(history, 0, pool)
|
history = fs.history_prev(history, 0)
|
||||||
history_path, history_rev = fs.history_location(history, pool);
|
history_path, history_rev = fs.history_location(history)
|
||||||
return history_rev
|
return history_rev
|
||||||
|
|
||||||
|
|
||||||
def get_logs(svnrepos, full_name, rev, files):
|
def get_logs(svnrepos, full_name, rev, files):
|
||||||
fsroot = svnrepos._getroot(rev)
|
fsroot = svnrepos._getroot(rev)
|
||||||
subpool = core.svn_pool_create(svnrepos.pool)
|
|
||||||
for file in files:
|
for file in files:
|
||||||
core.svn_pool_clear(subpool)
|
|
||||||
path = _fs_path_join(full_name, file.name)
|
path = _fs_path_join(full_name, file.name)
|
||||||
rev = _get_last_history_rev(fsroot, path, subpool)
|
rev = _get_last_history_rev(fsroot, path)
|
||||||
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev, subpool)
|
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev)
|
||||||
date = _datestr_to_date(datestr, subpool)
|
date = _datestr_to_date(datestr)
|
||||||
file.rev = str(rev)
|
file.rev = str(rev)
|
||||||
file.date = date
|
file.date = date
|
||||||
file.author = author
|
file.author = author
|
||||||
file.log = msg
|
file.log = msg
|
||||||
if file.kind == vclib.FILE:
|
if file.kind == vclib.FILE:
|
||||||
file.size = fs.file_length(fsroot, path, subpool)
|
file.size = fs.file_length(fsroot, path)
|
||||||
core.svn_pool_destroy(subpool)
|
|
||||||
|
|
||||||
|
|
||||||
def get_youngest_revision(svnrepos):
|
def get_youngest_revision(svnrepos):
|
||||||
return svnrepos.youngest
|
return svnrepos.youngest
|
||||||
|
|
||||||
def temp_checkout(svnrepos, path, rev, pool):
|
def temp_checkout(svnrepos, path, rev):
|
||||||
"""Check out file revision to temporary file"""
|
"""Check out file revision to temporary file"""
|
||||||
temp = tempfile.mktemp()
|
temp = tempfile.mktemp()
|
||||||
fp = open(temp, 'wb')
|
fp = open(temp, 'wb')
|
||||||
try:
|
try:
|
||||||
root = svnrepos._getroot(rev)
|
root = svnrepos._getroot(rev)
|
||||||
stream = fs.file_contents(root, path, pool)
|
stream = fs.file_contents(root, path)
|
||||||
try:
|
try:
|
||||||
while 1:
|
while 1:
|
||||||
chunk = core.svn_stream_read(stream, core.SVN_STREAM_CHUNK_SIZE)
|
chunk = core.svn_stream_read(stream, core.SVN_STREAM_CHUNK_SIZE)
|
||||||
|
@ -426,14 +406,10 @@ def temp_checkout(svnrepos, path, rev, pool):
|
||||||
return temp
|
return temp
|
||||||
|
|
||||||
class FileContentsPipe:
|
class FileContentsPipe:
|
||||||
def __init__(self, root, path, pool):
|
def __init__(self, root, path):
|
||||||
self._pool = core.svn_pool_create(pool)
|
self._stream = fs.file_contents(root, path)
|
||||||
self._stream = fs.file_contents(root, path, self._pool)
|
|
||||||
self._eof = 0
|
self._eof = 0
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
core.svn_pool_destroy(self._pool)
|
|
||||||
|
|
||||||
def read(self, len=None):
|
def read(self, len=None):
|
||||||
chunk = None
|
chunk = None
|
||||||
if not self._eof:
|
if not self._eof:
|
||||||
|
@ -458,8 +434,7 @@ class FileContentsPipe:
|
||||||
def readline(self):
|
def readline(self):
|
||||||
chunk = None
|
chunk = None
|
||||||
if not self._eof:
|
if not self._eof:
|
||||||
chunk, self._eof = core.svn_stream_readline(self._stream, '\n',
|
chunk, self._eof = core.svn_stream_readline(self._stream, '\n')
|
||||||
self._pool)
|
|
||||||
if not self._eof:
|
if not self._eof:
|
||||||
chunk = chunk + '\n'
|
chunk = chunk + '\n'
|
||||||
if not chunk:
|
if not chunk:
|
||||||
|
@ -540,8 +515,6 @@ class SubversionRepository(vclib.Repository):
|
||||||
raise vclib.ReposNotFound(name)
|
raise vclib.ReposNotFound(name)
|
||||||
|
|
||||||
# Initialize some stuff.
|
# Initialize some stuff.
|
||||||
self.pool = None
|
|
||||||
self.apr_init = 0
|
|
||||||
self.rootpath = rootpath
|
self.rootpath = rootpath
|
||||||
self.name = name
|
self.name = name
|
||||||
self.svn_client_path = utilities.svn or 'svn'
|
self.svn_client_path = utilities.svn or 'svn'
|
||||||
|
@ -564,37 +537,16 @@ class SubversionRepository(vclib.Repository):
|
||||||
# isn't the main one. We'll just not care.
|
# isn't the main one. We'll just not care.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Initialize APR and get our top-level pool.
|
|
||||||
core.apr_initialize()
|
|
||||||
self.apr_init = 1
|
|
||||||
self.pool = core.svn_pool_create(None)
|
|
||||||
self.scratch_pool = core.svn_pool_create(self.pool)
|
|
||||||
|
|
||||||
# Open the repository and init some other variables.
|
# Open the repository and init some other variables.
|
||||||
self.repos = repos.svn_repos_open(rootpath, self.pool)
|
self.repos = repos.svn_repos_open(rootpath)
|
||||||
self.fs_ptr = repos.svn_repos_fs(self.repos)
|
self.fs_ptr = repos.svn_repos_fs(self.repos)
|
||||||
self.youngest = fs.youngest_rev(self.fs_ptr, self.pool)
|
self.youngest = fs.youngest_rev(self.fs_ptr)
|
||||||
self._fsroots = {}
|
self._fsroots = {}
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self._close()
|
|
||||||
|
|
||||||
def _close(self):
|
|
||||||
if self.pool:
|
|
||||||
core.svn_pool_destroy(self.pool)
|
|
||||||
self.pool = None
|
|
||||||
if self.apr_init:
|
|
||||||
core.apr_terminate()
|
|
||||||
self.apr_init = 0
|
|
||||||
|
|
||||||
def _scratch_clear(self):
|
|
||||||
core.svn_pool_clear(self.scratch_pool)
|
|
||||||
|
|
||||||
def itemtype(self, path_parts, rev):
|
def itemtype(self, path_parts, rev):
|
||||||
rev = self._getrev(rev)
|
rev = self._getrev(rev)
|
||||||
basepath = self._getpath(path_parts)
|
basepath = self._getpath(path_parts)
|
||||||
kind = fs.check_path(self._getroot(rev), basepath, self.scratch_pool)
|
kind = fs.check_path(self._getroot(rev), basepath)
|
||||||
self._scratch_clear()
|
|
||||||
if kind == core.svn_node_dir:
|
if kind == core.svn_node_dir:
|
||||||
return vclib.DIR
|
return vclib.DIR
|
||||||
if kind == core.svn_node_file:
|
if kind == core.svn_node_file:
|
||||||
|
@ -605,9 +557,8 @@ class SubversionRepository(vclib.Repository):
|
||||||
path = self._getpath(path_parts)
|
path = self._getpath(path_parts)
|
||||||
rev = self._getrev(rev)
|
rev = self._getrev(rev)
|
||||||
fsroot = self._getroot(rev)
|
fsroot = self._getroot(rev)
|
||||||
revision = str(_get_last_history_rev(fsroot, path, self.scratch_pool))
|
revision = str(_get_last_history_rev(fsroot, path))
|
||||||
self._scratch_clear()
|
fp = FileContentsPipe(fsroot, path)
|
||||||
fp = FileContentsPipe(fsroot, path, self.pool)
|
|
||||||
return fp, revision
|
return fp, revision
|
||||||
|
|
||||||
def listdir(self, path_parts, rev, options):
|
def listdir(self, path_parts, rev, options):
|
||||||
|
@ -617,7 +568,7 @@ class SubversionRepository(vclib.Repository):
|
||||||
|
|
||||||
rev = self._getrev(rev)
|
rev = self._getrev(rev)
|
||||||
fsroot = self._getroot(rev)
|
fsroot = self._getroot(rev)
|
||||||
dirents = fs.dir_entries(fsroot, basepath, self.scratch_pool)
|
dirents = fs.dir_entries(fsroot, basepath)
|
||||||
entries = [ ]
|
entries = [ ]
|
||||||
for entry in dirents.values():
|
for entry in dirents.values():
|
||||||
if entry.kind == core.svn_node_dir:
|
if entry.kind == core.svn_node_dir:
|
||||||
|
@ -625,7 +576,6 @@ class SubversionRepository(vclib.Repository):
|
||||||
elif entry.kind == core.svn_node_file:
|
elif entry.kind == core.svn_node_file:
|
||||||
kind = vclib.FILE
|
kind = vclib.FILE
|
||||||
entries.append(vclib.DirEntry(entry.name, kind))
|
entries.append(vclib.DirEntry(entry.name, kind))
|
||||||
self._scratch_clear()
|
|
||||||
return entries
|
return entries
|
||||||
|
|
||||||
def dirlogs(self, path_parts, rev, entries, options):
|
def dirlogs(self, path_parts, rev, entries, options):
|
||||||
|
@ -651,15 +601,12 @@ class SubversionRepository(vclib.Repository):
|
||||||
path = self._getpath(path_parts)
|
path = self._getpath(path_parts)
|
||||||
rev = self._getrev(rev)
|
rev = self._getrev(rev)
|
||||||
|
|
||||||
revs = _fetch_log(self, path, rev, options, self.scratch_pool)
|
revs = _fetch_log(self, path, rev, options)
|
||||||
self._scratch_clear()
|
|
||||||
|
|
||||||
revs.sort()
|
revs.sort()
|
||||||
prev = None
|
prev = None
|
||||||
for rev in revs:
|
for rev in revs:
|
||||||
rev.prev = prev
|
rev.prev = prev
|
||||||
prev = rev
|
prev = rev
|
||||||
|
|
||||||
return revs
|
return revs
|
||||||
|
|
||||||
def annotate(self, path_parts, rev):
|
def annotate(self, path_parts, rev):
|
||||||
|
@ -684,8 +631,8 @@ class SubversionRepository(vclib.Repository):
|
||||||
args = vclib._diff_args(type, options)
|
args = vclib._diff_args(type, options)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
temp1 = temp_checkout(self, p1, r1, self.pool)
|
temp1 = temp_checkout(self, p1, r1)
|
||||||
temp2 = temp_checkout(self, p2, r2, self.pool)
|
temp2 = temp_checkout(self, p2, r2)
|
||||||
info1 = p1, date_from_rev(self, r1), r1
|
info1 = p1, date_from_rev(self, r1), r1
|
||||||
info2 = p2, date_from_rev(self, r2), r2
|
info2 = p2, date_from_rev(self, r2), r2
|
||||||
return vclib._diff_fp(temp1, temp2, info1, info2, self.diff_cmd, args)
|
return vclib._diff_fp(temp1, temp2, info1, info2, self.diff_cmd, args)
|
||||||
|
@ -712,5 +659,5 @@ class SubversionRepository(vclib.Repository):
|
||||||
try:
|
try:
|
||||||
return self._fsroots[rev]
|
return self._fsroots[rev]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
r = self._fsroots[rev] = fs.revision_root(self.fs_ptr, rev, self.pool)
|
r = self._fsroots[rev] = fs.revision_root(self.fs_ptr, rev)
|
||||||
return r
|
return r
|
||||||
|
|
|
@ -24,9 +24,9 @@ from vclib.svn import Revision, ChangedPath, _datestr_to_date, _compare_paths, _
|
||||||
from svn import core, delta, client, wc, ra
|
from svn import core, delta, client, wc, ra
|
||||||
|
|
||||||
|
|
||||||
### Require Subversion 1.3.0 or better. (for svn_ra_get_locations support)
|
### Require Subversion 1.3.1 or better. (for svn_ra_get_locations support)
|
||||||
if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_PATCH) < (1, 3, 0):
|
if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_PATCH) < (1, 3, 1):
|
||||||
raise Exception, "Version requirement not met (needs 1.3.0 or better)"
|
raise Exception, "Version requirement not met (needs 1.3.1 or better)"
|
||||||
|
|
||||||
|
|
||||||
def _rev2optrev(rev):
|
def _rev2optrev(rev):
|
||||||
|
|
Loading…
Reference in New Issue