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 126385
Collapse All | Expand All

(-)a/mercurial/src/org/netbeans/modules/mercurial/MercurialInterceptor.java (-4 / +15 lines)
Lines 232-247 public class MercurialInterceptor extend Link Here
232
232
233
        RequestProcessor rp = hg.getRequestProcessor(root.getAbsolutePath());
233
        RequestProcessor rp = hg.getRequestProcessor(root.getAbsolutePath());
234
234
235
        Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): File: {0} {1}", new Object[] {srcFile, dstFile}); // NOI18N
236
237
        if (srcFile.isDirectory()) {
238
            srcFile.renameTo(dstFile);
239
        }
235
        Runnable moveImpl = new Runnable() {
240
        Runnable moveImpl = new Runnable() {
236
            public void run() {
241
            public void run() {
237
                try {
242
                try {
238
                    if (srcFile.isDirectory()) {
243
                    if (dstFile.isDirectory()) {
239
                        srcFile.renameTo(dstFile);
240
                        HgCommand.doRenameAfter(root, srcFile, dstFile);
244
                        HgCommand.doRenameAfter(root, srcFile, dstFile);
241
                        return;
245
                        return;
242
                    }
246
                    }
243
                    int status = hg.getFileStatusCache().getStatus(srcFile).getStatus();
247
                    int status = hg.getFileStatusCache().getStatus(srcFile).getStatus();
244
                    if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY) {
248
        Mercurial.LOG.log(Level.FINE, "hgMoveImplementation(): Status: {0} {1}", new Object[] {srcFile, status}); // NOI18N
249
                    if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY ||
250
                        status == FileInformation.STATUS_NOTVERSIONED_EXCLUDED) {
245
                        srcFile.renameTo(dstFile);
251
                        srcFile.renameTo(dstFile);
246
                    } else if (status == FileInformation.STATUS_VERSIONED_ADDEDLOCALLY) {
252
                    } else if (status == FileInformation.STATUS_VERSIONED_ADDEDLOCALLY) {
247
                        srcFile.renameTo(dstFile);
253
                        srcFile.renameTo(dstFile);
Lines 256-262 public class MercurialInterceptor extend Link Here
256
            }
262
            }
257
        };
263
        };
258
264
259
        rp.post(moveImpl).waitFinished();
265
        rp.post(moveImpl);
260
    }
266
    }
261
267
262
    public void afterMove(final File from, final File to) {
268
    public void afterMove(final File from, final File to) {
Lines 340-345 public class MercurialInterceptor extend Link Here
340
        HgProgressSupport supportCreate = new HgProgressSupport() {
346
        HgProgressSupport supportCreate = new HgProgressSupport() {
341
            public void perform() {
347
            public void perform() {
342
                Mercurial.LOG.log(Level.FINE, "fileChangedImpl(): File: {0}", file); // NOI18N
348
                Mercurial.LOG.log(Level.FINE, "fileChangedImpl(): File: {0}", file); // NOI18N
349
                // There is no point in refreshing the cache for ignored files.
350
                if (!HgUtils.isIgnored(file, false)) {
351
                    cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN);
352
                }
353
343
                cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN);
354
                cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN);
344
            }
355
            }
345
        };
356
        };
(-)a/mercurial/src/org/netbeans/modules/mercurial/util/HgUtils.java (-2 / +8 lines)
Lines 241-246 public class HgUtils { Link Here
241
     * @return boolean true - ignore, false - not ignored
241
     * @return boolean true - ignore, false - not ignored
242
     */
242
     */
243
    public static boolean isIgnored(File file){
243
    public static boolean isIgnored(File file){
244
        return isIgnored(file, true);
245
    }
246
247
    public static boolean isIgnored(File file, boolean checkSharability){
244
        if (file == null) return false;
248
        if (file == null) return false;
245
        String name = file.getPath();
249
        String name = file.getPath();
246
        File topFile = Mercurial.getInstance().getTopmostManagedParent(file);
250
        File topFile = Mercurial.getInstance().getTopmostManagedParent(file);
Lines 268-275 public class HgUtils { Link Here
268
        }
272
        }
269
273
270
        if (FILENAME_HGIGNORE.equals(name)) return false;
274
        if (FILENAME_HGIGNORE.equals(name)) return false;
271
        int sharability = SharabilityQuery.getSharability(file);
275
        if (checkSharability) {
272
        if (sharability == SharabilityQuery.NOT_SHARABLE) return true;
276
            int sharability = SharabilityQuery.getSharability(file);
277
            if (sharability == SharabilityQuery.NOT_SHARABLE) return true;
278
        }
273
        return false;
279
        return false;
274
    }
280
    }
275
281

Return to bug 126385