[Pkg-bazaar-commits] ./bzr-svn/unstable r346: * New upstream snapshot.
Jelmer Vernooij
jelmer at samba.org
Mon Jun 1 14:59:02 UTC 2009
------------------------------------------------------------
revno: 346
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: unstable
timestamp: Mon 2009-06-01 16:59:02 +0200
message:
* New upstream snapshot.
+ Ignores older versions of tdb.
* Recommend recent version of tdb.
modified:
NEWS
__init__.py
cache/tdbcache.py
commands.py
debian/changelog
debian/control
fetch.py
repository.py
revmeta.py
server.py
setup.py
tests/__init__.py
tests/test_cache.py
tests/test_transport.py
transport.py
------------------------------------------------------------
revno: 220.106.198
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Fri 2009-05-22 19:10:23 +0200
message:
start on 0.6.2
modified:
NEWS
__init__.py
setup.py
------------------------------------------------------------
revno: 220.106.199
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Tue 2009-05-26 10:08:13 +0200
message:
merge bzr svn-serve back into bzr serve --svn.
modified:
NEWS
__init__.py
commands.py
server.py
------------------------------------------------------------
revno: 220.106.200
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Tue 2009-05-26 10:12:32 +0200
message:
Fix svn-serve.
modified:
server.py
------------------------------------------------------------
revno: 220.106.201
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Tue 2009-05-26 11:07:39 +0200
message:
Update help to not mention svn-serve.
modified:
__init__.py
------------------------------------------------------------
revno: 220.106.202
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Wed 2009-05-27 09:43:41 +0200
message:
Cope with unrelated changes being related in the revmeta browser.
modified:
revmeta.py
------------------------------------------------------------
revno: 220.106.203
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Thu 2009-05-28 12:39:48 +0200
message:
Avoid using lstrip.
modified:
server.py
tests/test_transport.py
transport.py
------------------------------------------------------------
revno: 220.106.204
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Thu 2009-05-28 16:27:59 +0200
message:
Implement Repository.reconcile.
modified:
repository.py
------------------------------------------------------------
revno: 220.106.205
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Mon 2009-06-01 15:04:59 +0200
message:
Simplify finding of lhs parent revmeta.
modified:
fetch.py
------------------------------------------------------------
revno: 220.106.206
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.6
timestamp: Mon 2009-06-01 16:51:51 +0200
message:
Avoid breakage with older versions of tdb.
modified:
cache/tdbcache.py
tests/__init__.py
tests/test_cache.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2009-05-22 17:09:26 +0000
+++ b/NEWS 2009-06-01 14:59:02 +0000
@@ -1,3 +1,9 @@
+bzr-svn 0.6.2 UNRELEASED
+
+ FEATURES
+
+ * Integrated "bzr svn-serve" into "bzr serve --svn".
+
bzr-svn 0.6.1 2009-05-22
BUG FIXES
=== modified file '__init__.py'
--- a/__init__.py 2009-05-22 17:09:26 +0000
+++ b/__init__.py 2009-06-01 14:59:02 +0000
@@ -23,7 +23,6 @@
bzr-svn also adds four new commands to Bazaar:
- bzr svn-import
- - bzr svn-serve
- bzr svn-layout
For more information about bzr-svn, see the bzr-svn FAQ.
@@ -35,7 +34,7 @@
# versions ending in 'exp' mean experimental mappings
# versions ending in 'dev' mean development version
# versions ending in 'final' mean release (well tested, etc)
-version_info = (0, 6, 1, 'final', 0)
+version_info = (0, 6, 2, 'dev', 0)
if version_info[3] == 'final':
version_string = '%d.%d.%d' % version_info[:3]
@@ -191,6 +190,15 @@
foreign_vcs_registry.register_lazy("svn", "bzrlib.plugins.svn.mapping",
"foreign_vcs_svn")
+try:
+ from bzrlib.transport import transport_server_registry
+except ImportError:
+ pass
+else:
+ transport_server_registry.register_lazy('svn',
+ 'bzrlib.plugins.svn.server', 'serve_svn',
+ "Subversion svn_ra protocol. (default port: 3690)")
+
_optimizers_registered = False
def lazy_register_optimizers():
"""Register optimizers for fetching between Subversion and Bazaar
@@ -214,8 +222,6 @@
'bzrlib.plugins.svn.commands')
plugin_cmds.register_lazy('cmd_svn_layout', [],
'bzrlib.plugins.svn.commands')
-plugin_cmds.register_lazy('cmd_svn_serve', [],
- 'bzrlib.plugins.svn.commands')
lazy_register_filter_stack_map("svn-keywords",
"bzrlib.plugins.svn.keywords", "create_svn_keywords_filter")
=== modified file 'cache/tdbcache.py'
--- a/cache/tdbcache.py 2009-05-21 17:12:39 +0000
+++ b/cache/tdbcache.py 2009-06-01 14:51:51 +0000
@@ -42,8 +42,7 @@
mapping_registry,
)
-def tdb_open(path):
- return tdb.open(path, 0, tdb.DEFAULT, os.O_RDWR|os.O_CREAT)
+from tdb import open as tdb_open
CACHE_DB_VERSION = 1
@@ -291,7 +290,7 @@
cache_file = os.path.join(self.create_cache_dir(), 'cache.tdb')
assert isinstance(cache_file, str)
if not cachedbs().has_key(cache_file):
- cachedbs()[cache_file] = tdb_open(cache_file)
+ cachedbs()[cache_file] = tdb_open(cache_file, 0, tdb.DEFAULT, os.O_RDWR|os.O_CREAT)
db = cachedbs()[cache_file]
if not "version" in db:
db["version"] = str(CACHE_DB_VERSION)
=== modified file 'commands.py'
--- a/commands.py 2009-05-18 18:38:53 +0000
+++ b/commands.py 2009-05-26 08:08:13 +0000
@@ -267,50 +267,4 @@
branch.get_push_merged_revisions())
-class cmd_svn_serve(Command):
- """Provide access to a Bazaar branch using the Subversion ra_svn protocol.
-
- This command is experimental and doesn't support incremental updates
- properly yet.
- """
- takes_options = [
- Option('inet',
- help='serve on stdin/out for use from inetd or sshd'),
- Option('port',
- help='listen for connections on nominated port of the form '
- '[hostname:]portnumber. Passing 0 as the port number will '
- 'result in a dynamically allocated port.',
- type=str),
- Option('directory',
- help='serve contents of directory',
- type=unicode)
- ]
-
- def run(self, inet=None, port=None, directory=None):
- from bzrlib import (
- trace,
- )
- from bzrlib.plugins.svn import lazy_check_versions
- lazy_check_versions()
- from subvertpy.ra_svn import SVNServer, TCPSVNServer, SVN_PORT
- from bzrlib.plugins.svn.server import BzrServerBackend
- import os
- import sys
-
- trace.warning("server support in bzr-svn is experimental.")
-
- if directory is None:
- directory = os.getcwd()
-
- backend = BzrServerBackend(directory)
- if inet:
- def send_fn(data):
- sys.stdout.write(data)
- sys.stdout.flush()
- server = SVNServer(backend, sys.stdin.read, send_fn,
- self.outf)
- else:
- if port is None:
- port = SVN_PORT
- server = TCPSVNServer(backend, ('0.0.0.0', port), self.outf)
- server.serve()
+
=== modified file 'debian/changelog'
--- a/debian/changelog 2009-05-22 17:09:26 +0000
+++ b/debian/changelog 2009-06-01 14:59:02 +0000
@@ -1,3 +1,11 @@
+bzr-svn (0.6.1+bzr3022-1) unstable; urgency=low
+
+ * New upstream snapshot.
+ + Ignores older versions of tdb.
+ * Recommend recent version of tdb.
+
+ -- Jelmer Vernooij <jelmer at debian.org> Mon, 01 Jun 2009 16:58:02 +0200
+
bzr-svn (0.6.1-1) unstable; urgency=low
* New upstream release.
=== modified file 'debian/control'
--- a/debian/control 2009-05-22 17:09:26 +0000
+++ b/debian/control 2009-06-01 14:59:02 +0000
@@ -13,7 +13,7 @@
Architecture: all
Depends: bzr (>= 1.15~), bzr (<< 1.16~), ${python:Depends}, ${misc:Depends}, python (>= 2.5) | python-pysqlite2, python-subvertpy (>> 0.6.1)
Enhances: bzr, subversion
-Recommends: python-tdb, python-xdg
+Recommends: python-tdb (>= 1.1.2~git20081222), python-xdg
Suggests: bzr-rebase (>= 0.5.0)
Conflicts: bzr-rebase (<< 0.5.0)
XB-Python-Version: ${python:Versions}
=== modified file 'fetch.py'
--- a/fetch.py 2009-05-22 17:09:26 +0000
+++ b/fetch.py 2009-06-01 14:59:02 +0000
@@ -955,14 +955,14 @@
if (m != master_mapping and
not m.is_branch_or_tag(revmeta.branch_path)):
continue
+ lhs_parent_revmeta = revmeta.get_lhs_parent_revmeta(m)
if prefix is not None:
- lhs_parent_revmeta = revmeta.get_lhs_parent_revmeta(m)
if lhs_parent_revmeta is not None and not changes.path_is_child(prefix, lhs_parent_revmeta.branch_path):
# Parent branch path is outside of prefix; we need to
# check manually
self.needed.extend(self.find_mainline(lhs_parent_revmeta.get_foreign_revid(), lhsm))
if lhsm != master_mapping or heads is not None:
- needed_mappings[revmeta.get_lhs_parent_revmeta(m)].add(lhsm)
+ needed_mappings[lhs_parent_revmeta].add(lhsm)
if not revmeta.is_hidden(m):
needs_checking.append((revmeta, m))
self.needed.extend(reversed(self.check_revmetas(needs_checking)))
=== modified file 'repository.py'
--- a/repository.py 2009-05-22 17:09:26 +0000
+++ b/repository.py 2009-06-01 14:59:02 +0000
@@ -404,6 +404,10 @@
self._lock_mode = None
self._clear_cached_state()
+ def reconcile(self, other=None, thorough=False):
+ # TODO: Perhaps run set-svn-revprops here?
+ pass
+
def _clear_cached_state(self, revnum=None):
self._cached_tags = {}
self._cached_revnum = revnum
=== modified file 'revmeta.py'
--- a/revmeta.py 2009-05-22 15:07:07 +0000
+++ b/revmeta.py 2009-05-27 07:43:41 +0000
@@ -1154,10 +1154,7 @@
for bp in self._ancestors.keys():
if not self.under_prefixes(bp, self._prefixes):
del self._ancestors[bp]
- try:
- self._unusual.remove(bp)
- except KeyError:
- pass
+ self._unusual.discard(bp)
changed_bps = set()
deletes = []
@@ -1210,8 +1207,7 @@
# Apply reverse renames and the like for the next round
for new_name, old_name, old_rev in changes.apply_reverse_changes(
self._ancestors.keys(), paths):
- if new_name in self._unusual:
- self._unusual.remove(new_name)
+ self._unusual.discard(new_name)
if old_name is None:
# Didn't exist previously, mark as beginning and remove.
for rev in self._ancestors[new_name]:
@@ -1233,11 +1229,11 @@
self._prefixes, paths):
if old_name is None:
# Didn't exist previously, terminate prefix
- self._prefixes.remove(new_name)
+ self._prefixes.discard(new_name)
if len(self._prefixes) == 0:
return
else:
- self._prefixes.remove(new_name)
+ self._prefixes.discard(new_name)
self._pending_prefixes[old_rev].add(old_name)
self._last_revnum = revnum
=== modified file 'server.py'
--- a/server.py 2009-03-04 14:05:57 +0000
+++ b/server.py 2009-05-28 10:39:48 +0000
@@ -13,23 +13,38 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
"""Subversion server implementation."""
+
+from bzrlib.plugins.svn import lazy_check_versions
+lazy_check_versions()
+
import os
import subvertpy
from subvertpy import properties
+from subvertpy.ra_svn import (
+ SVN_PORT,
+ SVNServer,
+ TCPSVNServer,
+ )
from subvertpy.server import (
ServerBackend,
ServerRepositoryBackend,
)
+import sys
import time
-from bzrlib import urlutils
+from bzrlib import (
+ trace,
+ urlutils,
+ )
from bzrlib.branch import Branch
from bzrlib.inventory import Inventory
from bzrlib.plugins.svn.commit import dir_editor_send_changes
+
def determine_changed_paths(repository, branch_path, rev, revno):
def fixpath(p):
return "%s/%s" % (branch_path, p.encode("utf-8"))
@@ -177,3 +192,25 @@
def open_repository(self, path):
(branch, relpath) = Branch.open_containing(os.path.join(self.rootdir, path))
return RepositoryBackend(branch), relpath
+
+
+def serve_svn(transport, host=None, port=None, inet=False):
+ trace.warning("server support in bzr-svn is experimental.")
+
+ if transport.base.startswith("readonly+"):
+ url = transport.base[len("readonly+"):]
+ path = urlutils.local_path_from_url(url)
+
+ backend = BzrServerBackend(path)
+ if inet:
+ def send_fn(data):
+ sys.stdout.write(data)
+ sys.stdout.flush()
+ server = SVNServer(backend, sys.stdin.read, send_fn)
+ else:
+ if port is None:
+ port = SVN_PORT
+ if host is None:
+ host = '0.0.0.0'
+ server = TCPSVNServer(backend, (host, port))
+ server.serve()
=== modified file 'setup.py'
--- a/setup.py 2009-05-20 15:59:15 +0000
+++ b/setup.py 2009-05-22 17:10:23 +0000
@@ -5,7 +5,7 @@
from distutils.core import setup
import os, sys
-version = (0, 6, 1)
+version = (0, 6, 2)
version_string = ".".join([str(x) for x in version])
setup(name='bzr-svn',
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2009-05-20 16:19:35 +0000
+++ b/tests/__init__.py 2009-06-01 14:59:02 +0000
@@ -63,7 +63,7 @@
def restore_tdb():
tdbcache.tdb_open = self._old_open_tdb
self.addCleanup(restore_tdb)
- tdbcache.tdb_open = lambda path: dict()
+ tdbcache.tdb_open = lambda *args: dict()
def tearDown(self):
TestCaseInTempDir.tearDown(self)
=== modified file 'tests/test_cache.py'
--- a/tests/test_cache.py 2009-05-22 13:07:21 +0000
+++ b/tests/test_cache.py 2009-06-01 14:51:51 +0000
@@ -14,6 +14,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+import os
+
+
from bzrlib.errors import (
NoSuchRevision,
)
@@ -77,7 +80,8 @@
from bzrlib.plugins.svn.cache.tdbcache import LogCache, tdb_open
except ImportError:
raise UnavailableFeature
- self.cache = LogCache(tdb_open("cache.tdb"))
+ import tdb
+ self.cache = LogCache(tdb_open("cache.tdb", 0, tdb.DEFAULT, os.O_RDWR|os.O_CREAT))
class RevidMapCacheTests(object):
@@ -131,7 +135,8 @@
from bzrlib.plugins.svn.cache.tdbcache import RevisionIdMapCache, tdb_open
except ImportError:
raise UnavailableFeature
- self.cache = RevisionIdMapCache(tdb_open("cache.tdb"))
+ import tdb
+ self.cache = RevisionIdMapCache(tdb_open("cache.tdb", 0, tdb.DEFAULT, os.O_RDWR|os.O_CREAT))
class RevInfoCacheTests(object):
@@ -187,7 +192,8 @@
from bzrlib.plugins.svn.cache.tdbcache import RevisionInfoCache, tdb_open
except ImportError:
raise UnavailableFeature
- self.cache = RevisionInfoCache(tdb_open("cache.tdb"))
+ import tdb
+ self.cache = RevisionInfoCache(tdb_open("cache.tdb", 0, tdb.DEFAULT, os.O_RDWR|os.O_CREAT))
class ParentsCacheTests:
@@ -229,4 +235,5 @@
from bzrlib.plugins.svn.cache.tdbcache import ParentsCache, tdb_open
except ImportError:
raise UnavailableFeature
- self.cache = ParentsCache(tdb_open("cache.tdb"))
+ import tdb
+ self.cache = ParentsCache(tdb_open("cache.tdb", 0, tdb.DEFAULT, os.O_RDWR|os.O_CREAT))
=== modified file 'tests/test_transport.py'
--- a/tests/test_transport.py 2009-05-20 16:19:35 +0000
+++ b/tests/test_transport.py 2009-06-01 14:59:02 +0000
@@ -39,6 +39,7 @@
)
class SvnRaTest(SubversionTestCase):
+
def test_open_nonexisting(self):
self.assertRaises(InvalidURL, SvnRaTransport,
"svn+nonexisting://foo/bar")
=== modified file 'transport.py'
--- a/transport.py 2009-05-22 17:09:26 +0000
+++ b/transport.py 2009-06-01 14:59:02 +0000
@@ -99,7 +99,8 @@
else:
creds = None
svnbase = bzr_transport.base
- svnbase = svnbase.lstrip("readonly+")
+ if svnbase.startswith("readonly+"):
+ svnbase = svnbase[len("readonly+"):]
ra_transport = SvnRaTransport(svnbase, credentials=creds)
bzr_transport._svn_ra = ra_transport
return ra_transport
More information about the Pkg-bazaar-commits
mailing list