diff src/org/tmatesoft/hg/core/Nodeid.java @ 78:c25c5c348d1b

Skip metadata in the beginning of a file content. Parse metadata, recognize copies/renames
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 25 Jan 2011 02:13:53 +0100
parents 6f1b88693d48
children a3a2e5deb320
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/Nodeid.java	Mon Jan 24 05:33:47 2011 +0100
+++ b/src/org/tmatesoft/hg/core/Nodeid.java	Tue Jan 25 02:13:53 2011 +0100
@@ -117,6 +117,13 @@
 		return new Nodeid(b, false);
 	}
 
+	public static Nodeid fromAscii(String asciiRepresentation) {
+		if (asciiRepresentation.length() != 40) {
+			throw new IllegalArgumentException();
+		}
+		// XXX is better impl for String possible?
+		return fromAscii(asciiRepresentation.getBytes(), 0, 40);
+	}
 	public static Nodeid fromAscii(byte[] asciiRepresentation, int offset, int length) {
 		if (length != 40) {
 			throw new IllegalArgumentException();