Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/RepositoryComparator.java @ 203:66fd2c73c56f
Basic test for HgOutgoingCommand. Handle cases with no outgoing changes in RepositoryComparator
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 26 Apr 2011 15:52:33 +0200 |
parents | 706bcc7cfee4 |
children | 63c9fed4369e |
comparison
equal
deleted
inserted
replaced
202:706bcc7cfee4 | 203:66fd2c73c56f |
---|---|
109 } | 109 } |
110 int lr = changelog.getLocalRevision(n); | 110 int lr = changelog.getLocalRevision(n); |
111 if (lr < earliestRevision) { | 111 if (lr < earliestRevision) { |
112 earliestRevision = lr; | 112 earliestRevision = lr; |
113 } | 113 } |
114 } | |
115 if (earliestRevision == Integer.MAX_VALUE) { | |
116 // either there are no common nodes (known locally and at remote) | |
117 // or no local children found (local is up to date). In former case, perhaps I shall bit return silently, | |
118 // but check for possible wrong repo comparison (hs says 'repository is unrelated' if I try to | |
119 // check in/out for a repo that has no common nodes. | |
120 return; | |
114 } | 121 } |
115 if (earliestRevision < 0 || earliestRevision >= changelog.getLastRevision()) { | 122 if (earliestRevision < 0 || earliestRevision >= changelog.getLastRevision()) { |
116 throw new HgBadStateException(String.format("Invalid index of common known revision: %d in total of %d", earliestRevision, 1+changelog.getLastRevision())); | 123 throw new HgBadStateException(String.format("Invalid index of common known revision: %d in total of %d", earliestRevision, 1+changelog.getLastRevision())); |
117 } | 124 } |
118 changelog.range(earliestRevision+1, changelog.getLastRevision(), inspector); | 125 changelog.range(earliestRevision+1, changelog.getLastRevision(), inspector); |