Merge lp:~spiv/bzr/push-relock into lp:bzr
Status: | Work in progress |
---|---|
Proposed branch: | lp:~spiv/bzr/push-relock |
Merge into: | lp:bzr |
Diff against target: |
102 lines (+28/-3) 4 files modified
NEWS (+3/-0) bzrlib/builtins.py (+2/-0) bzrlib/bzrdir.py (+3/-2) bzrlib/push.py (+20/-1) |
To merge this branch: | bzr merge lp:~spiv/bzr/push-relock |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
bzr-core | Pending | ||
Review via email: mp+23767@code.launchpad.net |
Commit message
Avoid relocking in cmd_push.
Description of the change
This fixes more relock warnings, this time in cmd_push.
This one is a bit uglier than the previous patches: most of the time cmd_push just needs a read-lock on br_from (the source branch), but occasionally it wants to set the remembered push location. And sometimes it won't know that it will want to until after reading the branch.conf -- i.e. after the read-lock has been acquired.
Unfortunately, we don't have an API to upgrade a read lock to write lock, so instead this patch opens a separate instance of the (already read-locked) branch so it can write-lock that and set the push location. That second instance is then discarded. The downside, as explained in the comment, is that the read-locked version will not see the update, but in this case I don't think that matters.
Unmerged revisions
- 5148. By Andrew Bennetts
-
Tweak NEWS entry wording for consistency.
- 5147. By Andrew Bennetts
-
Merge lp:bzr.
- 5146. By Andrew Bennetts
-
Add NEWS entry.
- 5145. By Andrew Bennetts
-
Try to avoid relocking in cmd_push using an ugly hack for the --remember case.
This won't work with older bzr formats that use a mutex across all processes
on write locks. I don't know if that matters, but it should be at least
documented, I think. Other than that it seems that perhaps its worth doing
an api to upgrade to a write lock?