Examples of ResetCommand


Examples of com.onarandombox.MultiverseAdventure.commands.ResetCommand

        this.commandHandler.registerCommand(new EnableCommand(this));
        this.commandHandler.registerCommand(new DisableCommand(this));
        this.commandHandler.registerCommand(new FlushCommand(this));
        this.commandHandler.registerCommand(new SetTemplateCommand(this));
        this.commandHandler.registerCommand(new ListCommand(this));
        this.commandHandler.registerCommand(new ResetCommand(this));

        for (com.pneumaticraft.commandhandler.multiverse.Command c : this.commandHandler.getAllCommands()) {
            if (c instanceof HelpCommand) {
                c.addKey("mva");
            }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.command.admin.reset.ResetCommand

                new TellCommand(plugin),
                new DenyLoginCommand(plugin),
                new UnexemptCommand(plugin),
                new AllowLoginCommand(plugin),
                new LogCommand(plugin),
                new ResetCommand(plugin),
        }){
            addSubCommands(cmd);
            rootLabels.add(cmd.label);
        }
    }
View Full Code Here

Examples of megamek.server.commands.ResetCommand

        registerCommand(new HelpCommand(this));
        registerCommand(new KickCommand(this));
        registerCommand(new ListSavesCommand(this));
        registerCommand(new LocalSaveGameCommand(this));
        registerCommand(new LocalLoadGameCommand(this));
        registerCommand(new ResetCommand(this));
        registerCommand(new RollCommand(this));
        registerCommand(new SaveGameCommand(this));
        registerCommand(new LoadGameCommand(this));
        registerCommand(new SeeAllCommand(this));
        registerCommand(new SkipCommand(this));
View Full Code Here

Examples of org.eclipse.jgit.api.ResetCommand

  @Argument(required = true, metaVar = "metaVar_name", usage = "usage_reset")
  private String commit;

  @Override
  protected void run() throws Exception {
    ResetCommand command = new Git(db).reset();
    command.setRef(commit);
    ResetType mode = null;
    if (soft)
      mode = selectMode(mode, ResetType.SOFT);
    if (mixed)
      mode = selectMode(mode, ResetType.MIXED);
    if (hard)
      mode = selectMode(mode, ResetType.HARD);
    if (mode == null)
      throw die("no reset mode set");
    command.setMode(mode);
    command.call();
  }
View Full Code Here

Examples of org.eclipse.jgit.api.ResetCommand

            .bind("Mixing {0} and {1} parameters is not allowed.", new Object[] { ProtocolConstants.KEY_PATH, GitConstants.KEY_TAG_COMMIT });
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
      }
      JSONArray paths = toReset.optJSONArray(ProtocolConstants.KEY_PATH);
      Git git = new Git(db);
      ResetCommand reset = git.reset().setRef(Constants.HEAD);
      if (paths != null) {
        for (int i = 0; i < paths.length(); i++) {
          reset.addPath(paths.getString(i));
        }
      } else {
        // path format is /file/{workspaceId}/{projectName}[/{path}]
        String projectRelativePath = path.removeFirstSegments(3).toString();
        if (projectRelativePath.isEmpty()) {
          String msg = "Path cannot be empty.";
          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
        }
        reset.addPath(projectRelativePath);
      }
      try {
        reset.call();
      } catch (GitAPIException e) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), e));
      }
      return true;
    }
View Full Code Here

Examples of org.eclipse.jgit.api.ResetCommand

  private static GitCommand<?> prepareCommand(Repository repository,
      Collection<String> paths) {
    Git git = new Git(repository);
    if (hasHead(repository)) {
      ResetCommand resetCommand = git.reset();
      resetCommand.setRef(HEAD);
      for (String path : paths)
        resetCommand.addPath(getCommandPath(path));
      return resetCommand;
    } else {
      RmCommand rmCommand = git.rm();
      rmCommand.setCached(true);
      for (String path : paths)
View Full Code Here

Examples of org.eclipse.jgit.api.ResetCommand

    if (paths.isEmpty())
      return;

    try {
      Git git = new Git(currentRepository);
      ResetCommand reset = git.reset();
      for (String path : paths)
        reset.addPath(path);
      reset.call();
    } catch (GitAPIException e) {
      Activator.handleError(e.getMessage(), e, true);
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.api.ResetCommand

    if (type == ResetType.HARD) {
      validProjects = ProjectUtil.getValidOpenProjects(repository);
      ResourceUtil.saveLocalHistory(repository);
    }

    ResetCommand reset = Git.wrap(repository).reset();
    reset.setMode(type);
    reset.setRef(refName);
    try {
      reset.call();
    } catch (GitAPIException e) {
      throw new TeamException(e.getLocalizedMessage(), e.getCause());
    }
    monitor.worked(1);
View Full Code Here

Examples of org.eclipse.jgit.api.ResetCommand

class GitPostReceiveHook implements PostReceiveHook{
 
    public void onPostReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
        try {
            ResetCommand cmd = new Git(rp.getRepository()).reset();
            cmd.setMode(ResetType.HARD);
            cmd.setRef("master");
            cmd.call();
           
            WfUtil.deployAllToEngine();
        } catch (Exception e) {
            StringWriter sw = new StringWriter();
            e.printStackTrace(new PrintWriter(sw));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.