Examples of MksChangePackage


Examples of org.intellij.vcs.mks.model.MksChangePackage

        continue;
      }
      final VcsKey key = MksVcs.OUR_KEY;
      switch (state.status) {
        case ADDED: {
          MksChangePackage changePackage = getChangePackage(changePackages, state);
          Change change = new Change(
              null,
              CurrentContentRevision.create(filePath),
              FileStatus.ADDED);
          if (changePackage == null) {
            builder.processChange(change, key);
          } else {
            ChangeList changeList = MksVcs.getInstance(myProject).getChangeListAdapter().trackMksChangePackage(changePackage);
            builder.processChangeInList(change, changeList, key);
          }
          break;
        }
        case CHECKED_OUT: {
          MksChangePackage changePackage = getChangePackage(changePackages, state);
          Change change = new Change(
              new MksContentRevision(MksVcs.getInstance(myProject), filePath, state.memberRevision),
              CurrentContentRevision.create(filePath),
              FileStatus.MODIFIED);
          if (changePackage == null) {
            builder.processChange(change, key);
          } else {
            ChangeList changeList = MksVcs.getInstance(myProject).getChangeListAdapter().trackMksChangePackage(changePackage);
            builder.processChangeInList(change, changeList, key);
          }
          break;
        }
        case MODIFIED_WITHOUT_CHECKOUT: {
          builder.processModifiedWithoutCheckout(virtualFile);
          break;
        }
        case SYNC:
          // todo some of those changes belong to the Incoming tab
          builder.processChange(new Change(
              new MksContentRevision(MksVcs.getInstance(myProject), filePath, state.workingRevision),
              new MksContentRevision(MksVcs.getInstance(myProject), filePath, state.memberRevision),
              FileStatus.OBSOLETE), key);
          break;
        case DROPPED: {
          MksChangePackage changePackage = getChangePackage(changePackages, state);
          Change change = new Change(
              new MksContentRevision(MksVcs.getInstance(myProject), filePath, state.memberRevision),
              CurrentContentRevision.create(filePath),
              FileStatus.DELETED);
          if (changePackage == null) {
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

       boolean hasFocus) {
    MksChangeListAdapter changeListAdapter = getChangeListAdapter();
    if (!changeListAdapter.isChangeListMksControlled(changeList.getName())) {
      return;
    }
    MksChangePackage aPackage = changeListAdapter.getMksChangePackage(changeList.getName());
    if (aPackage != null) {
      cellRenderer.append(" - MKS #" + aPackage.getId(), SimpleTextAttributes.GRAY_ATTRIBUTES);
    }
  }
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

        runner.execute(command);
    }
    public void testViewPackage() {

        ViewChangePackageAPICommand command = new ViewChangePackageAPICommand(new ArrayList<VcsException>(), getMksCLIConfiguration(), new MksChangePackage("vhvhcl50.us.hsbc", "430549:1", "79301750", "open", null)) {
            @Override
            protected MKSAPIHelper getAPIHelper() {
                return apiHelper;
            }
        };
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

        return changePackageIdByChangeListName.containsKey(changeListName);
    }

    @Nullable
    public MksChangePackage getMksChangePackage(@NotNull String changeListName) {
        MksChangePackage mksChangePackage = changePackageById.get(changePackageIdByChangeListName.get(changeListName));
        if (mksChangePackage != null) {
            return mksChangePackage;
        } else {
            return null;
        }
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

    }

    @Override
    public void changeListRenamed(ChangeList list, String oldName) {
        if (isChangeListMksControlled(oldName)) {
            MksChangePackage mksChangePackage = getMksChangePackage(oldName);
            changeListNameByChangePackageId.remove(oldName);

            if (mksChangePackage != null) {
                changeListNameByChangePackageId.put(mksChangePackage.getId(), list.getName());
                changePackageIdByChangeListName.put(list.getName(), mksChangePackage.getId());
            }
            if (!isUpdating) {
                renameChangePackage(mksChangePackage, list.getName());
            }
        }
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

            Map<MksSandboxInfo, ArrayList<VirtualFile>> filesBysandbox = dispatchBySandbox(changes);
            // need to check the changes are controlled by mks
            if (isChangeListMksControlled(fromList.getName()) &&
                isChangeListMksControlled(toList.getName()  /* todo changelist*/)) {
                // unlock then lock the changes
                final MksChangePackage aPackage = getMksChangePackage(toList.getName());
                if (aPackage == null) {
                    logger.warn("unable to find the change package for [" + toList.getName() + "]");
                    return;
                }
                for (Map.Entry<MksSandboxInfo, ArrayList<VirtualFile>> entry : filesBysandbox.entrySet()) {
                    final String[] paths = getPaths(entry);
                    unlock(entry.getKey(), paths);
                    lock(entry.getKey(), aPackage, paths);
                }
            } else if (isChangeListMksControlled(fromList.getName())) {
                // unlock the changes
                // todo
                // changes for which beforeRevision == null are newly created, and if they appear in a controlled list
                // they have been added (defeferred)
                // changes for which beforeRevision != null were regularly checked out and should be unlocked
                final MksChangePackage aPackage = getMksChangePackage(fromList.getName());
                if (aPackage == null) {
                    logger.warn("unable to find the change package for [" + fromList.getName() + "]");
                    return;
                }
                for (Map.Entry<MksSandboxInfo, ArrayList<VirtualFile>> entry : filesBysandbox.entrySet()) {
                    final String[] paths = getPaths(entry);
                    removeDeferred(entry.getKey(), aPackage, paths);
                }
            } else if (isChangeListMksControlled(toList.getName())) {
                // lock the changes
                // if change.beforeRevision == null , this is a new file, and should be added (deferred= true)
                // if change.beforeRevision != null ... shouldn't be possible
                final MksChangePackage aPackage = getMksChangePackage(toList.getName());
                if (aPackage == null) {
                    logger.warn("unable to find the change package for [" + toList.getName() + "]");
                    return;
                }
                for (Map.Entry<MksSandboxInfo, ArrayList<VirtualFile>> entry : filesBysandbox.entrySet()) {
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

                            "}, expected 4 parts separated by \\t, while executing " + command;
                    LOGGER.error(errrorMessage, "");
                    //noinspection ThrowableInstanceNeverThrown
                    errors.add(new VcsException(errrorMessage));
                } else {
                    tempChangePackages.add(new MksChangePackage(serverInfo.host, parts[ID], parts[USER], parts[STATE],
                            parts[SUMMARY]));
                }
            }
            changePackages = tempChangePackages;
        } catch (IOException e) {
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

                String cpid = workItem.getField("id").getValueAsString();
                String user = workItem.getField("user").getValueAsString();
                String state = workItem.getField("state").getValueAsString();
                String summary = workItem.getField("summary").getValueAsString();

                tempChangePackages.add(new MksChangePackage(serverInfo.host, cpid, user, state,
                        summary));


            }
            changePackages = tempChangePackages;
View Full Code Here

Examples of org.intellij.vcs.mks.model.MksChangePackage

        final List<MksChangePackage> changePackages = new ArrayList<MksChangePackage>(changeLists.length);


        final MksChangeListAdapter adapter = mksVcs.getChangeListAdapter();
        for (final ChangeList changeList : changeLists) {
            final MksChangePackage aPackage = adapter.getMksChangePackage(changeList.getName());
            if (null != aPackage) {
                changePackages.add(aPackage);
            }
        }
        return changePackages;
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.