-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazaar: Use lightweight checkouts rather than a full branch clone #11264
Conversation
20d290e
to
a88ec53
Compare
Hi, I'm personally not familiar with bazaar at all anymore, but I'll note that when these kind of solutions where showing up for git, they were rejected because some use cases rely on having the history available in the cloned repo (e.g. for tools such as setuptools_scm). Could this be an issue for bazaar users too ? |
That's not the case here - you can still access the full history in a lightweight checkout, but it might trigger network activity to retrieve the missing data from the main copy. Even if that is necessary, that's probably going to be faster for things like setuptools-scm since they just need the revision graph - not the contents. |
Ah, that should be ok then, and similar to what we have done for git with |
And, are the difference between |
This is not backwards compatible, "bzr up" is a noop for "bzr branch" type clones. That's easy to address though, by adding a "bzr bind" command to convert from a branch to a checkout. I'll update this branch. |
a88ec53
to
67d2fe6
Compare
Now updated to call "bzr bind" to make it compatible with older branches (and cope with location changes). |
Hi @sbidoul , would you perhaps be able to help review this branch after the last changes or suggest a course of action? Thanks! |
Hi, I've had a look at your latest version. It's hard for me to tell as I know next to nothing about bzr. I'm still a bit worried about backward compatibility, though. As checkout and branch don't have the same effect, would it be possible to do something just after checkout so it becomes more or less equivalent to a bzr branch? |
It seems hard to find somebody in pypa who is fairly with bzr, so I appreciate you taking a look. :-) If it helps, I'm one of the upstream developers for Bazaar. My changes are backwards compatible. If there is currently an "unbound" branch (i.e. something created by "bzr branch") present, then it will convert it to a bound branch (the same thing "bzr checkout" will create) by calling "bzr bind" first before running "bzr update".
|
I'm not sure. If you look at the That's why I'm asking if something can be done in Also, if I read the help of |
Yup, that's fine. You'll end up with a checkout after
We specifically want to end up with a "checkout" rather than a standalone branch (created by "bzr branch"), since a standalone branch carries full history and is thus slow to create. A checkout is a local thing that is meant to merely mirror a remote branch (tying it to that remote branch is what "bzr bind" does); it will fetch things from its "master branch" when it needs to and therefor it doesn't need to have a full copy of history itself. Or running these as bzr commands:
|
67d2fe6
to
4241bc8
Compare
I've added a comment in the code explaining why it's calling "bzr bind". |
fc9779b
to
cca101d
Compare
cca101d
to
7380239
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving on the basis that we don't have anyone with real expertise in Bazaar, but equally I don't think we have many users relying on it, so the risk of major issues is low.
If we get a problem, we can simply revert the PR.
Yup, sorry I had lost track of this. I still think there might be a minor backward incompatibility concern with But that's probably not worth worrying about too much. So 👍 for merging. |
The CI failure is our flaky test_timeout, so unrelated. |
Sorry, I misread because github actions highlighted these lines as they have "ERROR" in them.
|
I've force-merged, since reverts are easy-enough. :) |
Beat me to it, @pradyunsg! 🚤 |
Heh, good point @pfmoore -- I'll revert the force-merge if it causes |
Off-topic for here, but is anyone looking at test_timeout, or do we have an issue tracking the problem? Presumably it's this one? Checking the history, it looks like we originally skipped the test deliberately because it was flaky, but it was "fixed" in 426691d by an over-enthusiastic response to a mypy message ( I propose we revert the marker change, making it |
I think we should just remove the test -- it's flaky enough that it's basically rendering our Windows CI useless. :) |
Fixes #5444
For Bazaar itself, this changes the clone time from 2 minutes to 11 seconds for me.