コード例 #1
0
  private ChangeListWorker(final ChangeListWorker worker) {
    myProject = worker.myProject;
    myMap = new LinkedHashMap<String, LocalChangeList>();
    myIdx = new ChangeListsIndexes(worker.myIdx);
    myLocallyDeleted = worker.myLocallyDeleted.copy();
    mySwitchedHolder = worker.mySwitchedHolder.copy();
    myDelta = worker.myDelta;
    myListsToDisappear = new LinkedList<String>(worker.myListsToDisappear);

    LocalChangeList defaultList = null;
    for (LocalChangeList changeList : worker.myMap.values()) {
      final LocalChangeList copy = changeList.copy();

      final String changeListName = copy.getName();
      myMap.put(changeListName, copy);
      if (copy.isDefault()) {
        defaultList = copy;
      }
    }
    if (defaultList == null) {
      LOG.info("default list not found when copy");
      defaultList = myMap.get(worker.getDefaultListName());
    }

    if (defaultList == null) {
      LOG.info("default list not found when copy in original object too");
      if (!myMap.isEmpty()) {
        defaultList = myMap.values().iterator().next();
      } else {
        // can be when there's no vcs configured
        /// LOG.error("no changelists at all");
      }
    }
    myDefault = defaultList;
  }
コード例 #2
0
 @Override
 public LocalChangeList findOrCreateList(final String name, final String comment) {
   LocalChangeList list = myWorker.getCopyByName(name);
   if (list == null) {
     list = addChangeList(name, comment);
   }
   return list;
 }
コード例 #3
0
 @Override
 public void setDefaultChangeList(@NotNull String list) {
   myWorker.setDefault(list);
 }
コード例 #4
0
 @Override
 public FileStatus getStatus(@NotNull FilePath filePath) {
   return myWorker.getStatus(filePath);
 }
コード例 #5
0
 @Deprecated
 @Override
 public FileStatus getStatus(File file) {
   return myWorker.getStatus(VcsUtil.getFilePath(file));
 }
コード例 #6
0
 @Override
 public FileStatus getStatus(VirtualFile file) {
   return myWorker.getStatus(file);
 }
コード例 #7
0
 @Override
 public void setListsToDisappear(final Collection<String> names) {
   myWorker.setListsToDisappear(names);
 }
コード例 #8
0
 @Override
 public void editName(String oldName, String newName) {
   myWorker.editName(oldName, newName);
 }
コード例 #9
0
 @Override
 public void editComment(final String name, final String comment) {
   myWorker.editComment(name, comment);
 }
コード例 #10
0
 @Override
 public LocalChangeList addChangeList(final String name, final String comment) {
   return myWorker.addChangeList(null, name, comment, true, null);
 }
コード例 #11
0
 @Nullable
 @Override
 public LocalChangeList findChangeList(final String name) {
   return myWorker.getCopyByName(name);
 }
コード例 #12
0
 @Override
 public List<LocalChangeList> getListsCopy() {
   return myWorker.getListsCopy();
 }