This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 126590
Collapse All | Expand All

(-)a/mercurial/src/org/netbeans/modules/mercurial/MercurialInterceptor.java (-8 / +4 lines)
Lines 234-242 public class MercurialInterceptor extend Link Here
234
234
235
        Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): File: {0} {1}", new Object[] {srcFile, dstFile}); // NOI18N
235
        Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): File: {0} {1}", new Object[] {srcFile, dstFile}); // NOI18N
236
236
237
        if (srcFile.isDirectory()) {
237
        srcFile.renameTo(dstFile);
238
            srcFile.renameTo(dstFile);
239
        }
240
        Runnable moveImpl = new Runnable() {
238
        Runnable moveImpl = new Runnable() {
241
            public void run() {
239
            public void run() {
242
                try {
240
                try {
Lines 244-260 public class MercurialInterceptor extend Link Here
244
                        HgCommand.doRenameAfter(root, srcFile, dstFile);
242
                        HgCommand.doRenameAfter(root, srcFile, dstFile);
245
                        return;
243
                        return;
246
                    }
244
                    }
247
                    int status = hg.getFileStatusCache().getStatus(srcFile).getStatus();
245
                    int status = HgCommand.getSingleStatus(root, srcFile.getParent(), srcFile.getName()).getStatus();
248
        Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): Status: {0} {1}", new Object[] {srcFile, status}); // NOI18N
246
                    Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): Status: {0} {1}", new Object[] {srcFile, status}); // NOI18N
249
                    if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY ||
247
                    if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY ||
250
                        status == FileInformation.STATUS_NOTVERSIONED_EXCLUDED) {
248
                        status == FileInformation.STATUS_NOTVERSIONED_EXCLUDED) {
251
                        srcFile.renameTo(dstFile);
252
                    } else if (status == FileInformation.STATUS_VERSIONED_ADDEDLOCALLY) {
249
                    } else if (status == FileInformation.STATUS_VERSIONED_ADDEDLOCALLY) {
253
                        srcFile.renameTo(dstFile);
254
                        HgCommand.doRemove(root, srcFile);
250
                        HgCommand.doRemove(root, srcFile);
255
                        HgCommand.doAdd(root, dstFile);
251
                        HgCommand.doAdd(root, dstFile);
256
                    } else {
252
                    } else {
257
                        HgCommand.doRename(root, srcFile, dstFile);
253
                        HgCommand.doRenameAfter(root, srcFile, dstFile);
258
                    }
254
                    }
259
                } catch (HgException e) {
255
                } catch (HgException e) {
260
                    Mercurial.LOG.log(Level.FINE, "Mercurial failed to rename: File: {0} {1}", new Object[] {srcFile.getAbsolutePath(), dstFile.getAbsolutePath()}); // NOI18N
256
                    Mercurial.LOG.log(Level.FINE, "Mercurial failed to rename: File: {0} {1}", new Object[] {srcFile.getAbsolutePath(), dstFile.getAbsolutePath()}); // NOI18N

Return to bug 126590