Package org.intellij.vcs.mks.sicommands.cli

Examples of org.intellij.vcs.mks.sicommands.cli.AbstractViewSandboxCommand


        if ("".equals(relativePath.trim())) {
            LOGGER.warn("no relative path for " + virtualFile + " from " + sandboxFolderFilePath +
                    ", assuming different sandboxes");
            return false;
        }
        final AbstractViewSandboxCommand command =
                new AbstractViewSandboxCommand(new ArrayList<VcsException>(), MksVcs.getInstance(project),
                        sandbox.sandboxPath,
                        "--filter=file:" + relativePath) {
                    @Override
                    protected MksMemberState createState(final String workingRev, final String memberRev, final String workingCpid,
                                                         final String locker, final String lockedSandbox, final String type,
                                                         final String deferred) throws VcsException {
                        return new MksMemberState(MksRevisionNumber.createRevision(workingRev),
                                MksRevisionNumber.createRevision(memberRev), workingCpid,
                                MksMemberState.Status.UNKNOWN);
                    }
                };
        command.execute();
        if (command.foundError()) {
            LOGGER.error("error while checking if sandbox " + sandbox + " contains " + virtualFile);
            for (final VcsException error : command.errors) {
                LOGGER.warn(error);
            }

        }
        return command.getMemberStates().get(filePath.getPath()) != null;

    }
View Full Code Here


        FilePath sandboxPath = VcsUtil.getFilePath(sandbox.sandboxPath);
        FilePath sandboxFolder = sandboxPath.getParentPath();
        assert sandboxFolder != null : "sandbox parent folder can not be null";
        assert filePath.getPath().startsWith(sandboxFolder.getPath()) :
                "" + filePath.getPath() + " should start with " + sandboxFolder.getPath();
        final AbstractViewSandboxCommand command =
                new AbstractViewSandboxCommand(new ArrayList<VcsException>(), vcs, sandbox.sandboxPath
                        , "--filter=file:" + MksVcs.getRelativePath(filePath, sandboxFolder)
//        "--fields=workingrev",
//        "--recurse"
                ) {
                    @Override
                    protected MksMemberState createState(String workingRev, String memberRev, String workingCpid,
                                                         String locker, String lockedSandbox, String type,
                                                         String deferred) throws VcsException {
                        return new MksMemberState((MksRevisionNumber.createRevision(workingRev)),
                                (MksRevisionNumber.createRevision(memberRev)), workingCpid,
                                MksMemberState.Status.UNKNOWN);
                    }

/*
      @Override
      public void execute() {
        try {
          super.executeCommand();
          BufferedReader reader = new BufferedReader(new StringReader(commandOutput));
          String line ;
          while ((line = reader.readLine()) != null && !"".equals(line)) {
            if (currentRevisionHolder[0] == null) {
              currentRevisionHolder[0] = line;
            } else {
              LOGGER.warn("multiple members retrieved for "+filePath+"!!");
            }
          }

        } catch (IOException e) {
          LOGGER.error("error obtaining current revision for " + filePath, e);
        }

      }
*/
                };
        command.execute();
        MksMemberState state = command.getMemberStates().get(filePath.getPath());
        if (state == null) {
            for (String s : command.getMemberStates().keySet()) {
                if (VcsUtil.getFilePath(s).getPath().equals(filePath.getPath())) {
                    state = command.getMemberStates().get(s);
                    break;
                }
            }
        }
        if (state == null) {
View Full Code Here

      }
    }

    final ArrayList<VcsException> exceptions = new ArrayList<VcsException>();
    for (final MksSandboxInfo sandbox : sandboxes) {
      final AbstractViewSandboxCommand command =
          new ViewSandboxRemoteChangesCommand(exceptions, mksVcs, sandbox.sandboxPath);
      command.execute();
      for (final Map.Entry<String, MksMemberState> entry : command.getMemberStates().entrySet()) {
        final MksMemberState state = entry.getValue();
        switch (state.status) {
          case REMOTELY_ADDED:
            updatedFiles.getGroupById(FileGroup.CREATED_ID)
                .add(entry.getKey(), MksVcs.OUR_KEY, state.memberRevision);
View Full Code Here

TOP

Related Classes of org.intellij.vcs.mks.sicommands.cli.AbstractViewSandboxCommand

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.