launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #03155
Re: Code Import Reviews
On Wed, 2010-04-07 at 15:55 +1200, Michael Hudson wrote:
> On 07/04/10 10:03, Jelmer Vernooij wrote:
> > On Tue, 2010-04-06 at 14:03 +0100, James Westby wrote:
> > The heuristics code in bzr-svn could be used to automatically approve
> > Subversion branches that appear legitimate (I've only seen a few
> > situations where it didn't gets the repository layout right).
> Ah yes, I must get you to tell me or someone else how to do that!
It should be something like this (warning: untested code):
def valid_url(url):
from bzrlib.bzrdir import BzrDir
x = BzrDir.open(url)
repo = x.find_repository()
layout = repo.get_layout()
from bzrlib import urlutils
return layout.is_branch(
urlutils.determine_relative_path(r.transport.base,
x.root_transport.base))
Cheers,
Jelmer
Attachment:
signature.asc
Description: This is a digitally signed message part
References