Mercurial > hg4j
view src/com/tmate/hgkit/console/Cat.java @ 3:24bb4f365164
Rudimentary log functionality with basic infrastructure is in place
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 20 Dec 2010 02:50:36 +0100 |
parents | 08db726a0fb7 |
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)); } }