[MERGE/RFC] Use Branch.pull() to update master branch.
Jelmer Vernooij
jelmer at samba.org
Fri Feb 27 16:04:12 GMT 2009
On Wed, 2009-02-25 at 12:07 -0600, John Arbash Meinel wrote:
> Jelmer Vernooij wrote:
> > The attached patch makes the commit code use Branch.pull() to update the
> > master branch when committing to a bound branch.
> >
> > This is required for bzr-svn as it can't update just the repository, it
> > has to update the branch as well. Previously it had some magic in the
> > Repository.fetch() code to handle this, but that is vulnerable to race
> > conditions. (#248289)
> >
> > Is Branch.pull() the right call here, or should I be adding something
> > custom?
> >
> > Cheers,
> >
> > Jelmer
> >
>
> This might be ok. I think the main problem is that we can't update
> self.last_revision until after the data has been fetched to the master.
> So 'new_rev_id' doesn't *exist* in the source branch. So the code
> as-written means that branches must support pull() with a revision that
> is not in their ancestry.
>
> BB:comment
The attached patch adds a new function
Branch.import_last_revision_info() that takes care of this rather than
relying on Branch.pull().
The name is not ideal I think, but the best I could come up with.
Cheers,
Jelmer
--
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: masterbranch-update.diff
Type: text/x-patch
Size: 7236 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090227/d090bd1d/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090227/d090bd1d/attachment.pgp
More information about the bazaar
mailing list