Package com.intellij.openapi.vcs

Examples of com.intellij.openapi.vcs.VcsException


        }

      } else if (FileStatus.ADDED.equals(change.getFileStatus())) {
                addedFiles.add(change.getAfterRevision().getFile().getVirtualFile());
            }else {
                    exceptions.add(new VcsException("only MODIFIED/ADDED (!= "+change.getFileStatus()+"files are currently supported" ));
            }
        }
        CheckinAPICommand checkinAPICommand = new CheckinAPICommand();
        try {
            checkinAPICommand.executeCommand(mksVcs, exceptions, modifiedFiles.toArray(new VirtualFile[modifiedFiles.size()]));
View Full Code Here


                }

            } else if (FileStatus.ADDED.equals(change.getFileStatus())) {
                addedFiles.add(change.getAfterRevision().getFile().getVirtualFile());
            }else {
                exceptions.add(new VcsException("only MODIFIED/ADDED (!= "+change.getFileStatus()+"files are currently supported" ));
            }
        }
        RevertAPICommand revertAPICommand = new RevertAPICommand();
        try {
            List<VirtualFile> filesToRevert = new ArrayList<VirtualFile>();
View Full Code Here

                }
            }
        }
        if (state == null) {
            LOGGER.error("error obtaining current revision for " + filePath);
            throw new VcsException("error obtaining current revision for " + filePath);
        }
        return (VcsRevisionNumber.NULL == state.workingRevision) ? null : state.workingRevision;

    }
View Full Code Here

                try {
                    MksConfiguration configuration = ApplicationManager.getApplication().getComponent(MksConfiguration.class);
                    configuration.addRememberedUsername(hostAndPort, userAndPassword.user);
                    passwordSafe.storePassword(myProject,  MksVcs.class, createPasswordKey(hostAndPort, userAndPassword.user),userAndPassword.password);
                } catch (PasswordSafeException e) {
                    reportErrors(Arrays.asList(new VcsException(e)), "unable to store credentials");
                }
            } else {
        reportErrors(command.errors, "unable to connect to " + hostAndPort);
      }
    }
View Full Code Here

  public void execute() {
        try {
            super.executeCommand();
        } catch (IOException e) {
            //noinspection ThrowableInstanceNeverThrown
            errors.add(new VcsException(e));
        }
        if (exitValue == 0) {
            server = new MksServerInfo(user, host, port);
        }
    }
View Full Code Here

    if (!"archived".equals(type)) {
      LOGGER.warn("exepecting only non changed members " + type);
//      return new MksMemberState(workingRevision, memberRevision, workingCpid, MksMemberState.Status.DROPPED);
//    } else if (memberRevision != null && workingRevision == null) {
//      return new MksMemberState(workingRevision, memberRevision, workingCpid, MksMemberState.Status.MISSING);
      throw new VcsException("exepecting only non changed members");
    } else {
      return new MksMemberState(workingRevision, memberRevision, workingCpid, MksMemberState.Status.NOT_CHANGED);
    }
  }
View Full Code Here

    public void execute() {
        try {
            executeCommand();
        } catch (IOException e) {
            //noinspection ThrowableInstanceNeverThrown
            errors.add(new VcsException(e));
            return;
        }
        Pattern wholeLinePattern = Pattern.compile(wholeLinePatternString);
        BufferedReader reader = new BufferedReader(new StringReader(commandOutput));
        try {
            String firstLine = reader.readLine();
            if (firstLine == null || !VcsUtil.getFilePath(member).equals(VcsUtil.getFilePath(firstLine))) {
                LOGGER.warn("unexpected command output " + commandOutput + ", first line is expected to be " + member);
            } else {
                String line;
                while ((line = reader.readLine()) != null) {
                    Matcher matcher = wholeLinePattern.matcher(line);
                    try {
                        if (matcher.matches()) {
                            String rev = matcher.group(REVISION_IDX);
                            String date = matcher.group(DATE_IDX);
                            String cpid = matcher.group(CPID_IDX);
                            String author = matcher.group(AUTHOR_IDX);
                            String description = matcher.group(DESCRIPTION_IDX);
                            MksMemberRevisionInfo info = new MksMemberRevisionInfo();
                            info.setRevision(createRevision(rev));
                            info.setDate(parseDate(date, true));
                            info.setCPID(cpid);
                            info.setAuthor(author);
                            info.setDescription(description);
                            revisionsInfo.add(info);
                        } else if (line.startsWith("Member added")) {
                            // ignore this line
                            // Don't ignore the following ones
                        } else if (revisionsInfo.size() >= 1) {
                            LOGGER.debug("assuming multiline comment :" + line);
                            final MksMemberRevisionInfo info = revisionsInfo.get(revisionsInfo.size() - 1);
                            info.setDescription(info.getDescription() + "\n" + line);
                        } else {
                            //noinspection ThrowableInstanceNeverThrown
                            errors.add(new VcsException("ViewMemberHistory: unexpected line [" + line + "]"));
                        }
                    } catch (VcsException e) {
                        errors.add(e);
                    }
                }
            }
        } catch (IOException e) {
            //noinspection ThrowableInstanceNeverThrown
            errors.add(new VcsException(e));
        }
    }
View Full Code Here

        }
    }

    protected void handleErrorOutput(String errorOutput) {
        if (exitValue == 128 && errorOutput.contains("is not a current or destined or pending member")) {
            errors.add(new VcsException(GetRevisionInfo.NOT_A_MEMBER));
            return;
        } else {
            super.handleErrorOutput(
                    errorOutput);    //To change body of overridden methods use File | Settings | File Templates.
        }
View Full Code Here

          format = new SimpleDateFormat(configuration.getDatePattern());
        }
        return parseDate(date, false);

      } else {
        throw new VcsException(
            "unknown date format for " + date + " (expected [" + mksCLIConfiguration.getDatePattern() +
                "]). " +
                "This may be an encoding issue, encoding used was " +
                mksCLIConfiguration.getMksSiEncoding(COMMAND));
View Full Code Here

    try {
      super.executeCommand();
      // todo verifier que le unlock s'est bien passé
    } catch (IOException e) {
      //noinspection ThrowableInstanceNeverThrown
      errors.add(new VcsException(e));
    }
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vcs.VcsException

Copyright © 2018 www.massapicom. 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.