APISonar


org.netbeans.modules.mercurial.Mercurial.LOG.log

> org > netbeans > modules > mercurial > Mercurial > LOG > log
org APIs netbeans APIs modules APIs mercurial APIs Mercurial APIs LOG APIs log APIs

Example 1
private static void logCommand (List<? extends Object> command) {
        if (Mercurial.LOG.isLoggable(Level.FINE)) {
            if (command.size() > 10) {
                List<String> smallCommand = new ArrayList<String>();
                int count = 0;
                for (Iterator i = command.iterator(); i.hasNext();) {
                    smallCommand.add((String)i.next());
                    if (count++ > 10) break;
                }
                Mercurial.LOG.log(Level.FINE, "execEnv(): {0}", smallCommand); // NOI18N
            } else {
                Mercurial.LOG.log(Level.FINE, "execEnv(): {0}", command); // NOI18N
            }
        }
    }
Example 2
public static boolean isAnnotationFormatValid(String format) {
        boolean retval = true;
        if (format != null) {
            try {
                new MessageFormat(format);
            } catch (IllegalArgumentException ex) {
                Mercurial.LOG.log(Level.FINER, "Bad user input - annotation format", ex);
                retval = false;
            }
        }
        return retval;
    }
Example 3
public static void createConflictFile(String path) {
        try {
            File file = new File(path + HG_STR_CONFLICT_EXT);

            boolean success = file.createNewFile();
            Mercurial.LOG.log(Level.FINE, "createConflictFile(): File: {0} {1}", // NOI18N
                new Object[] {path + HG_STR_CONFLICT_EXT, success? "Created": "Not Created"} ); // NOI18N
        } catch (IOException e) {
        }
    }
Example 4
public static <T> T runWithoutUI (Callable<T> callable) throws HgException {
        try {
            disabledUI.set(true);
            return callable.call();
        } catch (HgException ex) {
            throw ex;
        } catch (Exception ex) {
            Mercurial.LOG.log(Level.INFO, null, ex);
            throw new HgException(ex.getMessage());
        } finally {
            disabledUI.remove();
        }
    }
Example 5
public static void notifyException (Exception ex) {
        Mercurial.LOG.log(Level.FINE, null, ex);
        NotifyDescriptor.Exception e = new NotifyDescriptor.Exception(ex);
        DialogDisplayer.getDefault().notifyLater(e);
    }
Example 6
private File getCommonAncestor(File[] files) {
        File f1 = files[0];

        for (int i = 1; i < files.length; i++) {
            File f = getCommonAncestor(f1, files[i]);
            if (f == null) {
                Mercurial.LOG.log(Level.SEVERE, "Unable to get common parent of {0} and {1} ", // NOI18N
                        new Object[] {f1.getAbsolutePath(), files[i].getAbsolutePath()});
                // XXX not sure wat to do at this point
            } else {
                f1 = f;
            }
        }
        return f1;
    }
Example 7
private static void perform(File file, File repository, OutputLogger logger) {
        if (file == null) return;
        FileStatusCache cache = Mercurial.getInstance().getFileStatusCache();
        file = FileUtil.normalizeFile(file);
        try {
            HgCommand.markAsResolved(repository, file, logger);
        } catch (HgException ex) {
            Mercurial.LOG.log(Level.INFO, null, ex);
        }
        HgCommand.deleteConflictFile(file.getAbsolutePath());
        Mercurial.LOG.log(Level.FINE, "ConflictResolvedAction.perform(): DELETE CONFLICT File: {0}", // NOI18N
                new Object[] {file.getAbsolutePath() + HgCommand.HG_STR_CONFLICT_EXT} );
        cache.refresh(file);
    }
Example 8
public static synchronized HgVersioningTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Mercurial.LOG.log(Level.FINE, "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system."); // NOI18N
            return getDefault();
        }
        if (win instanceof HgVersioningTopComponent) {
            return (HgVersioningTopComponent)win;
        }
        Mercurial.LOG.log(Level.FINE, 
                "There seem to be multiple components with the '" + PREFERRED_ID + // NOI18N
                "' ID. That is a potential source of errors and unexpected behavior."); // NOI18N
        return getDefault();
    }
Example 9
private HgRevision getParentRevision(File file, String revision) {
        String key = getPreviousRevisionKey(file.getAbsolutePath(), revision);
        HgRevision parent = getPreviousRevisions().get(key);
        if (parent == null) {
            File originalFile = getOriginalFile(file, revision);
            try {
                parent = HgCommand.getParent(repositoryRoot, originalFile, revision);
            } catch (HgException ex) {
                Mercurial.LOG.log(Level.INFO, null, ex);
            }
            getPreviousRevisions().put(key, parent);
        }
        return parent;
    }
Example 10
protected void performContextAction (Node[] nodes) {
        VCSContext ctx = HgUtils.getCurrentContext(nodes);
        File root = HgUtils.getRootFile(ctx);
        if (root == null) {
            Mercurial.LOG.log(Level.FINE, "No versioned folder in the selected context for {0}", nodes); //NOI18N
            return;
        }
        HgShelveChangesSupport supp = new HgShelveChangesSupport();
        if (supp.open()) {
            RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(root);
            supp.startAsync(rp, root, ctx);
        }
    }
Example 11
public void perform() {
        OutputLogger logger = getLogger();
        try {
            this.branches = HgCommand.getBranches(root, OutputLogger.getLogger(null));
        } catch (HgException ex) {
            this.branches = new HgBranch[0];
            Mercurial.LOG.log(ex instanceof HgException.HgCommandCanceledException
                    ? Level.FINE
                    : Level.INFO, null, ex);
        }
        List<RepositoryRevision> results = search(fromRevision, toRevision, limitRevisions, branchName, this, logger);
        if (!isCanceled()) {
            checkFinished(results);
        }
    }
Example 12
private Ini loadRepoHgrcFile(File dir) {
        String filePath = dir.getAbsolutePath() + File.separator + HG_REPO_DIR + File.separator + HG_RC_FILE; // NOI18N
        configFileName = HG_RC_FILE;
        File file = FileUtil.normalizeFile(new File(filePath));
        Ini system = null;
        system = createIni(file);
        
        if(system == null) {
            system = createIni();
            Mercurial.LOG.log(Level.FINE, "Could not load the file " + filePath + ". Falling back on hg defaults."); // NOI18N
        }
        return system;
    }