From a248a7d85931d2eef7978dbb3f99e76494d0f9b0 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Wed, 23 Jun 2010 15:40:27 +0400 Subject: [PATCH] introduce field in setUp fixed --- .../src/com/intellij/history/LocalHistory.java | 2 ++ .../integration/revertion/ChangeRevertingVisitor.java | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/platform/lvcs-api/src/com/intellij/history/LocalHistory.java b/platform/lvcs-api/src/com/intellij/history/LocalHistory.java index 41ecd8d7bb29..0900322f4ba8 100644 --- a/platform/lvcs-api/src/com/intellij/history/LocalHistory.java +++ b/platform/lvcs-api/src/com/intellij/history/LocalHistory.java @@ -22,6 +22,8 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; public abstract class LocalHistory { + public static final Object VFS_EVENT_REQUESTOR = new Object(); + public static LocalHistory getInstance() { return ApplicationManager.getApplication().getComponent(LocalHistory.class); } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeRevertingVisitor.java b/platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeRevertingVisitor.java index d6f6444923c7..581250598105 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeRevertingVisitor.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeRevertingVisitor.java @@ -16,6 +16,7 @@ package com.intellij.history.integration.revertion; +import com.intellij.history.LocalHistory; import com.intellij.history.core.Paths; import com.intellij.history.core.changes.*; import com.intellij.history.core.storage.Content; @@ -64,7 +65,7 @@ public class ChangeRevertingVisitor extends ChangeVisitor { if (f != null) { unregisterDelayedApplies(f); try { - f.delete(this); + f.delete(LocalHistory.VFS_EVENT_REQUESTOR); } catch (IOException e) { throw new RuntimeIOException(e); @@ -96,9 +97,9 @@ public class ChangeRevertingVisitor extends ChangeVisitor { VirtualFile existing = f.getParent().findChild(c.getOldName()); try { if (existing != null && existing != f) { - existing.delete(this); + existing.delete(LocalHistory.VFS_EVENT_REQUESTOR); } - f.rename(this, c.getOldName()); + f.rename(LocalHistory.VFS_EVENT_REQUESTOR, c.getOldName()); } catch (IOException e) { throw new RuntimeIOException(e); @@ -127,8 +128,8 @@ public class ChangeRevertingVisitor extends ChangeVisitor { try { VirtualFile parent = myGateway.findOrCreateFileSafely(c.getOldParent(), true); VirtualFile existing = parent.findChild(f.getName()); - if (existing != null) existing.delete(this); - f.move(this, parent); + if (existing != null) existing.delete(LocalHistory.VFS_EVENT_REQUESTOR); + f.move(LocalHistory.VFS_EVENT_REQUESTOR, parent); } catch (IOException e) { throw new RuntimeIOException(e);