Mercurial > hg4j
comparison src/org/tmatesoft/hg/core/HgLogCommand.java @ 148:1a7a9a20e1f9
Exceptions, javadoc. Initial cancel and progress support
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 23 Feb 2011 22:36:28 +0100 |
| parents | 37a34044e6bd |
| children | ba2bf656f00f |
comparison
equal
deleted
inserted
replaced
| 147:a05145db4d0c | 148:1a7a9a20e1f9 |
|---|---|
| 64 public HgLogCommand(HgRepository hgRepo) { | 64 public HgLogCommand(HgRepository hgRepo) { |
| 65 repo = hgRepo; | 65 repo = hgRepo; |
| 66 } | 66 } |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Limit search to specified user. Multiple user names may be specified. | 69 * Limit search to specified user. Multiple user names may be specified. Once set, user names can't be |
| 70 * cleared, use new command instance in such cases. | |
| 70 * @param user - full or partial name of the user, case-insensitive, non-null. | 71 * @param user - full or partial name of the user, case-insensitive, non-null. |
| 71 * @return <code>this</code> instance for convenience | 72 * @return <code>this</code> instance for convenience |
| 73 * @throws IllegalArgumentException when argument is null | |
| 72 */ | 74 */ |
| 73 public HgLogCommand user(String user) { | 75 public HgLogCommand user(String user) { |
| 74 if (user == null) { | 76 if (user == null) { |
| 75 throw new IllegalArgumentException(); | 77 throw new IllegalArgumentException(); |
| 76 } | 78 } |
| 81 return this; | 83 return this; |
| 82 } | 84 } |
| 83 | 85 |
| 84 /** | 86 /** |
| 85 * Limit search to specified branch. Multiple branch specification possible (changeset from any of these | 87 * Limit search to specified branch. Multiple branch specification possible (changeset from any of these |
| 86 * would be included in result). If unspecified, all branches are considered. | 88 * would be included in result). If unspecified, all branches are considered. There's no way to clean branch selection |
| 89 * once set, create fresh new command instead. | |
| 87 * @param branch - branch name, case-sensitive, non-null. | 90 * @param branch - branch name, case-sensitive, non-null. |
| 88 * @return <code>this</code> instance for convenience | 91 * @return <code>this</code> instance for convenience |
| 92 * @throws IllegalArgumentException when branch argument is null | |
| 89 */ | 93 */ |
| 90 public HgLogCommand branch(String branch) { | 94 public HgLogCommand branch(String branch) { |
| 91 if (branch == null) { | 95 if (branch == null) { |
| 92 throw new IllegalArgumentException(); | 96 throw new IllegalArgumentException(); |
| 93 } | 97 } |
| 118 } | 122 } |
| 119 | 123 |
| 120 /** | 124 /** |
| 121 * Limit to specified subset of Changelog, [min(rev1,rev2), max(rev1,rev2)], inclusive. | 125 * Limit to specified subset of Changelog, [min(rev1,rev2), max(rev1,rev2)], inclusive. |
| 122 * Revision may be specified with {@link HgRepository#TIP} | 126 * Revision may be specified with {@link HgRepository#TIP} |
| 123 * @param rev1 | 127 * @param rev1 - local revision number |
| 124 * @param rev2 | 128 * @param rev2 - local revision number |
| 125 * @return <code>this</code> instance for convenience | 129 * @return <code>this</code> instance for convenience |
| 126 */ | 130 */ |
| 127 public HgLogCommand range(int rev1, int rev2) { | 131 public HgLogCommand range(int rev1, int rev2) { |
| 128 if (rev1 != TIP && rev2 != TIP) { | 132 if (rev1 != TIP && rev2 != TIP) { |
| 129 startRev = rev2 < rev1 ? rev2 : rev1; | 133 startRev = rev2 < rev1 ? rev2 : rev1; |
| 289 private final Nodeid revision; | 293 private final Nodeid revision; |
| 290 private final Path path; | 294 private final Path path; |
| 291 | 295 |
| 292 /*package-local*/FileRevision(HgRepository hgRepo, Nodeid rev, Path p) { | 296 /*package-local*/FileRevision(HgRepository hgRepo, Nodeid rev, Path p) { |
| 293 if (hgRepo == null || rev == null || p == null) { | 297 if (hgRepo == null || rev == null || p == null) { |
| 294 throw new IllegalArgumentException(); | 298 // since it's package local, it is our code to blame for non validated arguments |
| 299 throw new HgBadStateException(); | |
| 295 } | 300 } |
| 296 repo = hgRepo; | 301 repo = hgRepo; |
| 297 revision = rev; | 302 revision = rev; |
| 298 path = p; | 303 path = p; |
| 299 } | 304 } |
