boolean () { ChangeListManager changeListManager = ChangeListManager.getInstance(myMergeContext.getProject()); int i = 0; boolean needRefresh = false; while (true) { String name = myMergeContext.getMergeTitle() + (i > 0 ? " (" + i + ")" : ""); LocalChangeList changeList = changeListManager.findChangeList(name); if (changeList == null) { changeListManager.setDefaultChangeList(changeListManager.addChangeList(name, null)); needRefresh = true; break; } if (changeList.getChanges().isEmpty()) { if (!changeList.isDefault()) { changeListManager.setDefaultChangeList(changeList); needRefresh = true; } break; } i++; } return needRefresh; }