'This callback is called when the branch selection changes'

def branch_item_changed(self, *rest):

    qlist = self.branch_list
    remote_branch = qtutils.selected_item(qlist, self.branch_sources())
    if (not remote_branch):
        return
    self.revision.setText(remote_branch)
    if (not self.remote_radio.isChecked()):
        return
    branch = gitcmds.strip_remote(self.model.remotes, remote_branch)
    if (branch == u'HEAD'):
        return
    self.branch_name.set_value(branch)
