view src/com/tmate/hgkit/console/Cat.java @ 4:aa1912c70b36

Fix offset issue for inline revlogs. Commandline processing.
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 20 Dec 2010 04:20:52 +0100
parents 24bb4f365164
children fc265ddeab26
line wrap: on
line source
/**
 * Copyright (c) 2010 Artem Tikhomirov 
 */
package com.tmate.hgkit.console;

import com.tmate.hgkit.fs.RepositoryLookup;
import com.tmate.hgkit.ll.HgRepository;

/**
 * @author artem
 *
 */
public class Cat {

	public static void main(String[] args) throws Exception {
		RepositoryLookup repoLookup = new RepositoryLookup();
		HgRepository hgRepo = repoLookup.detect(args);
		if (hgRepo.isInvalid()) {
			System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation());
			return;
		}
		byte[] tipContent = hgRepo.getFileNode("hello.c").content();
		System.out.println(new String(tipContent));
	}
}