/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* Parse source history for a Perforce Repository
*
* @author Emilio Monti - emilmont@gmail.com
*/
public class PerforceHistoryParser {
/**
* Parse the history for the specified file.
*
* @param file the file to parse history for
* @param repos Pointer to the {@code PerforceRepository}
* @return object representing the file's history
* @throws HistoryException if a problem occurs while executing p4 command
*/
return null;
}
try {
if (file.isDirectory()) {
} else {
}
} catch (IOException ioe) {
throw new HistoryException(ioe);
}
return history;
}
}
}
+ " (\\d{2}):(\\d{2}):(\\d{2}) by ([^@]+)");
+ "(\\d{2}):(\\d{2}):(\\d{2}) by ([^@]+)@\\S* '([^']*)'");
/**
* Parses the history in the given string. The given reader will be closed.
*
* @param fileHistory String with history to parse
* @return History object with all the history entries
* @throws java.io.IOException if it fails to read from the supplied reader
*/
/* OUTPUT:
Directory changelog:
Change 177601 on 2008/02/12 by user@host 'description'
*/
}
}
return history;
}
/**
* Parse file log. Te supplied reader will be closed.
*
* @param fileLog reader to the information to parse
* @return A history object containing history entries
* @throws java.io.IOException If it fails to read from the supplied reader.
*/
/* An entry finishes when a new entry starts ... */
}
/* New entry */
entry = new HistoryEntry();
} else {
* is encountered */
} else {
}
}
}
}
/* ... an entry can also finish when the log is finished */
}
return history;
}
/**
* Create a Date object representing the specified date.
*
* @param year the year
* @param month the month (January is 1, February is 2, ...)
* @param day the day of the month
* @param hour of the day
* @param minute of the day
* @param second of the day
* @return a Date object representing the date
*/
// Convert 1-based month to 0-based
}
}