

def pop_or_apply_selected_stashes(self, cmd):
    repo = self.get_repo()
    if (not repo):
        return
    goto = None
    stashes = self.get_selected_stashes()
    if stashes:
        for (name, title) in stashes:
            if sublime.ok_cancel_dialog(('Are you sure you want to %s %s?' % (cmd, title)), ('%s stash' % cmd.capitalize())):
                (exit, stdout, stderr) = self.git(['stash', cmd, '-q', ('stash@{%s}' % name)], cwd=repo)
                if (exit != 0):
                    sublime.error_message(self.format_error_message(stderr))
        if (cmd == 'apply'):
            region = self.view.line(self.get_first_point())
            goto = ('point:%s' % region.begin())
        else:
            goto = self.logical_goto_next_stash()
    self.update_status(goto)

dataset/ETHPy150Open SublimeGit/SublimeGit/sgit/status.py GitStatusStashCmd.pop_or_apply_selected_stashes/original