当前位置: 首页>>代码示例>>Java>>正文


Java ChangeListManager.ensureUpToDate方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.changes.ChangeListManager.ensureUpToDate方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeListManager.ensureUpToDate方法的具体用法?Java ChangeListManager.ensureUpToDate怎么用?Java ChangeListManager.ensureUpToDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.changes.ChangeListManager的用法示例。


在下文中一共展示了ChangeListManager.ensureUpToDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDoubleMoveBack

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDoubleMoveBack() throws Exception {
  enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
  final VirtualFile file = createFileInCommand("a.txt", "old content");
  final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  final LocalChangeList list = changeListManager.addChangeList("test", null);
  final LocalChangeList target = changeListManager.addChangeList("target", null);
  changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});

  myScheme.doTest(new Runnable() {
    @Override
    public void run() {
      changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file)});
      checkFilesAreInList(new VirtualFile[] {file}, target.getName(), changeListManager);
      changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
      checkFilesAreInList(new VirtualFile[] {file}, list.getName(), changeListManager);
    }
  });

  checkFilesAreInList(new VirtualFile[] {file}, list.getName(), changeListManager);

  changeListManager.ensureUpToDate(false);
  checkFilesAreInList(new VirtualFile[] {file}, list.getName(), changeListManager);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnConcurrentChangeListManagerTest.java

示例2: testAddPlusMove

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testAddPlusMove() throws Exception {
  enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
  final VirtualFile file = createFileInCommand("a.txt", "old content");
  final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  final LocalChangeList list = changeListManager.addChangeList("test", null);
  changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});

  final String targetName = "target";

  myScheme.doTest(new Runnable() {
    @Override
    public void run() {
      final LocalChangeList target = changeListManager.addChangeList(targetName, null);
      changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file)});
      checkFilesAreInList(new VirtualFile[] {file}, targetName, changeListManager);
    }
  });

  checkFilesAreInList(new VirtualFile[] {file}, targetName, changeListManager);

  changeListManager.ensureUpToDate(false);
  checkFilesAreInList(new VirtualFile[] {file}, targetName, changeListManager);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnConcurrentChangeListManagerTest.java

示例3: testRenameList

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testRenameList() throws Exception {
  enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
  final VirtualFile file = createFileInCommand("a.txt", "old content");
  final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  final LocalChangeList list = changeListManager.addChangeList("test", null);
  changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});

  final String newName = "renamed";

  myScheme.doTest(new Runnable() {
    @Override
    public void run() {
      changeListManager.editName(list.getName(), newName);
      checkFilesAreInList(new VirtualFile[] {file}, newName, changeListManager);
    }
  });

  checkFilesAreInList(new VirtualFile[] {file}, newName, changeListManager);

  changeListManager.ensureUpToDate(false);
  checkFilesAreInList(new VirtualFile[] {file}, newName, changeListManager);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SvnConcurrentChangeListManagerTest.java

示例4: testDir2File_MINE_ADD_THEIRS_MOVE

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDir2File_MINE_ADD_THEIRS_MOVE() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.DirToFile.MINE_ADD_THEIRS_MOVE);

  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNull(leftVersion);

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SvnTreeConflictDataTest.java

示例5: testFile2File_MINE_UNV_THEIRS_ADD

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2File_MINE_UNV_THEIRS_ADD() throws Exception {
  final ConflictCreator creator = new ConflictCreator(myProject, myTheirs, myWorkingCopyDir,
                                                      TreeConflictData.FileToFile.MINE_UNV_THEIRS_ADD, mySvnClientRunner);
  creator.create();
  final String conflictFile = TreeConflictData.FileToFile.MINE_UNV_THEIRS_ADD.getConflictFile();

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  Assert.assertNull(beforeDescription.getSourceLeftVersion());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:SvnTreeConflictDataTest.java

示例6: testFile2File_MINE_EDIT_THEIRS_DELETE

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2File_MINE_EDIT_THEIRS_DELETE() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToFile.MINE_EDIT_THEIRS_DELETE);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNotNull(leftVersion);
  Assert.assertTrue(leftVersion.isFile());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isNone());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SvnTreeConflictDataTest.java

