tikhomirov@1: /** tikhomirov@1: * Copyright (c) 2010 Artem Tikhomirov tikhomirov@1: */ tikhomirov@1: package com.tmate.hgkit.console; tikhomirov@1: tikhomirov@2: import com.tmate.hgkit.fs.RepositoryLookup; tikhomirov@1: import com.tmate.hgkit.ll.HgRepository; tikhomirov@1: tikhomirov@1: /** tikhomirov@1: * @author artem tikhomirov@1: * tikhomirov@1: */ tikhomirov@1: public class Cat { tikhomirov@1: tikhomirov@1: public static void main(String[] args) throws Exception { tikhomirov@2: RepositoryLookup repoLookup = new RepositoryLookup(); tikhomirov@1: HgRepository hgRepo = repoLookup.detect(args); tikhomirov@1: if (hgRepo.isInvalid()) { tikhomirov@1: System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); tikhomirov@1: return; tikhomirov@1: } tikhomirov@3: byte[] tipContent = hgRepo.getFileNode("hello.c").content(); tikhomirov@3: System.out.println(new String(tipContent)); tikhomirov@1: } tikhomirov@1: }