Merge lp:~jr/bzr-explorer/795034-refresh-branch-view-automatically into lp:bzr-explorer
Proposed by
Jonathan Riddell
Status: | Merged |
---|---|
Merge reported by: | Jonathan Riddell |
Merged at revision: | not available |
Proposed branch: | lp:~jr/bzr-explorer/795034-refresh-branch-view-automatically |
Merge into: | lp:bzr-explorer |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~jr/bzr-explorer/795034-refresh-branch-view-automatically |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrew Bennetts (community) | Approve | ||
Bazaar Explorer Developers | Pending | ||
Review via email: mp+64039@code.launchpad.net |
Description of the change
Watch for changes in branches and refresh when they happen
To post a comment you must log in.
I think _find_file_ watcher_ paths could be written more simply as:
import os
def _find_file_ watcher_ paths(self, root):
result. extend( os.path. join(dirpath, d) for d in dirnames)
result = [root]
for dirpath, dirnames, filenames in os.walk(root):
return result
At a minimum I'd suggest avoiding “fileList = fileList + …” in favour of fileList.extend(…) (or equivalently “fileList += …”), as I think the way you have written it CPython is likely to have to allocate a new list rather than growing the existing list in place, making it an O(n²) loop. Newer CPythons *might* optimise in this case, but I'm not sure they do.
It might be worth trying this on a large tree (maybe gcc or emacs?) just to verify there's no nasty performance surprises. But aside from that this seems fine to me, although I'm not a Qt or bzr-explorer expert.