'Push selection into the selection model.'

def sync_selection(self):

    staged = []
    unmerged = []
    modified = []
    untracked = []
    state = State(staged, unmerged, modified, untracked)
    paths = self.selected_paths()
    model = main.model()
    model_staged = utils.add_parents(model.staged)
    model_modified = utils.add_parents(model.modified)
    model_unmerged = utils.add_parents(model.unmerged)
    model_untracked = utils.add_parents(model.untracked)
    for path in paths:
        if (path in model_unmerged):
            unmerged.append(path)
        elif (path in model_untracked):
            untracked.append(path)
        elif (path in model_staged):
            staged.append(path)
        elif (path in model_modified):
            modified.append(path)
        else:
            staged.append(path)
    selection_model().set_selection(state)
    return paths
