Package net.sourceforge.cruisecontrol

Examples of net.sourceforge.cruisecontrol.Modification


     * behavior is assigned here because we don't have a repository to query the
     * modification.  All modifications will be set to type "change" and
     * userName "User".
     */
    private void addRevision(File revision) {
        Modification mod = new Modification("filesystem");

        mod.userName = getUserName();

        Modification.ModifiedFile modfile = mod.createModifiedFile(revision.getName(), revision.getParent());
        modfile.action = "change";

        mod.modifiedTime = new Date(revision.lastModified());
        mod.comment = "";
        modifications.add(mod);
View Full Code Here


        private void initializeModification() {
            if (modificationList == null) {
                modificationList = new ArrayList();
            }
            modification = new Modification("pvcs");
            firstModifiedTime = true;
            firstUserName = true;
            nextLineIsComment = false;
            waitingForNextValidStart = false;
        }
View Full Code Here

                    }
                    return false;
                }
            });

            Modification mostRecent = null;

            for (int i = 0; i < newLogs.length; i++) {
                Modification modification = new Modification("buildstatus");
                String name = newLogs[i].getName();

                modification.modifiedTime = Log.parseDateFromLogFileName(name);
                modification.userName = "cc-" + getProjectFromLog(newLogs[i]);
                modification.comment = logDir.substring(logDir.lastIndexOf('/') + 1);
                modification.revision = Log.parseLabelFromLogFileName(name);

                Modification.ModifiedFile modfile = modification.createModifiedFile(name, null);
                modfile.revision = modification.revision;
                modfile.action = "add";

                if (mostRecent == null || modification.modifiedTime.after(mostRecent.modifiedTime)) {
                    mostRecent = modification;
View Full Code Here

            log.error("Could not connect to 'url'", e);
            return new ArrayList();
        }
        List modifiedList = new ArrayList();
        if (lastModified > lastBuild.getTime()) {
            Modification mod = new Modification("http");
            mod.createModifiedFile(url.getFile().substring(1), url.getHost());

            mod.userName = getUserName();
            mod.modifiedTime = new Date(lastModified);
            mod.comment = "";
            modifiedList.add(mod);
View Full Code Here

      String line = reader.readLine();

      // -meh. Kind of lame, but total-0 will work.
      if (!"total-0".equals(line)) {
         while ((line = reader.readLine()) != null) {
             Modification mod = parseOutputLine(line);
             if (mod != null) { listMods.add(mod); }
         }
      }

      return listMods;
View Full Code Here

   protected Modification parseOutputLine(String str) {
      LOG.debug("Output-" + str + "-\n");

      if (str == null || str.length() == 0) { return null; }
      Modification mod = new Modification("sscm");
      Modification.ModifiedFile modfile = mod.createModifiedFile(null, null);

      boolean fValid = false;
      String strToken = "><";
      int iLeft = 1;
View Full Code Here

        }

        /*
         *  Now read in each modification.
         */
        Modification mod = new Modification("snapshotcm");
        mod.createModifiedFile(fileName, folderName);

        while (st.hasMoreTokens()) {
            line = st.nextToken();
            if (line.equals(REVISION_HEADER) || !st.hasMoreTokens()) {
                if (!line.trim().equals("") && !line.equals(REVISION_HEADER)) {
                    //consider this part of the comment.
                    mod.comment += line;
                }

                //Save the modification
                modifications.add(mod);
                mod = new Modification("snapshotcm");
                mod.createModifiedFile(fileName, folderName);
            } else if (line.startsWith("Revision: ")) {  //e.g. Revision: 46 (current)   Derivation:    45 --> (46)
                int nextSpaceDelimiterIndex = line.indexOf(" ", 10);
                int endIndex = nextSpaceDelimiterIndex > -1 ? nextSpaceDelimiterIndex : line.length();
                mod.revision = line.substring(10, endIndex);
            } else if (line.startsWith("Date: ")) {  //e.g. Date: 2004/01/06 17:00:38 -0700;  Size:    39459 bytes
View Full Code Here

                //Go to the next line.
                nextLine = reader.readLine();
            }

            Modification nextModification = new Modification("cvs");
            nextModification.revision = revision;

            int lastSlashIndex = workingFileName.lastIndexOf("/");

            String fileName, folderName = null;
            fileName = workingFileName.substring(lastSlashIndex + 1);
            if (lastSlashIndex != -1) {
                folderName = workingFileName.substring(0, lastSlashIndex);
            }
            Modification.ModifiedFile modfile = nextModification.createModifiedFile(fileName, folderName);
            modfile.revision = nextModification.revision;

            try {
                if (newCVSVersion) {
                    nextModification.modifiedTime = DateUtil.parseCVSDate(
View Full Code Here

                currLine = reader.readLine();
                while (currLine != null && !currLine.startsWith("*****")) {
                    vssEntry.add(currLine);
                    currLine = reader.readLine();
                }
                Modification mod = handleEntry(vssEntry);
                if (mod != null) {
                    modifications.add(mod);
                }
            } else {
                currLine = reader.readLine();
View Full Code Here

                nameAndDateIndex++;
                nameAndDateLine = (String) entry.get(nameAndDateIndex);
                LOG.debug("adjusting for the line that starts with Label");
            }

            Modification modification = new Modification("vss");
            modification.userName = parseUser(nameAndDateLine);
            modification.modifiedTime = parseDate(nameAndDateLine);

            String folderLine = (String) entry.get(0);
            int fileIndex = nameAndDateIndex + 1;
            String fileLine = (String) entry.get(fileIndex);

            if (fileLine.startsWith("Checked in")) {

                LOG.debug("this is a checkin");
                int commentIndex = fileIndex + 1;
                modification.comment = parseComment(entry, commentIndex);
                String fileName = folderLine.substring(7, folderLine.indexOf("  *"));
                String folderName = fileLine.substring(12);

                Modification.ModifiedFile modfile = modification.createModifiedFile(fileName, folderName);
                modfile.action = "checkin";

            } else if (fileLine.endsWith("Created")) {
                modification.type = "create";
                LOG.debug("this folder was created");
            } else {
                String fileName;
                String folderName;

                if (nameAndDateIndex == 1) {
                    folderName = vssPath;
                } else {
                    folderName = vssPath + "\\" + folderLine.substring(7, folderLine.indexOf("  *"));
                }
                int lastSpace = fileLine.lastIndexOf(" ");
                if (lastSpace != -1) {
                    fileName = fileLine.substring(0, lastSpace);
                } else {
                    fileName = fileLine;
                    if (fileName.equals("Branched")) {
                        LOG.debug("Branched file, ignoring as branch directory is handled separately");
                        return null;
                    }
                }

                Modification.ModifiedFile modfile = modification.createModifiedFile(fileName, folderName);

                if (fileLine.endsWith("added")) {
                    modfile.action = "add";
                    LOG.debug("this file was added");
                } else if (fileLine.endsWith("deleted")) {
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.Modification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.