Commits

Yuya Nishihara committed a94e3e7

repofilter: don't disable branchCombo if there is at least one choice

Even if it has only a single choice, it may be different from "show all".
For example, if there're closed "foo" branch and active "bar" branch,
selecting "bar" will hide changesets belonging to "foo".

fcedfafda30b partially fixed this problem, but it wasn't right approach.

Comments (0)

Files changed (2)

tests/widget/repofilterbar_branch_test.py

         hg.addremove()
         hg.commit('-m', 'commit to default')
         hg.commit('--close-branch', '-m', 'close default branch')
-        hg.branch('foo')
-        hg.commit('-m', 'create foo branch')
         cls.repo = thgrepo.repository(path=hg.path)
 
     @classmethod

tortoisehg/hgqt/repofilter.py

             self._branchCombo.setItemData(self._branchCombo.count() - 1,
                                           hglib.tounicode(branch),
                                           Qt.ToolTipRole)
-        self._branchCombo.setEnabled(self.filterEnabled
-                                     and (len(branches) > 1
-                                          or self._abranchAction.isChecked()))
+        self._branchCombo.setEnabled(self.filterEnabled and bool(branches))
         self._branchReloading = False
 
         if curbranch and curbranch not in branches: