/*******************************************************************************
 * Copyright (c) 2006-2008 VecTrace (Zingo Andersen) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Bastian Doetsch
 *******************************************************************************/
package com.vectrace.MercurialEclipse.menu;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.WizardDialog;

import com.vectrace.MercurialEclipse.team.cache.LocalChangesetCache;
import com.vectrace.MercurialEclipse.wizards.TransplantWizard;

public class TransplantHandler extends SingleResourceHandler {

    @Override
    protected void run(IResource resource) throws Exception {
        IProject project = resource.getProject();        
        TransplantWizard transplantWizard = new TransplantWizard(project);                       
        WizardDialog transplantWizardDialog = new WizardDialog(getShell(),transplantWizard);
        transplantWizardDialog.open();
        LocalChangesetCache.getInstance().refreshAllLocalRevisions(project, true);
    }

}

@@ -644,16 +644,56 @@
 source;%0A
+import org.eclipse.jface.window.Window;%0A
 import o
@@ -779,35 +779,26 @@
 m.cache.
-LocalChangesetCache
+RefreshJob
 ;%0Aimport
@@ -1044,24 +1044,16 @@
 oject();
-        
 %0A       
@@ -1123,31 +1123,8 @@
 ct);
-                       
 %0A   
@@ -1220,16 +1220,29 @@
 %0A       
+ int result =
  transpl
@@ -1277,82 +1277,151 @@
     
-LocalChangesetCache.getInstance().refreshAllLocalRevisions(project, true);
+if (result == Window.OK) %7B%0A            new RefreshJob(%22Refresh after transplant%22, project, RefreshJob.LOCAL_AND_OUTGOING).schedule();%0A        %7D
 %0A   

Fix for issue #10473 and issue #10474: there should be cache refresh after transplant operation.