[MERGE] allow pushing/pulling/branching between branches within a shared repository.

Robert Collins robertc at robertcollins.net
Tue Feb 21 20:57:58 GMT 2006


On Tue, 2006-02-21 at 10:33 -0600, John A Meinel wrote:
> Robert Collins wrote:
> > http://people.ubuntu.com/~robertc/baz2.0/repository new adds pushing and
> > pulling and branching support within shared repositories. (I had tested
> > branches *into* a shared repo but not *within* one.)

> > +++ bzrlib/fetch.py	
> > @@ -80,9 +80,10 @@
> >      """
> >      def __init__(self, to_repository, from_repository, last_revision=None, pb=None):
> >          if to_repository.bzrdir.transport.base == from_repository.bzrdir.transport.base:
> > -            raise Exception("can't fetch from a repository to itself %s, %s" % 
> > -                            (from_repository.bzrdir.transport.base,
> > -                             to_repository.bzrdir.transport.base))
> > +            # check that last_revision is in 'from' and then return a no-operation.
> > +            if last_revision not in (None, NULL_REVISION):
> > +                from_repository.get_revision(last_revision)
> > +            return
> >          self.to_repository = to_repository
> >          self.from_repository = from_repository
> >          # must not mutate self._last_revision as its potentially a shared instance
> > 
> 
> This seems like you will get 'NoSuchRevision' if it doesn't exist. Is
> that the exception you want? I would just expect more of a "if not
> from_repository.has_revision(last_revision): raise NoSuchRevision". But
> I'm guessing the side effect of get_revision() does what you want.

Yes thats exactly it.



> The tests look good. +1 from me (if this hasn't already been merged).

Thanks.

> It is nice to review a patch from you with less than 1000 lines for once. :)

I try :)>

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060222/ab8d9dd3/attachment.pgp 


More information about the bazaar mailing list