# HG changeset patch # User padraigob@netbeans.org # Date 1202223973 0 # Node ID 398ae70aefd8523c979b36b47fcc09e4b5398173 # Parent cdf7693cd4935c90df66385a7d53218a84191c66 126590: Do move immediately rather than in background. diff -r cdf7693cd493 -r 398ae70aefd8 mercurial/src/org/netbeans/modules/mercurial/MercurialInterceptor.java --- a/mercurial/src/org/netbeans/modules/mercurial/MercurialInterceptor.java Tue Feb 05 08:54:29 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/MercurialInterceptor.java Tue Feb 05 15:06:13 2008 +0000 @@ -234,9 +234,7 @@ public class MercurialInterceptor extend Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): File: {0} {1}", new Object[] {srcFile, dstFile}); // NOI18N - if (srcFile.isDirectory()) { - srcFile.renameTo(dstFile); - } + srcFile.renameTo(dstFile); Runnable moveImpl = new Runnable() { public void run() { try { @@ -244,17 +242,15 @@ public class MercurialInterceptor extend HgCommand.doRenameAfter(root, srcFile, dstFile); return; } - int status = hg.getFileStatusCache().getStatus(srcFile).getStatus(); - Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): Status: {0} {1}", new Object[] {srcFile, status}); // NOI18N + int status = HgCommand.getSingleStatus(root, srcFile.getParent(), srcFile.getName()).getStatus(); + Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): Status: {0} {1}", new Object[] {srcFile, status}); // NOI18N if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY || status == FileInformation.STATUS_NOTVERSIONED_EXCLUDED) { - srcFile.renameTo(dstFile); } else if (status == FileInformation.STATUS_VERSIONED_ADDEDLOCALLY) { - srcFile.renameTo(dstFile); HgCommand.doRemove(root, srcFile); HgCommand.doAdd(root, dstFile); } else { - HgCommand.doRename(root, srcFile, dstFile); + HgCommand.doRenameAfter(root, srcFile, dstFile); } } catch (HgException e) { Mercurial.LOG.log(Level.FINE, "Mercurial failed to rename: File: {0} {1}", new Object[] {srcFile.getAbsolutePath(), dstFile.getAbsolutePath()}); // NOI18N