Mercurial > hg4j
changeset 519:934037edbea0
Few toString() implementations to ease debug
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 20 Dec 2012 20:21:59 +0100 |
parents | 0d5e1ea7955e |
children | 1ee452f31187 |
files | src/org/tmatesoft/hg/core/HgChangeset.java src/org/tmatesoft/hg/core/HgFileRevision.java test/org/tmatesoft/hg/test/LogOutputParser.java |
diffstat | 3 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgChangeset.java Thu Dec 20 19:55:45 2012 +0100 +++ b/src/org/tmatesoft/hg/core/HgChangeset.java Thu Dec 20 20:21:59 2012 +0100 @@ -286,6 +286,12 @@ } } + @Override + public String toString() { + return String.format("HgChangeset(%d:%s)", revNumber, nodeid.shortNotation()); + + } + private HgRepository getRepo() { return shared.statusHelper.getRepo(); }
--- a/src/org/tmatesoft/hg/core/HgFileRevision.java Thu Dec 20 19:55:45 2012 +0100 +++ b/src/org/tmatesoft/hg/core/HgFileRevision.java Thu Dec 20 20:21:59 2012 +0100 @@ -150,6 +150,11 @@ int revisionIndex = fn.getRevisionIndex(revision); fn.contentWithFilters(revisionIndex, sink); } + + @Override + public String toString() { + return String.format("HgFileRevision(%s, %s)", getPath().toString(), revision.shortNotation()); + } private void checkCopy() throws HgException { HgDataFile fn = repo.getFileNode(path);
--- a/test/org/tmatesoft/hg/test/LogOutputParser.java Thu Dec 20 19:55:45 2012 +0100 +++ b/test/org/tmatesoft/hg/test/LogOutputParser.java Thu Dec 20 20:21:59 2012 +0100 @@ -102,5 +102,10 @@ public String user; public String date; public String description; + + @Override + public String toString() { + return String.format("R(%d:%s)", changesetIndex, changesetNodeid.substring(0, 7)); + } } }