Merge lp:~jameinel/bzr/2.4-status-no-changes-765881 into lp:bzr
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5809 |
Proposed branch: | lp:~jameinel/bzr/2.4-status-no-changes-765881 |
Merge into: | lp:bzr |
Diff against target: |
302 lines (+84/-49) 5 files modified
bzrlib/_dirstate_helpers_pyx.pyx (+16/-4) bzrlib/dirstate.py (+6/-1) bzrlib/tests/test__dirstate_helpers.py (+23/-7) bzrlib/tests/test_dirstate.py (+33/-37) doc/en/release-notes/bzr-2.4.txt (+6/-0) |
To merge this branch: | bzr merge lp:~jameinel/bzr/2.4-status-no-changes-765881 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij (community) | code | Approve | |
bzr-core | Pending | ||
Review via email: mp+58313@code.launchpad.net |
Commit message
Fix bug #765881, we don't need to save the dirstate file for trivial changes.
Description of the change
This fixes a bug that Mark Shuttleworth pointed out to me (bug #765881)
Basically, our 'bzr status' times were a lot slower than just the 'iter_changes()' times, which was confusing. It turned out that whenever you had files that were just newly added, *every* 'bzr status' from then on would rewrite the dirstate file. This happened because the shortcut case of "don't compute the sha1" would trigger a "and the dirstate is considered modified".
While I was there, I went ahead and updated some tests to also treat newly-changed directory entries as not-worth-saving. The reasoning is that all of the information we would be updating is trivially derived from only the stat object. And we have to stat the entry anyway, so we don't save any future work.
There is more that we could do there, but I think this is an incremental improvement.
It turns out that this also affected a couple of tests that were using trivial changes to trigger IN_MEMORY_MODIFIED. I rewrote them a bit to use slightly-less trivial changes (though eventually we may not save those, either.)
Nice improvement :) I'm voting approve, but I should note I don't have a lot of experience working on dirstate. Perhaps somebody else can have a quick look as well?