Sort branches in Update dialog

Issue #103 resolved
Dario Ahdoot
created an issue

I haven't tested this in THG yet, but in Tortoise 1.8, the list of branches in the update dialog are not sorted. Would be nice to have them sorted for those who have a large number of branches.

Not much needs to change. I think all that is needed is to modify lines in the UpdateDialog.init method:

Change: {{{


for name in hglib.getlivebranch(self.repo): combo.addItem(hglib.tounicode(name)) }}}

To: {{{


branches = list(hglib.getlivebranch(self.repo)) branches.sort() for name in branches: combo.addItem(hglib.tounicode(name)) }}}

I haven't tested it as I'm not set up to build Tortoise.

Comments (6)

  1. Dario Ahdoot reporter

    Hi Steve,

    I haven't played with THG yet, so I don't know what the sort order is there, but on 1.8, there doesn't seem to be any sorting other than maybe the other of the items as they appear in a map. I don't see my recently updated branches appearing at the top of the list. In fact, 'default', a very active branch, appears near the bottom.

    Also, I think your argument would also apply to tags. But those are sorted.

    In our organization there are lots of active branches being worked on by many different people. It's just easier to find things when they are sorted. In fact, the list of branches in Repository Explorer filter list are sorted, which is really nice.

    Perhaps make it an option?

    Anyways, thanks for your hard work!


  2. Mike Rogers

    I'd like to second the request for an alphabetically sorted list of branches. It would make thigns much easier to find within a sytematic branch naming structure.


  3. Log in to comment