qswitch: don't block directory picker while searching all branches in shared repo because it's slow

Bug #412058 reported by Alexander Belchenko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
High
Javier Derderyan

Bug Description

Subject says most of the actual report. Will be nice if collecting of branches will be done in background and just updating combobox (in the end or regularly) but do provide user ability to select another branch via Browse.

Tags: qswitch
Changed in qbzr:
importance: Undecided → High
status: New → Confirmed
summary: - qswitch: don't block directory picker wile searching all branches in
+ qswitch: don't block directory picker while searching all branches in
shared repo because it's slow
Revision history for this message
Alexander Belchenko (bialix) wrote :

Gary, I need your opinion on this bug.

Recent changes fromn Javier discover that our throbber practice is not sufficient here. At all.

Now directory picker become visible right now but it's not available anyway until find_branches finished, because all this time window just not respond on user actions. So we should find another way to unblock UI.

Possible solution I see:

1) Put find_branches action into separate thread. I remember Lukas was always against threads in the QBzr.

2) Put find_branches action into subprocess, similar to what bzrtools' "branches" command do: emit found branch names to stdout and run subprocess output in the throbbered action.

3) Just disable find_branches and forgot about it?

Revision history for this message
Alexander Belchenko (bialix) wrote :

Of course I've meant "collect": "emit found branch names to stdout and s/run/collect/ subprocess output in the throbbered action."

Changed in qbzr:
assignee: nobody → Javier Der Derian (javierder)
Revision history for this message
Alexander Belchenko (bialix) wrote :

Actually we can just ran bzrtools' branches command as subprocess using similar code to our subprocess.py. If bzrtools is not installed... well then just skip collecting branches action.

Revision history for this message
Javier Derderyan (javierder) wrote : Re: [Bug 412058] Re: qswitch: don't block directory picker while searching all branches in shared repo because it's slow

Ok, I've pushed up teh UI changes and disabled find_branches.
I'll get on it later today to use the best idea to get the branches.

On Thu, Aug 13, 2009 at 12:58 PM, Alexander Belchenko <email address hidden>wrote:

> Actually we can just ran bzrtools' branches command as subprocess using
> similar code to our subprocess.py. If bzrtools is not installed... well
> then just skip collecting branches action.
>
> --
> qswitch: don't block directory picker while searching all branches in
> shared repo because it's slow
> https://bugs.launchpad.net/bugs/412058
> You received this bug notification because you are a bug assignee.
>

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

So there are 2 thing we can try first.

1. Reduce the time before we run the initial_load. It was 1000 msec. We can change that to 0.

2. 2 Steps: Change Repository.find_branches in bzrlib to a Generator. Then when we iterate through find_branches, we should call self.processEvents()

Lets try this before we start trying out more complex architecture.
Here is my branch with the qbzr changes: lp:~garyvdm/qbzr/qswitch. The changes to bzr are here: lp:~garyvdm/bzr/find_branches_generator. I will submit a merge request as soon as I have run the entire test suit.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

So there are test that expect find_branches to return a list, so we are going to need to add a iter_branches method. I'm not going to work on this now, so if someone else (Jelvier/bialix) wants to pick it up, that would be great.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 412058] Re: qswitch: don't block directory picker while searching all branches in shared repo because it's slow

Gary van der Merwe пишет:
> So there are test that expect find_branches to return a list, so we are
> going to need to add a iter_branches method. I'm not going to work on
> this now, so if someone else (Jelvier/bialix) wants to pick it up, that
> would be great.

Gary, iter_branches sounds like right thing re backward compatibility. I'll look what we can do about.

Javier, you can use iter_branches in your code right now: just check that repository object has such
attribute with code:

        if repo is not None:
            if getattr(repo, "iter_branches", None):
                for br in repo.iter_branches():
                    branch_combo.addItem(url_for_display(br.base))

And btw, you need initialize dialog with hidden throbber.

Revision history for this message
Javier Derderyan (javierder) wrote :

Ok, great. I've just pushed those changes.

Changed in qbzr:
milestone: none → 0.14
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.