[Pkg-bazaar-commits] ./bzr/unstable r3844: * New upstream release.

Jelmer Vernooij jelmer at samba.org
Tue Jul 21 09:26:37 UTC 2009


------------------------------------------------------------
revno: 3844
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: unstable
timestamp: Tue 2009-07-21 11:26:37 +0200
message:
  * New upstream release.
   + Fixes compatibility with Python 2.4. Closes: #537708
modified:
  Makefile
  NEWS
  bzrlib/__init__.py
  bzrlib/_known_graph_pyx.pyx
  bzrlib/smart/server.py
  bzrlib/tests/blackbox/test_serve.py
  bzrlib/tests/per_intertree/test_compare.py
  debian/changelog
  tools/generate_docs.py
  tools/win32/build_release.py
    ------------------------------------------------------------
    revno: 3815.898.1
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 1.17
    timestamp: Mon 2009-07-13 16:41:52 +0200
    message:
      Delete forgotten debug print.
    modified:
      bzrlib/tests/per_intertree/test_compare.py
    ------------------------------------------------------------
    revno: 3815.899.1
    committer: Jonathan Lange <jml at canonical.com>
    branch nick: remove-print-statement
    timestamp: Tue 2009-07-14 19:08:26 +1000
    message:
      Remove print statement.
    modified:
      bzrlib/tests/per_intertree/test_compare.py
    ------------------------------------------------------------
    revno: 3815.775.97
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.17
    timestamp: Tue 2009-07-14 11:08:45 +0100
    message:
      (vila) Remove print statement from one of the tests.
    modified:
      bzrlib/tests/per_intertree/test_compare.py
    ------------------------------------------------------------
    revno: 3815.775.98
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.17
    timestamp: Tue 2009-07-14 21:42:35 +0100
    message:
      (jam) Use frozenset() instead of PyFrozenSet_New() for py2.4
      	compatibility (bug #399366)
    modified:
      NEWS
      bzrlib/_known_graph_pyx.pyx
        ------------------------------------------------------------
        revno: 3815.900.1
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: jam-integration
        timestamp: Tue 2009-07-14 11:10:32 -0500
        message:
          Avoid using PyFrozenSet_New
          
          it seems it wasn't defined in python2.4
          The 'frozenset()' object is available, just not its C api.
          However, we don't really need the function call, though
          I would expect it to be slightly faster.
        modified:
          bzrlib/_known_graph_pyx.pyx
        ------------------------------------------------------------
        revno: 3815.900.2
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: jam-integration
        timestamp: Tue 2009-07-14 11:12:28 -0500
        message:
          NEWS about fixing bug #399366
        modified:
          NEWS
    ------------------------------------------------------------
    revno: 3815.775.99
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.17
    timestamp: Wed 2009-07-15 04:32:45 +0100
    message:
      (jam) Updates to Makefile and generate_docs.py to build docs on
      	Windows (bug #399356)
    modified:
      Makefile
      NEWS
      tools/generate_docs.py
      tools/win32/build_release.py
        ------------------------------------------------------------
        revno: 3815.901.1
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: jam-integration
        timestamp: Tue 2009-07-14 10:00:14 -0500
        message:
          update the dependency versions of plugins for 1.17rc1
        modified:
          tools/win32/build_release.py
        ------------------------------------------------------------
        revno: 3815.901.2
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: jam-integration
        timestamp: Tue 2009-07-14 10:01:19 -0500
        message:
          instead of updating PYTHONPATH in Makefile, update generate_docs to find bzrlib.
          PYTHONPATH cannot be set portably between OSes (win32 requires ';' separation, versus ':'
          on other platforms.)
          Rather than work out how to get platform independent Makefile, just do it in python.
        modified:
          Makefile
          tools/generate_docs.py
        ------------------------------------------------------------
        revno: 3815.901.3
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: 1.17-build-updates
        timestamp: Tue 2009-07-14 21:32:13 -0500
        message:
          Merge bzr.1.17 tip, and update NEWS about fixing bug #399356
        modified:
          NEWS
          bzrlib/_known_graph_pyx.pyx
    ------------------------------------------------------------
    revno: 3815.775.100
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.17
    timestamp: Mon 2009-07-20 07:45:03 +0100
    message:
      (jml) Cherry pick in fix for bug 400535.
    modified:
      NEWS
      bzrlib/smart/server.py
      bzrlib/tests/blackbox/test_serve.py
        ------------------------------------------------------------
        revno: 3815.902.1
        committer: Jonathan Lange <jml at canonical.com>
        branch nick: last-round-of-1.17
        timestamp: Mon 2009-07-20 15:39:10 +1000
        message:
          Merge in spiv's fix for #400535
        modified:
          NEWS
          bzrlib/smart/server.py
          bzrlib/tests/blackbox/test_serve.py
    ------------------------------------------------------------
    revno: 3815.775.101
    tags: bzr-1.17
    committer: Jonathan Lange <jml at canonical.com>
    branch nick: prepare-1.17
    timestamp: Mon 2009-07-20 17:32:43 +1000
    message:
      Prepare 1.17.
    modified:
      NEWS
      bzrlib/__init__.py
-------------- next part --------------
=== modified file 'Makefile'
--- a/Makefile	2009-06-29 11:02:31 +0000
+++ b/Makefile	2009-07-14 15:01:19 +0000
@@ -169,14 +169,14 @@
 	$(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en)) 
 
 doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
-	PYTHONPATH=.:$$PYTHONPATH $(PYTHON) tools/generate_docs.py -o $@ rstx
+	$(PYTHON) tools/generate_docs.py -o $@ rstx
 
 doc/en/release-notes/NEWS.txt: NEWS
 	$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
 
 MAN_PAGES = man1/bzr.1
 man1/bzr.1: $(MAN_DEPENDENCIES)
-	PYTHONPATH=.:$$PYTHONPATH $(PYTHON) tools/generate_docs.py -o $@ man
+	$(PYTHON) tools/generate_docs.py -o $@ man
 
 # build a png of our performance task list
 # 

=== modified file 'NEWS'
--- a/NEWS	2009-07-13 00:12:04 +0000
+++ b/NEWS	2009-07-20 07:32:43 +0000
@@ -6,8 +6,12 @@
 .. contents:: List of Releases
    :depth: 1
 
-bzr 1.17rc1 "So late it's brunch" 2009-07-13
-############################################
+
+bzr 1.17 "So late it's brunch" 2009-07-20
+#########################################
+:Codename: so-late-its-brunch
+:1.17rc1: 2009-07-13
+:1.17: 2009-07-20
 
 Bazaar continues to blaze a straight and shining path to the 2.0 release and
 the elevation of the ``2a`` beta format to the full glory of "supported and
@@ -19,6 +23,21 @@
 annoying progress bar artifacts.
 
 
+Changes from 1.17rc1 to 1.17final
+*********************************
+
+* Change an extension to call the python ``frozenset()`` rather than the C
+  api ``PyFrozenSet_New``. It turns out that python2.4 did not expose the
+  C api. (John Arbash Meinel, #399366)
+
+* Fixes for the Makefile and the rename of ``generate_docs.py`` to
+  ``tools/generate_docs.py`` to allow everything to be built on Windows.
+  (John Arbash Meinel, #399356)
+
+* ``bzr serve`` once again applies a ``ChrootServer`` to the given
+  directory before serving it. (Andrew Bennetts, #400535)
+
+
 Compatibility Breaks
 ********************
 

=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py	2009-07-13 00:12:04 +0000
+++ b/bzrlib/__init__.py	2009-07-20 07:32:43 +0000
@@ -50,7 +50,7 @@
 # Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
 # releaselevel of 'dev' for unreleased under-development code.
 
-version_info = (1, 17, 0, 'candidate', 1)
+version_info = (1, 17, 0, 'final', 0)
 
 # API compatibility version: bzrlib is currently API compatible with 1.15.
 api_minimum_version = (1, 17, 0)

=== modified file 'bzrlib/_known_graph_pyx.pyx'
--- a/bzrlib/_known_graph_pyx.pyx	2009-06-19 20:35:35 +0000
+++ b/bzrlib/_known_graph_pyx.pyx	2009-07-14 16:10:32 +0000
@@ -25,8 +25,6 @@
     ctypedef struct PyObject:
         pass
 
-    object PyFrozenSet_New(object)
-
     object PyTuple_New(Py_ssize_t n)
     Py_ssize_t PyTuple_GET_SIZE(object t)
     PyObject * PyTuple_GET_ITEM(object t, Py_ssize_t o)
@@ -267,7 +265,7 @@
         cdef Py_ssize_t pos, last_item
         cdef long min_gdfo
 
-        heads_key = PyFrozenSet_New(keys)
+        heads_key = frozenset(keys)
         maybe_heads = PyDict_GetItem(self._known_heads, heads_key)
         if maybe_heads != NULL:
             return <object>maybe_heads
@@ -285,7 +283,7 @@
             if not candidate_nodes:
                 return frozenset([NULL_REVISION])
             # The keys changed, so recalculate heads_key
-            heads_key = PyFrozenSet_New(candidate_nodes)
+            heads_key = frozenset(candidate_nodes)
         if PyDict_Size(candidate_nodes) < 2:
             return heads_key
 
@@ -330,7 +328,7 @@
             node = <_KnownGraphNode>temp_node
             if not node.seen:
                 PyList_Append(heads, node.key)
-        heads = PyFrozenSet_New(heads)
+        heads = frozenset(heads)
         for pos from 0 <= pos < PyList_GET_SIZE(cleanup):
             node = _get_list_node(cleanup, pos)
             node.seen = 0

=== modified file 'bzrlib/smart/server.py'
--- a/bzrlib/smart/server.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/smart/server.py	2009-07-20 05:39:10 +0000
@@ -111,6 +111,8 @@
             pass
         for hook in SmartTCPServer.hooks['server_started']:
             hook(backing_urls, self.get_url())
+        for hook in SmartTCPServer.hooks['server_started_ex']:
+            hook(backing_urls, self)
         self._started.set()
         try:
             try:
@@ -214,6 +216,10 @@
             "where backing_url is a list of URLs giving the "
             "server-specific directory locations, and public_url is the "
             "public URL for the directory being served.", (0, 16), None))
+        self.create_hook(HookPoint('server_started_ex',
+            "Called by the bzr server when it starts serving a directory. "
+            "server_started is called with (backing_urls, server_obj).",
+            (1, 17), None))
         self.create_hook(HookPoint('server_stopped',
             "Called by the bzr server when it stops serving a directory. "
             "server_stopped is called with the same parameters as the "
@@ -313,7 +319,7 @@
     from bzrlib.transport.chroot import ChrootServer
     chroot_server = ChrootServer(transport)
     chroot_server.setUp()
-    t = get_transport(chroot_server.get_url())
+    transport = get_transport(chroot_server.get_url())
     if inet:
         smart_server = medium.SmartServerPipeStreamMedium(
             sys.stdin, sys.stdout, transport)
@@ -322,8 +328,7 @@
             host = medium.BZR_DEFAULT_INTERFACE
         if port is None:
             port = medium.BZR_DEFAULT_PORT
-        smart_server = SmartTCPServer(
-            transport, host=host, port=port)
+        smart_server = SmartTCPServer(transport, host=host, port=port)
         trace.note('listening on port: %s' % smart_server.port)
     # For the duration of this server, no UI output is permitted. note
     # that this may cause problems with blackbox tests. This should be

=== modified file 'bzrlib/tests/blackbox/test_serve.py'
--- a/bzrlib/tests/blackbox/test_serve.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/tests/blackbox/test_serve.py	2009-07-20 05:39:10 +0000
@@ -21,18 +21,22 @@
 import signal
 import subprocess
 import sys
+import thread
 import threading
 
 from bzrlib import (
     errors,
     osutils,
     revision as _mod_revision,
+    transport,
     )
 from bzrlib.branch import Branch
 from bzrlib.bzrdir import BzrDir
 from bzrlib.errors import ParamikoNotPresent
-from bzrlib.smart import medium
+from bzrlib.smart import client, medium
+from bzrlib.smart.server import SmartTCPServer
 from bzrlib.tests import TestCaseWithTransport, TestSkipped
+from bzrlib.trace import mutter
 from bzrlib.transport import get_transport, remote
 
 
@@ -239,3 +243,77 @@
              % bzr_remote_path],
             self.command_executed)
 
+
+class TestCmdServeChrooting(TestCaseWithTransport):
+
+    def test_serve_tcp(self):
+        """'bzr serve' wraps the given --directory in a ChrootServer.
+
+        So requests that search up through the parent directories (like
+        find_repositoryV3) will give "not found" responses, rather than
+        InvalidURLJoin or jail break errors.
+        """
+        t = self.get_transport()
+        t.mkdir('server-root')
+        self.run_bzr_serve_then_func(
+            ['--port', '0', '--directory', t.local_abspath('server-root'),
+             '--allow-writes'],
+            self.when_server_started)
+        # The when_server_started method issued a find_repositoryV3 that should
+        # fail with 'norepository' because there are no repositories inside the
+        # --directory.
+        self.assertEqual(('norepository',), self.client_resp)
+        
+    def run_bzr_serve_then_func(self, serve_args, func, *func_args,
+            **func_kwargs):
+        """Run 'bzr serve', and run the given func in a thread once the server
+        has started.
+        
+        When 'func' terminates, the server will be terminated too.
+        """
+        # install hook
+        def on_server_start(backing_urls, tcp_server):
+            t = threading.Thread(
+                target=on_server_start_thread, args=(tcp_server,))
+            t.start()
+        def on_server_start_thread(tcp_server):
+            try:
+                # Run func
+                self.tcp_server = tcp_server
+                try:
+                    func(*func_args, **func_kwargs)
+                except Exception, e:
+                    # Log errors to make some test failures a little less
+                    # mysterious.
+                    mutter('func broke: %r', e)
+            finally:
+                # Then stop the server
+                mutter('interrupting...')
+                thread.interrupt_main()
+        SmartTCPServer.hooks.install_named_hook(
+            'server_started_ex', on_server_start,
+            'run_bzr_serve_then_func hook')
+        # start a TCP server
+        try:
+            self.run_bzr(['serve'] + list(serve_args))
+        except KeyboardInterrupt:
+            pass
+
+    def when_server_started(self):
+        # Connect to the TCP server and issue some requests and see what comes
+        # back.
+        client_medium = medium.SmartTCPClientMedium(
+            '127.0.0.1', self.tcp_server.port,
+            'bzr://localhost:%d/' % (self.tcp_server.port,))
+        smart_client = client._SmartClient(client_medium)
+        resp = smart_client.call('mkdir', 'foo', '')
+        resp = smart_client.call('BzrDirFormat.initialize', 'foo/')
+        try:
+            resp = smart_client.call('BzrDir.find_repositoryV3', 'foo/')
+        except errors.ErrorFromSmartServer, e:
+            resp = e.error_tuple
+        self.client_resp = resp
+        client_medium.disconnect()
+
+
+

=== modified file 'bzrlib/tests/per_intertree/test_compare.py'
--- a/bzrlib/tests/per_intertree/test_compare.py	2009-07-10 12:40:36 +0000
+++ b/bzrlib/tests/per_intertree/test_compare.py	2009-07-13 14:41:52 +0000
@@ -370,7 +370,6 @@
 
     def check_has_changes(self, expected, tree1, tree2):
         # has_changes is defined for mutable trees only
-        print '\nt1, t2: %r, %r' % (type(tree1), type(tree2))
         if not isinstance(tree2, mutabletree.MutableTree):
             if isinstance(tree1, mutabletree.MutableTree):
                 # Let's switch the trees since has_changes() is commutative

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-07-13 22:52:51 +0000
+++ b/debian/changelog	2009-07-21 09:26:37 +0000
@@ -1,3 +1,10 @@
+bzr (1.17-1) unstable; urgency=low
+
+  * New upstream release.
+   + Fixes compatibility with Python 2.4. Closes: #537708
+
+ -- Jelmer Vernooij <jelmer at debian.org>  Tue, 21 Jul 2009 11:25:12 +0200
+
 bzr (1.17~rc1-1) unstable; urgency=low
 
   * New upstream version.

=== modified file 'tools/generate_docs.py'
--- a/tools/generate_docs.py	2009-06-19 09:27:13 +0000
+++ b/tools/generate_docs.py	2009-07-14 15:01:19 +0000
@@ -32,12 +32,13 @@
 
 Run "%(prog)s --help" for the option reference.
 """
-
-import bzrlib.commands
+import os
 import sys
 from optparse import OptionParser
 
-from bzrlib import doc_generate
+sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
+
+from bzrlib import commands, doc_generate
 
 def main(argv):
     parser = OptionParser(usage="""%prog [options] OUTPUT_FORMAT
@@ -69,8 +70,8 @@
     if len(args) != 2:
         parser.print_help()
         sys.exit(1)
-    
-    bzrlib.commands.install_bzr_command_hooks()
+
+    commands.install_bzr_command_hooks()
 
     infogen_type = args[1]
     infogen_mod = doc_generate.get_module(infogen_type)

=== modified file 'tools/win32/build_release.py'
--- a/tools/win32/build_release.py	2009-06-17 18:11:58 +0000
+++ b/tools/win32/build_release.py	2009-07-14 15:00:14 +0000
@@ -4,12 +4,12 @@
 # When preparing a new release, make sure to set all of these to the latest
 # values.
 VERSIONS = {
-    'bzr': '1.16',
-    'qbzr': '0.11.0',
-    'bzrtools': '1.16.0',
-    'bzr-svn': '0.6.1',
-    'bzr-rebase': '0.5.0',
-    'subvertpy': '0.6.7',
+    'bzr': '1.17',
+    'qbzr': '0.12',
+    'bzrtools': '1.17.0',
+    'bzr-svn': '0.6.3-win32-1',
+    'bzr-rewrite': '0.5.1',
+    'subvertpy': '0.6.8',
 }
 
 # This will be passed to 'make' to ensure we build with the right python
@@ -125,7 +125,7 @@
 
 
 def _plugin_tag_name(plugin_name):
-    if plugin_name in ('bzr-svn', 'bzr-rebase', 'subvertpy'):
+    if plugin_name in ('bzr-svn', 'bzr-rewrite', 'subvertpy'):
         return '%s-%s' % (plugin_name, VERSIONS[plugin_name])
     # bzrtools and qbzr use 'release-X.Y.Z'
     return 'release-' + VERSIONS[plugin_name]
@@ -134,7 +134,7 @@
 def update_plugin(plugin_name):
     release_dir = get_plugin_release_dir(plugin_name)
     if not os.path.isdir(plugin_name):
-        if plugin_name in ('bzr-svn', 'bzr-rebase'):
+        if plugin_name in ('bzr-svn', 'bzr-rewrite'):
             # bzr-svn uses a different repo format
             call_or_fail([bzr(), 'init-repo', '--rich-root-pack', plugin_name])
         else:
@@ -195,7 +195,7 @@
     install_plugin('bzrtools')
     install_plugin('qbzr')
     install_plugin('bzr-svn')
-    install_plugin('bzr-rebase')
+    install_plugin('bzr-rewrite')
 
     build_installer()
 



More information about the Pkg-bazaar-commits mailing list