[RFC] Repository copies

John Arbash Meinel john at arbash-meinel.com
Tue Dec 19 18:28:28 GMT 2006


Jelmer Vernooij wrote:
> Hi,
> 
> I've been looking at creating some sort of clone-repository command.
> There are a couple of use cases for this, for example when you'd like to
> mirror a complete Bazaar repository and underlying branches remotely. 
> 
> Another case is the "svn-import" command that is part of bzr-svn. It
> basically mirrors a remote Subversion repository locally. 
> 
> It seems that the easiest way to implement something like this would be
> to add a Repository.find_branches() function. The default implementation
> could simply act like bzrtools' "branches" command does now - scanning
> the filesystem for .bzr directories and trying to open them as branches.
> There could then be a "clone-repository" command, perhaps as part of
> bzrtools at first. 
> 
> Any thoughts on adding Repository.find_branches() ?
> 
> Cheers,
> 
> Jelmer


One of our general statements to this point is that Repository is just a
storage optimization. It isn't strictly required. Sometimes I wonder if
we want to keep that statement, but that is our current policy.

Which means that a function like this should not be hung off of Repository.

It should be a generic function that finds branches that are underneath
a given path. For example it could be something like:

def find_branches_beneath(base_transport):
    """Search for any possible branches underneath the base."""

Now I realize this probably conflicts a little bit with what you are
looking for. Because an SVN Repository would implement this very
differently.

And I'm not sure how git or hg would handle these. git has multiple
branches per working tree + repository pair, monotone has a repository
with multiple branches and each branch can have multiple heads. svn
doesn't really have branches as a real object, though it simulates it
with a naming convention.

So I'm trying to reconcile how we see the world with how other tools
might see the world, and what functionality we would like to see.

So for bzr, this would be better expressed as a 'branch --recursive'
sort of command. Which would copy everything underneath a given url.

Now, that may not be the best mental representation for users.
Certainly, something like 'bzr mirror-repository REMOTE LOCAL' has a
nice mental understanding, or 'copy-repository'.


How well would 'bzr branch --recursive' work for what you have planned?

John
=:->




More information about the bazaar mailing list