[MERGE] Update Branch.pull() to search less history
John Arbash Meinel
john at arbash-meinel.com
Sat Dec 1 01:25:36 GMT 2007
It took a bit more to update Branch.pull, so I'm going ahead and posting
the updated patch.
a) Branch.pull() needs to raise DivergedBranches, it turns out the best
way to figure that out is Graph.heads()
b) The original code was written such that when --overwrite was given, it
would do all the work, find out that they had diverged, and then just
override it anyway. Which is a lot of wasteful work.
This changes it so if --overwrite is set, we don't worry about the
ancestries, and just set the tip.
c) Because we now are doing a heads() call rather than just is_ancestor,
it made sense to move the special case code into heads(). It means that
is_ancestor benefits from it as well as any other code that ends up doing
a heads check.
For me, this drops 'bzr pull' in an empty branch (no wt) to 1.5s, the same
for --overwrite. With a single revision, the graph search takes 8s, but
--overwrite skips it to make it 1.5s again. (1s in startup overhead.)
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 13522 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071130/93e1504e/attachment-0001.bin
More information about the bazaar
mailing list