bzrlib and branch discovery

Gabriel Filion lelutin at gmail.com
Sat Aug 7 09:22:24 BST 2010


On 2010-08-07 00:27, Maritza Mendez wrote:
> On Fri, Aug 6, 2010 at 6:49 PM, Gabriel Filion <lelutin at gmail.com> wrote:
> 
>> Hi,
>>
>> I'm trying my luck on using bzrlib to discover bazaar branches so that I
>> can interact with them.
>>
>> In a shared repository setup as in Launchpad-hosted projects, is it
>> possible to obtain a list of available branches, either using a bzr
>> command, or by directly calling a function from bzrlib? The particular
>> information I need is a list of branches and their last revision.
>>
>> I've tried my luck with the above question this week (with help from
>> people on IRC), and so far I found that 'd =
>> BzrDir.open_containing(some_url)' followed by
>> 'd.find_branches(d.root_transport)' would logically get what I wanted.
>> But it spits out an exception saying that the HTTP transport doesn't
>> support list_dir().
>>
>> Is branch discovery possible at all with repositories hosted via http?
>>
>> --
>> Gabriel Filion
>>
>>
> Gabriel,
> 
> My first post to this group a couple years ago was on almost exactly the
> same question, when I was writing a script to automate backing up branches.
> :)  Will 'bzr branches' do what you need?  Note that 'branches' is part of
> the bzrtools plugin, which is almost certainly installed on your system
> already.  Much easier than using bzrlib, if it does what you need.
> 
> Maritza
> 

Thanks for your reply!

However, bzr branches seems to fair only as good as I could with bzrlib:

$ bzr branches lp:bzr
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
bzr: ERROR: http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/ is
permanently redirected to /~bzr-pqm/bzr/bzr.dev/changes


$ bzr --version
Bazaar (bzr) 2.1.2
  Python interpreter: /usr/bin/python 2.5.4
  Python standard library: /usr/lib/python2.5
  Platform: Linux-2.6.32-5-openvz-686-i686-with-debian-squeeze-sid
  bzrlib: /usr/lib/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/m/.bazaar
  Bazaar log file: /home/m/.bzr.log

Copyright 2005-2010 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY.  bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Bazaar is part of the GNU Project to produce a free operating system.

$ bzr plugins
bzrtools 2.1.0
    Various useful commands for working with bzr.

fastimport 0.9.0dev
    FastImport Plugin

launchpad 2.1.2
    Launchpad.net integration plugin for Bazaar.

netrc_credential_store 2.1.2
    Use ~/.netrc as a credential store for authentication.conf.

news_merge 2.1.2
    Merge hook for bzr's NEWS file.

-- 
Gabriel Filion



More information about the bazaar mailing list