Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Log.java @ 129:645829962785
core.Cset renamed to HgChangeset; repo.Changeset moved into HgChangelog
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 16 Feb 2011 20:32:29 +0100 |
| parents | cea84c5995e6 |
| children | aa1629f36482 |
comparison
equal
deleted
inserted
replaced
| 128:44b97930570c | 129:645829962785 |
|---|---|
| 18 | 18 |
| 19 import java.util.Formatter; | 19 import java.util.Formatter; |
| 20 import java.util.LinkedList; | 20 import java.util.LinkedList; |
| 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.HgChangeset; |
| 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.Nodeid; |
| 27 import org.tmatesoft.hg.core.Path; | 27 import org.tmatesoft.hg.core.Path; |
| 28 import org.tmatesoft.hg.repo.HgChangelog; | 28 import org.tmatesoft.hg.repo.HgChangelog; |
| 133 | 133 |
| 134 public void copy(FileRevision from, FileRevision to) { | 134 public void copy(FileRevision from, FileRevision to) { |
| 135 System.out.printf("Got notified that %s(%s) was originally known as %s(%s)\n", to.getPath(), to.getRevision(), from.getPath(), from.getRevision()); | 135 System.out.printf("Got notified that %s(%s) was originally known as %s(%s)\n", to.getPath(), to.getRevision(), from.getPath(), from.getRevision()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 public void next(Cset changeset) { | 138 public void next(HgChangeset changeset) { |
| 139 final String s = print(changeset); | 139 final String s = print(changeset); |
| 140 if (reverseOrder) { | 140 if (reverseOrder) { |
| 141 // XXX in fact, need to insert s into l according to changeset.getRevision() | 141 // XXX in fact, need to insert s into l according to changeset.getRevision() |
| 142 // because when file history is being followed, revisions of the original file (with smaller revNumber) | 142 // because when file history is being followed, revisions of the original file (with smaller revNumber) |
| 143 // are reported *after* revisions of present file and with addFirst appear above them | 143 // are reported *after* revisions of present file and with addFirst appear above them |
| 156 } | 156 } |
| 157 l.clear(); | 157 l.clear(); |
| 158 changelogWalker = null; | 158 changelogWalker = null; |
| 159 } | 159 } |
| 160 | 160 |
| 161 private String print(Cset cset) { | 161 private String print(HgChangeset cset) { |
| 162 StringBuilder sb = new StringBuilder(); | 162 StringBuilder sb = new StringBuilder(); |
| 163 Formatter f = new Formatter(sb); | 163 Formatter f = new Formatter(sb); |
| 164 final Nodeid csetNodeid = cset.getNodeid(); | 164 final Nodeid csetNodeid = cset.getNodeid(); |
| 165 f.format("changeset: %d:%s\n", cset.getRevision(), complete ? csetNodeid : csetNodeid.shortNotation()); | 165 f.format("changeset: %d:%s\n", cset.getRevision(), complete ? csetNodeid : csetNodeid.shortNotation()); |
| 166 if (cset.getRevision() == tip || repo.getTags().isTagged(csetNodeid)) { | 166 if (cset.getRevision() == tip || repo.getTags().isTagged(csetNodeid)) { |
