Package org.hivedb.teamcity.plugin

Examples of org.hivedb.teamcity.plugin.Commit


   
    Collection<Commit> commits = new ArrayList<Commit>();
    BufferedReader r = new BufferedReader(new StringReader(log));
    try {
      String line;
      Commit current = new Commit();
      while ((line = r.readLine()) != null) {
        if (line == null || line.trim().equals(""))
          continue;
        else {
          if (line.startsWith("commit")) {
            if (current.isValid()) {
              commits.add(current);
              current = new Commit();
            }
            current.setHash(line.replaceAll("commit", "").trim());
          }
          else if (line.startsWith("Author"))
            current.setAuthor(line.replaceAll("Author:", "").trim());
          else if (line.startsWith("Date")) {
            String dateString = line.replaceAll("Date:", "").trim();
            current.setDate(Constants.GIT_DATE.parse(dateString));
          }
          else if (line.startsWith("    ")) {
            current.setMessage(current.getMessage() + "\n" + line);
          }
          else {
            Matcher m = nameAndStatus.matcher(line);
            while (m.find()) {
              NameAndStatus change = new NameAndStatus(m.group(2), m.group(1));
              current.getChanges().add(change);
            }
          }
        }
      }
      if (current.isValid()) {
        commits.add(current);
      }
    }
    catch (IOException e) {
      throw new RuntimeException(e);
View Full Code Here

TOP

Related Classes of org.hivedb.teamcity.plugin.Commit

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.