Mercurial > hg4j
comparison src/com/tmate/hgkit/console/Log.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 | aa1912c70b36 |
comparison
equal
deleted
inserted
replaced
| 2:08db726a0fb7 | 3:24bb4f365164 |
|---|---|
| 19 if (hgRepo.isInvalid()) { | 19 if (hgRepo.isInvalid()) { |
| 20 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); | 20 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); |
| 21 return; | 21 return; |
| 22 } | 22 } |
| 23 System.out.println(hgRepo.getLocation()); | 23 System.out.println(hgRepo.getLocation()); |
| 24 final Changeset.Callback callback = new Changeset.Callback() { | 24 final Changeset.Inspector callback = new Changeset.Inspector() { |
| 25 | 25 |
| 26 public void next(Changeset cset) { | 26 public void next(Changeset cset) { |
| 27 System.out.println(); | 27 System.out.println("==>"); |
| 28 cset.dump(); | |
| 28 } | 29 } |
| 29 }; | 30 }; |
| 30 HgDataFile f1 = hgRepo.getFileNode("hello.c"); | 31 HgDataFile f1 = hgRepo.getFileNode("hello.c"); |
| 31 System.out.println("Complete of a file:"); | 32 System.out.println("Complete of a file:"); |
| 32 f1.history(callback); | 33 f1.history(callback); |
| 33 System.out.println("Range 1-3:"); | |
| 34 f1.history(1,3, callback); | |
| 35 // | 34 // |
| 35 // System.out.println("\n\n========================="); | |
| 36 // System.out.println("Range 1-3:"); | |
| 37 // f1.history(1,3, callback); | |
| 38 // | |
| 39 System.out.println("\n\n========================="); | |
| 36 System.out.println("Complete of a repo:"); | 40 System.out.println("Complete of a repo:"); |
| 37 hgRepo.getChangelog().all(callback); | 41 hgRepo.getChangelog().all(callback); |
| 38 //new ChangelogWalker().setFile("hello.c").setRevisionRange(1, 4).accept(new Visitor); | 42 //new ChangelogWalker().setFile("hello.c").setRevisionRange(1, 4).accept(new Visitor); |
| 39 } | 43 } |
| 40 | 44 |
