Mercurial > jhg
comparison cmdline/org/tmatesoft/hg/console/Log.java @ 74:6f1b88693d48
Complete refactoring to org.tmatesoft
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Mon, 24 Jan 2011 03:14:45 +0100 |
| parents | 9a03a80a0f2f |
| children | c677e1593919 |
comparison
equal
deleted
inserted
replaced
| 73:0d279bcc4442 | 74:6f1b88693d48 |
|---|---|
| 21 import java.util.List; | 21 import java.util.List; |
| 22 | 22 |
| 23 import org.tmatesoft.hg.core.Cset; | 23 import org.tmatesoft.hg.core.Cset; |
| 24 import org.tmatesoft.hg.core.LogCommand; | 24 import org.tmatesoft.hg.core.LogCommand; |
| 25 import org.tmatesoft.hg.core.LogCommand.FileRevision; | 25 import org.tmatesoft.hg.core.LogCommand.FileRevision; |
| 26 import org.tmatesoft.hg.core.Nodeid; | |
| 26 import org.tmatesoft.hg.core.Path; | 27 import org.tmatesoft.hg.core.Path; |
| 27 | 28 import org.tmatesoft.hg.repo.Changelog; |
| 28 import com.tmate.hgkit.fs.RepositoryLookup; | 29 import org.tmatesoft.hg.repo.HgDataFile; |
| 29 import com.tmate.hgkit.ll.HgDataFile; | 30 import org.tmatesoft.hg.repo.HgRepository; |
| 30 import com.tmate.hgkit.ll.HgRepository; | 31 |
| 31 import com.tmate.hgkit.ll.Nodeid; | |
| 32 import com.tmate.hgkit.ll.Revlog; | |
| 33 | 32 |
| 34 /** | 33 /** |
| 35 * @author Artem Tikhomirov | 34 * @author Artem Tikhomirov |
| 36 * @author TMate Software Ltd. | 35 * @author TMate Software Ltd. |
| 37 */ | 36 */ |
| 38 public class Log { | 37 public class Log { |
| 39 | 38 |
| 40 public static void main(String[] args) throws Exception { | 39 public static void main(String[] args) throws Exception { |
| 41 RepositoryLookup repoLookup = new RepositoryLookup(); | 40 Options cmdLineOpts = Options.parse(args); |
| 42 RepositoryLookup.Options cmdLineOpts = RepositoryLookup.Options.parse(args); | 41 HgRepository hgRepo = cmdLineOpts.findRepository(); |
| 43 HgRepository hgRepo = repoLookup.detect(cmdLineOpts); | |
| 44 if (hgRepo.isInvalid()) { | 42 if (hgRepo.isInvalid()) { |
| 45 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); | 43 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); |
| 46 return; | 44 return; |
| 47 } | 45 } |
| 48 System.out.println(hgRepo.getLocation()); | 46 System.out.println(hgRepo.getLocation()); |
| 122 boolean reverseOrder = false; | 120 boolean reverseOrder = false; |
| 123 boolean verbose = true; // roughly -v | 121 boolean verbose = true; // roughly -v |
| 124 // own | 122 // own |
| 125 private LinkedList<String> l = new LinkedList<String>(); | 123 private LinkedList<String> l = new LinkedList<String>(); |
| 126 private final HgRepository repo; | 124 private final HgRepository repo; |
| 127 private Revlog.ParentWalker changelogWalker; | 125 private Changelog.ParentWalker changelogWalker; |
| 128 private final int tip ; | 126 private final int tip ; |
| 129 | 127 |
| 130 public Dump(HgRepository hgRepo) { | 128 public Dump(HgRepository hgRepo) { |
| 131 repo = hgRepo; | 129 repo = hgRepo; |
| 132 tip = hgRepo.getChangelog().getRevisionCount() - 1; | 130 tip = hgRepo.getChangelog().getRevisionCount() - 1; |
