comparison cmdline/org/tmatesoft/hg/console/ChangesetDumpHandler.java @ 423:9c9c442b5f2e

Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 23 Mar 2012 22:51:18 +0100
parents 2fadf8695f8a
children 31a89587eb04
comparison
equal deleted inserted replaced
422:5d1cc7366d04 423:9c9c442b5f2e
1 /* 1 /*
2 * Copyright (c) 2011 TMate Software Ltd 2 * Copyright (c) 2011-2012 TMate Software Ltd
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License. 6 * the Free Software Foundation; version 2 of the License.
7 * 7 *
91 91
92 private String print(HgChangeset cset) throws HgException { 92 private String print(HgChangeset cset) throws HgException {
93 StringBuilder sb = new StringBuilder(); 93 StringBuilder sb = new StringBuilder();
94 Formatter f = new Formatter(sb); 94 Formatter f = new Formatter(sb);
95 final Nodeid csetNodeid = cset.getNodeid(); 95 final Nodeid csetNodeid = cset.getNodeid();
96 f.format("changeset: %d:%s\n", cset.getRevision(), complete ? csetNodeid : csetNodeid.shortNotation()); 96 f.format("changeset: %d:%s\n", cset.getRevisionIndex(), complete ? csetNodeid : csetNodeid.shortNotation());
97 if (cset.getRevision() == tip || repo.getTags().isTagged(csetNodeid)) { 97 if (cset.getRevisionIndex() == tip || repo.getTags().isTagged(csetNodeid)) {
98 sb.append("tag: "); 98 sb.append("tag: ");
99 for (String t : repo.getTags().tags(csetNodeid)) { 99 for (String t : repo.getTags().tags(csetNodeid)) {
100 sb.append(t); 100 sb.append(t);
101 sb.append(' '); 101 sb.append(' ');
102 } 102 }
103 if (cset.getRevision() == tip) { 103 if (cset.getRevisionIndex() == tip) {
104 sb.append("tip"); 104 sb.append("tip");
105 } 105 }
106 sb.append('\n'); 106 sb.append('\n');
107 } 107 }
108 if (complete) { 108 if (complete) {