'Set up the status menu for the repo status tree.'

def create_context_menu(self):

    s = self.selection()
    menu = qtutils.create_menu(u'Status', self)
    menu.addAction(self.launch_editor_action)
    selected_indexes = self.selected_indexes()
    if selected_indexes:
        (category, idx) = selected_indexes[0]
        if (category == self.idx_header):
            return self._create_header_context_menu(menu, idx)
    if s.staged:
        self._create_staged_context_menu(menu, s)
    elif s.unmerged:
        self._create_unmerged_context_menu(menu, s)
    else:
        self._create_unstaged_context_menu(menu, s)
    if (not utils.is_win32()):
        menu.addSeparator()
        menu.addAction(self.default_app_action)
        menu.addAction(self.parent_dir_action)
        menu.addAction(self.terminal_action)
    return menu
