Mark Hammond | 8 Oct 04:25

Advice for using launchpad cvs mirror on Windows?

I'm in the situation where I have a windows only project using CVS, and I'd
like to be able to take advantage of Launchpad's CVS mirroring service.

My problem is my checkout of the real CVS trunk on windows has windows line
endings, while the CVS imported bzr branch has plain \n line endings.  As a
result, every file in the bzr branch differs compared to the CVS trunk
checkout.

I understand all the reasons why this is happening, and I understand bzr
hopes to land line-ending support at some time in the future, but I'm
wondering if there are any tricks I can use to make this process work for me
in the short term?

Or if not, any update on line-ending support landing in the trunk? :)

Thanks,

Mark

Martin Pool | 8 Oct 03:16

[merge][1.8][#277481] set -DWIN32 when compiling all pyrex extensions

Alexander Belnchenko found this error in
<https://bugs.edge.launchpad.net/bzr/+bug/277481>; this is a
cleaned-up version of the patch attached to that bug.

--
Martin <http://launchpad.net/~mbp/>

John Arbash Meinel | 7 Oct 23:39

btree index pre-reading


I wrote up this document to outline some ideas about having btree
indexes do a bit of "pre-reading". At the moment, they read as 4k pages,
but they never read more than the minimum number of pages to fulfill the
current request.

I thought it might make a decent developer documentation for explaining
why we do it this way, rather than just having an email which explains it.

I'd appreciate any feedback, especially wrt the algorithm itself, as I
plan on implementing the ideas here.

John
=:->
=============================
BTree Index Request Expansion
=============================

This document outlines how we decide to pre-read extra nodes in the btree
index.

Rationale
=========

Because of the latency involved in making a request, it is often better to make
fewer large requests, rather than more small requests, even if some of the
extra data will be wasted. 

(Continue reading)

John Arbash Meinel | 7 Oct 23:22

[MERGE/RFC] Use True/False objects for iter_changes


It seems that bzr-gtk copied the same if/else block that Robert fixed
when he changed the pyrex iter_changes to return 1/0 instead of True/False.

Which means that bzr-gtk breaks if you use the compiled extensions. We
can certainly update bzr-gtk, but we can also play nicely with existing
versions.

For pyrex 0.9.8.5 this should be reasonably fast, as it accesses the
Py_True object directly (rather than looking it up by name). I don't
know if that is true for older versions.

Thoughts?

John
=:->
=== modified file 'bzrlib/_dirstate_helpers_c.pyx'
--- bzrlib/_dirstate_helpers_c.pyx	2008-09-26 05:47:03 +0000
+++ bzrlib/_dirstate_helpers_c.pyx	2008-10-07 21:02:24 +0000
@@ -1239,9 +1239,13 @@
                     else:
                         path_u = self.utf8_decode(path)[0]
                 source_kind = _minikind_to_kind(source_minikind)
+                if content_change:
+                    cchange = True
+                else:
+                    cchange = False
                 return (entry[0][2],
(Continue reading)

Thomas Manson | 7 Oct 19:23

Re: CVS migration help

Hi Brian,
 
on my new system :
 
LANG=en_US.UTF-8
 
thomas <at> home:~/temp/cvsrepo/crf-irp/Ressources/documentation$ ll
total 32
drwxr-xr-x 2 thomas thomas  4096 2008-10-06 18:07 .
drwxr-xr-x 9 thomas thomas  4096 2008-10-06 18:07 ..
-r--r--r-- 1 thomas thomas 23274 2008-01-20 00:56 Sp?cifications.doc,v
thomas <at> home:~/temp/cvsrepo/crf-irp/Ressources/documentation$ ls -N | hexdump -C
00000000  53 70 e9 63 69 66 69 63  61 74 69 6f 6e 73 2e 64  |Sp.cifications.d|
00000010  6f 63 2c 76 0a                                    |oc,v.|
00000015

On my old system, from which the files came from  :
 
 
[root <at> home documentation]# ll
total 24
-r--r--r--  1 paquerette dev 23274 jan 20  2008 Spécifications.doc,v
[root <at> home documentation]# ls -N | hexdump -C
00000000  53 70 e9 63 69 66 69 63  61 74 69 6f 6e 73 2e 64  |Spécifications.d|
00000010  6f 63 2c 76 0a                                    |oc,v.|
00000015
 
>Have you checked that the names in the .dat files actually are encoded in UTF-8?
 
How would  I do that ?
 
 
On my old system, python is too old
 
[root <at> home documentation]# yum info python
==============================================================
WARNING: Additional commands may be required after running yum
==============================================================
Loading "smeserver" plugin
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Installed Packages
Name   : python
Arch   : i386
Version: 2.3.4
Release: 14.4.el4_6.1
Size   : 20 M
Repo   : installed
Summary: An interpreted, interactive, object-oriented programming language.

I'll try to build python from sources and then get bzr...
 
 
On Tue, Oct 7, 2008 at 18:29, Brian de Alwis <bsd <at> cs.ubc.ca> wrote:
Hi Thomas.

On 7-Oct-2008, at 9:03 AM, Thomas Manson wrote:
 unfortunately it crashes in the same way that bzr cvsps-import does :
 
 
thomas <at> home:~/temp/bzr$ cat ../cvs2svn-tmp/git-blob.dat  ../cvs2svn-tmp/git-dump.dat |  bzr fast-import -
bzr: ERROR: exceptions.UnicodeDecodeError: 'utf8' codec can't decode bytes in position 43-45: invalid data

So that indicates bzr thinks that the filenames in the dumpfile are in UTF-8.  Have you checked that the names in the .dat files actually are encoded in UTF-8?  Maybe cvs2svn's dumps aren't re-encoding the filenames?   If not, try fiddling with your LANG/LC_* env vars to match whatever encoding is in use in the file-system  You might get some traction by ensuring your LANG=fr_FR.ISO8859-1, or whatever works on your system.

It might be worth doing an `ls -N | hexdump -C' or something similar to ensure that the filenames are encoded in latin1.

[I tried using cvs2svn to create a dumpfile from a toy project with accents, but gave up after 10 minutes.  I personally used tailor to convert my projects, but none of the files involved accents.]

Brian.

-- 
"Amusement to an observing mind is study." - Benjamin Disraeli


Aaron Bentley | 7 Oct 17:57

RELEASE BzrTools 1.8.0


Hi all,

I'm happy to announce BzrTools 1.8.0

This version is intended to be compatible with the 1.8.x Bazaar
series.  BzrTools is a plugin that provides miscellaneous useful and/or
frivolous functionality for bazaar.

Changes:
* Fix bug #277652
* Enable specifying a target file in run_patch

For more information on BzrTools, please see http://bazaar-vcs.org/BzrTools

BzrTools 1.8.0 is available at:
http://launchpad.net/bzrtools/stable/1.8.0/+download/bzrtools-1.8.0.tar.gz
http://launchpad.net/bzrtools/stable/1.8.0/+download/bzrtools-1.8.0.tar.gz.sig

Enjoy!

Aaron

Jelmer Vernooij | 7 Oct 17:49

What APIs to check versions of?

Hi Rob,

Thanks for providing fixes for those bzrlib.api functions. There doesn't
appear to be a lot of documentation as to of what objects I should check
the API. Can you please comment?

There are a few obvious ones:

bzrlib.config.AuthenticationConfig
bzrlib.config.TreeConfig
bzrlib.config.GlobalConfig
bzrlib.config.LocationConfig
bzrlib.command.Command
bzrlib.option.Option
bzrlib.transport.Transport
bzrlib.bzrdir.BzrDir
bzrlib.bzrdir.BzrDirFormat
bzrlib.bzrdir.Converter
bzrlib.inventory.Inventory
bzrlib.repository.RepositoryFormat
bzrlib.repository.Repository
bzrlib.repository.InterRepository
bzrlib.repository.RootCommitBuilder
bzrlib.branch.Branch
bzrlib.branch.BranchFormat
bzrlib.workingtree.WorkingTree
bzrlib.workingtree.WorkingTreeFormat
bzrlib.revisionspec.RevisionSpec
bzrlib.tag.BasicTags
bzrlib.revision.Revision
bzrlib.registry.Registry
bzrlib.branch.BranchCheckResult
bzrlib.branch.PullResult
bzrlib.lockdir.LockDir
bzrlib.versionedfile.VersionedFiles
bzrlib.revisiontree.RevisionTree

What about e.g. custom log handlers? Should I check bzrlib.log or
bzrlib.log.properties_handler_registry or something else?

What about e.g. utility modules like urlutils? Are those guaranteed to
just never break API? Should I check the API version of each individual
function or perhaps of the module? The latter should be doable, the
first would be very impractical (and tricky to make sure we check for
each function). 

Would it perhaps make sense for the get_.*_api functions to check
recursively up until it finds an object that has an API version set?
E.g. when invoked on bzrlib.branch.Branch, first check
bzrlib.branch.Branch, then bzrlib.branch, then bzrlib.

Cheers,

Jelmer
Ben Finney | 7 Oct 11:12

Project Kenai: vote for Bazaar VCS option

Howdy all,

Sun's “Project Kenai” <URL:http://kenai.com/> is another software
hosting site started recently.

Currently, on their feedback site that allows voting on suggestions,
they have one that's a must-have for me:

    Add Bazaar as a VCS option

    <URL:http://kenai.uservoice.com/pages/general/suggestions/24696>

Please visit and vote to let Sun know that Bazaar hosting would make
Kenai more attractive for you.

Robert Collins | 7 Oct 09:47

[MERGE] Fix two bugs in api versioning support - 279447 and 279451

This tries to make the api support in bzr more suitable for bzr-svn.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: robertc <at> robertcollins.net-20081007064146-\
#   d1w8jhf0zqn1mb3y
# target_branch: http://bazaar-vcs.org/bzr/bzr.dev

# testament_sha1: 7b86672ecc8bc10a0d1fe37ee0a6814f7fc30fcd
# timestamp: 2008-10-07 18:45:03 +1100
# source_branch: http://people.ubuntu.com/~robertc/baz2.0/api

# base_revision_id: pqm <at> pqm.ubuntu.com-20081006223227-11nq4m186th9ljeq
# 
# Begin patch
=== modified file 'NEWS'
--- NEWS	2008-10-03 00:18:15 +0000
+++ NEWS	2008-10-07 06:41:46 +0000
@@ -79,6 +79,12 @@
 
   BUG FIXES:
 
+    * API versioning support now has a multiple-version checking api
+      ``require_any_api``. (Robert Collins, #279447)
+
+    * A failure to load a plugin due to an IncompatibleAPI exception is
+      now correctly reported. (Robert Collins, #279451)
+
     * Branching from a shared repository on a smart server into a new
       repository now preserves the repository format.
       (Andrew Bennetts, #269214)

=== modified file 'bzrlib/api.py'
--- bzrlib/api.py	2007-06-26 08:52:20 +0000
+++ bzrlib/api.py	2008-10-07 04:51:25 +0000
@@ -80,3 +80,24 @@
     minimum = get_minimum_api_version(object_with_api)
     if wanted_api < minimum or wanted_api > current:
         raise IncompatibleAPI(object_with_api, wanted_api, minimum, current)
+
+def require_any_api(object_with_api, wanted_api_list):
+    """Check if object_with_api supports the api version wanted_api.
+
+    :param object_with_api: An object which exports an API minimum and current
+        version. See get_minimum_api_version and get_current_api_version for
+        details.
+    :param wanted_api: A list of API versions, any of which being available is
+        sufficent.
+    :return None:
+    :raises IncompatibleAPI: When the wanted_api is not supported by
+        object_with_api.
+
+    Added in bzrlib 1.9.
+    """
+    for api in wanted_api_list[:-1]:
+        try:
+            return require_api(object_with_api, api)
+        except IncompatibleAPI:
+            pass
+    require_api(object_with_api, wanted_api_list[-1])

=== modified file 'bzrlib/plugin.py'
--- bzrlib/plugin.py	2008-09-08 12:59:00 +0000
+++ bzrlib/plugin.py	2008-10-07 06:41:46 +0000
@@ -43,6 +43,7 @@
 from bzrlib import (
     config,
     debug,
+    errors,
     osutils,
     trace,
     )
@@ -172,7 +173,10 @@
 
 
 def load_from_dir(d):
-    """Load the plugins in directory d."""
+    """Load the plugins in directory d.
+    
+    d must be in the plugins module path already.
+    """
     # Get the list of valid python suffixes for __init__.py?
     # this includes .py, .pyc, and .pyo (depending on if we are running -O)
     # but it doesn't include compiled modules (.so, .dll, etc)
@@ -210,7 +214,13 @@
             exec "import bzrlib.plugins.%s" % name in {}
         except KeyboardInterrupt:
             raise
+        except errors.IncompatibleAPI, e:
+            trace.warning("Unable to load plugin %r. It requested API version "
+                "%s of module %s but the minimum exported version is %s, and "
+                "the maximum is %s" %
+                (name, e.wanted, e.api, e.minimum, e.current))
         except Exception, e:
+            trace.warning("%s" % e)
             ## import pdb; pdb.set_trace()
             if re.search('\.|-| ', name):
                 sanitised_name = re.sub('[-. ]', '_', name)

=== modified file 'bzrlib/tests/test_api.py'
--- bzrlib/tests/test_api.py	2007-06-26 08:52:20 +0000
+++ bzrlib/tests/test_api.py	2008-10-07 04:51:25 +0000
@@ -71,6 +71,31 @@
         self.assertEqual(bzrlib.version_info[0:3],
             bzrlib.api.get_current_api_version(an_object))
 
+    def test_require_any_api_wanted_one(self):
+        an_object = TrivialObject()
+        an_object.api_minimum_version = (1, 2, 3)
+        an_object.api_current_version = (4, 5, 6)
+        bzrlib.api.require_any_api(an_object, [(1, 2, 3)])
+
+    def test_require_any_api_wanted_first_compatible(self):
+        an_object = TrivialObject()
+        an_object.api_minimum_version = (1, 2, 3)
+        an_object.api_current_version = (4, 5, 6)
+        bzrlib.api.require_any_api(an_object, [(1, 2, 3), (5, 6, 7)])
+
+    def test_require_any_api_wanted_second_compatible(self):
+        an_object = TrivialObject()
+        an_object.api_minimum_version = (1, 2, 3)
+        an_object.api_current_version = (4, 5, 6)
+        bzrlib.api.require_any_api(an_object, [(5, 6, 7), (1, 2, 3)])
+
+    def test_require_any_api_wanted_none_compatible(self):
+        an_object = TrivialObject()
+        an_object.api_minimum_version = (1, 2, 3)
+        an_object.api_current_version = (4, 5, 6)
+        self.assertRaises(IncompatibleAPI, bzrlib.api.require_any_api,
+            an_object, [(1, 2, 2), (5, 6, 7)])
+
     def test_require_api_wanted_is_minimum_is_ok(self):
         an_object = TrivialObject()
         an_object.api_minimum_version = (1, 2, 3)

=== modified file 'bzrlib/tests/test_plugins.py'
--- bzrlib/tests/test_plugins.py	2008-08-11 12:50:16 +0000
+++ bzrlib/tests/test_plugins.py	2008-10-07 06:41:46 +0000
@@ -193,30 +193,60 @@
                 del bzrlib.plugins.ts_plugin
         self.failIf(getattr(bzrlib.plugins, 'ts_plugin', None))
 
-    def test_plugin_with_bad_name_does_not_load(self):
-        # Create badly-named plugin
-        file('bzr-bad plugin-name..py', 'w').close()
-
+    def load_and_capture(self, name):
+        """Load plugins from '.' capturing the output.
+        
+        :param name: The name of the plugin.
+        :return: A string with the log from the plugin loading call.
+        """
         # Capture output
         stream = StringIO()
-        handler = logging.StreamHandler(stream)
-        log = logging.getLogger('bzr')
-        log.addHandler(handler)
-
-        bzrlib.plugin.load_from_dir('.')
-
-        # Stop capturing output
-        handler.flush()
-        handler.close()
-        log.removeHandler(handler)
-
-        self.assertContainsRe(stream.getvalue(),
+        try:
+            handler = logging.StreamHandler(stream)
+            log = logging.getLogger('bzr')
+            log.addHandler(handler)
+            try:
+                try:
+                    bzrlib.plugin.load_from_path(['.'])
+                finally:
+                    if 'bzrlib.plugins.%s' % name in sys.modules:
+                        del sys.modules['bzrlib.plugins.%s' % name]
+                    if getattr(bzrlib.plugins, name, None):
+                        delattr(bzrlib.plugins, name)
+            finally:
+                # Stop capturing output
+                handler.flush()
+                handler.close()
+                log.removeHandler(handler)
+            return stream.getvalue()
+        finally:
+            stream.close()
+    
+    def test_plugin_with_bad_api_version_reports(self):
+        # This plugin asks for bzrlib api version 1.0.0, which is not supported
+        # anymore.
+        name = 'wants100.py'
+        f = file(name, 'w')
+        try:
+            f.write("import bzrlib.api\n"
+                "bzrlib.api.require_any_api(bzrlib, [(1, 0, 0)])\n")
+        finally:
+            f.close()
+
+        log = self.load_and_capture(name)
+        self.assertContainsRe(log,
+            r"It requested API version")
+
+    def test_plugin_with_bad_name_does_not_load(self):
+        # The file name here invalid for a python module.
+        name = 'bzr-bad plugin-name..py'
+        file(name, 'w').close()
+        log = self.load_and_capture(name)
+        self.assertContainsRe(log,
             r"Unable to load 'bzr-bad plugin-name\.' in '\.' as a plugin "
             "because the file path isn't a valid module name; try renaming "
             "it to 'bad_plugin_name_'\.")
 
-        stream.close()
-
 
 class TestPlugins(TestCaseInTempDir):
 

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRFoFCQACPj/gHRURABb////
f////v////BgEB9vapYMbbZaKZVSgBTVXcW7sYa1FVUqqqSoqoSUVbMNKJoDQADIAAAAABoABoAA
ASkE1PCammBAqfpphU2Kep+inqaAaB6mh6npB6g9T1D1PRBwZBo0AZNMQ00GQYhhA0BoxMRoAABI
kRqek1PU9BNTxJhD0ImptlG0nomKeU8p6TTynpDTTJtIehwZBo0AZNMQ00GQYhhA0BoxMRoAAAqi
ECATCAyE0Ggmg1G1NG0JlDJmUekaGnqHlNkI3kSREc0cEw7XHlXsd3b2393d546GTuqmeEpO/8vW
m+qfsKFNa2uRapR5q7CbWqXltUtHqjZ4/up5BO7UyQYJHyeXnIV9pokrnnr+2yCbY4cPFxio55Fr
kvwlf+Ol8X+du1EiRZL5lOrw4ONdPkx88zD+eQYSkimRcrL5Fd1ncoa4rksnhdQeR2qO9wylzAJI
LVAj8vDk5O9b+vefl1+OKkJkl0PK15x/wjqRI2k2NptjtL+gRblN1CRZ+WXTZretlMqCzbfYG3tq
c/9lkpFErpKdtl1kVsJzidAti4kIs4rTIMi6a4dDWNhz+nXHz+K/irfbAldTs6/qbbqP4mD+SHfE
MVrBb0ITq8GdVGvGuNj7daqHUU2UsKZui9mJ3juxJ7HcjDqgg2HZZjq6671CbOOROm6Z48xWNvdL
iuW9o5hvcuBJdq7XWaWqevFaKvU2VHnnRlVcmOpLQUlEC6MsTLqIwYvREF0unY1qlKGP4RKZ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ZYTaBi1IAkzwQguGK
cEARgfndovu3iPhHEFyVzEIoJQUSIFKIAN8PUTOs1wlaJbty+uv5dW5dgxfcGoQBpDQwT4V24nuh
6qwxGUvtPjgMExEJmIboHCUIyro/q+45S0qV4GC4+0EkLL3JJX2rxYDEUS3wvXHnMuCy1VsXqih8
T4lSPdbhhA+jIjviERr04RG76tM3E1MInO6i9PcHEOvMj3hTFVMwmHAVW+iDhQa0Rs9y/nObdWPn
fs3DMRYP8L6TGnputqTCln6VNMxw44MoRvxj9zDAul0ojliZV7HPWMxJIc60rEyof61/jq2p633F
yOxKKvHm9m7Rubft/gdUDGIuNz82xrjX5EUipMVrCkeEBo8Y1dwti/zhglnUJiRwsIBoQDBg0MBo
qhnx5LA5i3RTufzsVpJzg8Iykt60m4Z3WR6yAQUdWH77mW1KxKeOKqus59pw90R7o7HY44xwdXSs
PBmGKjnIwSSmUpCYsjThqI/DpUrzA1fUkMdWkr0LHdgZmE2aK3dQXBq0RDUekwc7HDUktf+6pRaI
iLXWFY4tzQZ1pxjGa0M1KxHykWMkWosil6A3XlLJXTKG94OvamUeWlCNRqzz+BQWXTEduy+DQWJ4
ZW5ro6MUKWIsTSM2FitdmxT928popEAuXOdZga7AzKqVYYCuJc+M9jd9zZ8qsRCSqI/VdDifrQZS
0MiO3W9I1pRTGj2m+bT0YSPX/SMTGMKwKp4ED1LT2lrOwcaAziIM4NO4b6OUE29546dcxMYRYbCx
YV/Z49htlHimPZ9+2KlzrlVB/SO+fGORy8uRdCUPJSL1piUpvLyKtV0CvnfYy7vT9dXq251nSznC
gLgWhIJ4/uLuSKcKEgItAoSA
Martin Pool | 7 Oct 07:13

[merge] don't treat enoent from readdir as indicating eof

As a follow on from my previous patch, this makes ENOENT from readdir
just be treated as a regular error.

I can't find any clear indication on the web of what would be the
correct way to handle it, and it seems unlikely that it will be
raised.  I think if we were seeing it before, it probably was because
of bug 279381.  It seems to me that unless we specifically know that
it indicates the end of the directory, it's unsafe to treat it as
such.   If we merge this change and it causes a real exception, we can
find out more about situations where it does occur.

=== modified file 'bzrlib/_readdir_pyx.pyx'
--- bzrlib/_readdir_pyx.pyx     2008-10-07 04:39:43 +0000
+++ bzrlib/_readdir_pyx.pyx     2008-10-07 05:13:20 +0000
@@ -301,15 +301,10 @@
                 else:
                     break
             if entry == NULL:
-                if errno == ENOTDIR or errno == ENOENT or errno == 0:
+                if errno == ENOTDIR or errno == 0:
                     # We see ENOTDIR at the end of a normal directory.
                     # As ENOTDIR for read_dir(file) is triggered on opendir,
                     # we consider ENOTDIR to be 'no error'.
-                    #
-                    # XXX: ENOENT is listed as 'invalid position in
the dir stream' for
-                    # readdir.  It's not clear what we should do about that
-                    # case; at the moment we treat it as the end of the
-                    # directory.
                     continue
                 else:
                     raise OSError(errno, strerror(errno))

Martin Pool | 7 Oct 05:26

[merge][#279381] correct calls to readdir from pyrex

This fixes https://bugs.edge.launchpad.net/bzr/+bug/279381 plus one
nearby bonus bug.

If the system call is interrupted with eintr or eagain, the previous
code would incorrectly assume that it was at the end of the directory,
but in fact it should continue reading.  It's probably unlikely this
would be hit, but if it was then it might cause us to think some files
had disappeared.  (There might have been a bug report of this.)

--

-- 
Martin <http://launchpad.net/~mbp/>

Gmane