Mercurial > hg4j
diff src/com/tmate/hgkit/console/Manifest.java @ 64:19e9e220bf68
Convenient commands constitute hi-level API. org.tmatesoft namespace, GPL2 statement
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 21 Jan 2011 05:56:43 +0100 |
parents | 603806cd2dc6 |
children |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/console/Manifest.java Tue Jan 18 18:42:50 2011 +0100 +++ b/src/com/tmate/hgkit/console/Manifest.java Fri Jan 21 05:56:43 2011 +0100 @@ -5,6 +5,10 @@ import static com.tmate.hgkit.ll.HgRepository.TIP; +import org.tmatesoft.hg.core.Path; +import org.tmatesoft.hg.core.RepositoryTreeWalker; +import org.tmatesoft.hg.core.LogCommand.FileRevision; + import com.tmate.hgkit.fs.RepositoryLookup; import com.tmate.hgkit.ll.HgManifest; import com.tmate.hgkit.ll.HgRepository; @@ -25,8 +29,26 @@ return; } System.out.println(hgRepo.getLocation()); - HgManifest.Inspector insp = new Dump(); - hgRepo.getManifest().walk(0, TIP, insp); + hgRepo.getManifest().walk(0, TIP, new Dump()); + // + new RepositoryTreeWalker(hgRepo).dirs(true).walk(new RepositoryTreeWalker.Handler() { + + public void begin(Nodeid manifestRevision) { + System.out.println(">> " + manifestRevision); + } + public void dir(Path p) { + System.out.println(p); + } + public void file(FileRevision fileRevision) { + System.out.print(fileRevision.getRevision());; + System.out.print(" "); + System.out.println(fileRevision.getPath()); + } + + public void end(Nodeid manifestRevision) { + System.out.println(); + } + }); } public static final class Dump implements HgManifest.Inspector {