示例7: testFile2File_MINE_DELETE_THEIRS_EDIT

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2File_MINE_DELETE_THEIRS_EDIT() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToFile.MINE_DELETE_THEIRS_EDIT);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNotNull(leftVersion);
  Assert.assertTrue(leftVersion.isFile());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SvnTreeConflictDataTest.java

示例8: testFile2File_MINE_EDIT_THEIRS_MOVE

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2File_MINE_EDIT_THEIRS_MOVE() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToFile.MINE_EDIT_THEIRS_MOVE);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNotNull(leftVersion);
  Assert.assertTrue(leftVersion.isFile());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isNone());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SvnTreeConflictDataTest.java

示例9: testFile2File_MINE_MOVE_THEIRS_EDIT

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2File_MINE_MOVE_THEIRS_EDIT() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToFile.MINE_MOVE_THEIRS_EDIT);

  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNotNull(leftVersion);
  Assert.assertTrue(leftVersion.isFile());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isFile());

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SvnTreeConflictDataTest.java

示例10: testFile2File_MINE_MOVE_THEIRS_ADD

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2File_MINE_MOVE_THEIRS_ADD() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToFile.MINE_MOVE_THEIRS_ADD);

  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNull(leftVersion);
  //Assert.assertEquals(NodeKind.FILE, leftVersion.getKind());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isFile());

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SvnTreeConflictDataTest.java

示例11: testDir2Dir_MINE_UNV_THEIRS_ADD

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDir2Dir_MINE_UNV_THEIRS_ADD() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.DirToDir.MINE_UNV_THEIRS_ADD);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNull(leftVersion);

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isDirectory());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:SvnTreeConflictDataTest.java

示例12: testDir2Dir_MINE_EDIT_THEIRS_MOVE

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDir2Dir_MINE_EDIT_THEIRS_MOVE() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.DirToDir.MINE_EDIT_THEIRS_MOVE);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNotNull(leftVersion);
  Assert.assertTrue(leftVersion.isDirectory());

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isNone());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SvnTreeConflictDataTest.java

示例13: testDir2File_MINE_MOVE_THEIRS_ADD

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDir2File_MINE_MOVE_THEIRS_ADD() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.DirToFile.MINE_MOVE_THEIRS_ADD);

  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNull(leftVersion);

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SvnTreeConflictDataTest.java

示例14: testFile2Dir_MINE_UNV_THEIRS_ADD

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2Dir_MINE_UNV_THEIRS_ADD() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToDir.MINE_UNV_THEIRS_ADD);

  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNull(leftVersion);

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isDirectory());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SvnTreeConflictDataTest.java

示例15: testFile2Dir_MINE_ADD_THEIRS_MOVE

import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testFile2Dir_MINE_ADD_THEIRS_MOVE() throws Exception {
  final String conflictFile = createConflict(TreeConflictData.FileToDir.MINE_ADD_THEIRS_MOVE);

  ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
  changeListManager.ensureUpToDate(false);

  VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
  Assert.assertNotNull(vf);
  final Change change = changeListManager.getChange(vf);
  Assert.assertTrue(change instanceof ConflictedSvnChange);
  TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
  Assert.assertNotNull(beforeDescription);

  final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
  Assert.assertNull(afterDescription);
  Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
  Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());

  Assert.assertTrue(beforeDescription.isTreeConflict());
  ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
  Assert.assertNull(leftVersion);

  final ConflictVersion version = beforeDescription.getSourceRightVersion();
  Assert.assertNotNull(version);
  Assert.assertTrue(version.isDirectory());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SvnTreeConflictDataTest.java


注:本文中的com.intellij.openapi.vcs.changes.ChangeListManager.ensureUpToDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。