Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgInternals.java @ 425:48f993aa2f41
FIXMEs: exceptions, javadoc
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 28 Mar 2012 18:39:29 +0200 |
parents | 9c9c442b5f2e |
children | 12f668401613 |
comparison
equal
deleted
inserted
replaced
424:6437d261048a | 425:48f993aa2f41 |
---|---|
137 File repoRoot = repo.getWorkingDir(); | 137 File repoRoot = repo.getWorkingDir(); |
138 Path.Source pathSrc = new Path.SimpleSource(new PathRewrite.Composite(new RelativePathRewrite(repoRoot), repo.getToRepoPathHelper())); | 138 Path.Source pathSrc = new Path.SimpleSource(new PathRewrite.Composite(new RelativePathRewrite(repoRoot), repo.getToRepoPathHelper())); |
139 // Impl note: simple source is enough as files in the working dir are all unique | 139 // Impl note: simple source is enough as files in the working dir are all unique |
140 // even if they might get reused (i.e. after FileIterator#reset() and walking once again), | 140 // even if they might get reused (i.e. after FileIterator#reset() and walking once again), |
141 // path caching is better to be done in the code which knows that path are being reused | 141 // path caching is better to be done in the code which knows that path are being reused |
142 return new FileWalker(repoRoot, pathSrc, workindDirScope); | 142 return new FileWalker(repo.getContext(), repoRoot, pathSrc, workindDirScope); |
143 } | 143 } |
144 | 144 |
145 // expose otherwise package-local information primarily to use in our own o.t.hg.core package | 145 // expose otherwise package-local information primarily to use in our own o.t.hg.core package |
146 public static SessionContext getContext(HgRepository repo) { | 146 public static SessionContext getContext(HgRepository repo) { |
147 return repo.getContext(); | 147 return repo.getContext(); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 // Convenient check of revision index for validity (not all negative values are wrong as long as we use negative constants) | 151 // Convenient check of revision index for validity (not all negative values are wrong as long as we use negative constants) |
152 public static boolean wrongRevisionIndex(int rev) { // FIXME guess, usages shall throw HgInvalidRevision. \ | 152 public static boolean wrongRevisionIndex(int rev) { |
153 // TODO Another method to check,throw and expand TIP at once | 153 // TODO Another method to check,throw and expand TIP at once (check[Revision|Revlog]Index() |
154 return rev < 0 && rev != TIP && rev != WORKING_COPY && rev != BAD_REVISION && rev != NO_REVISION; | 154 return rev < 0 && rev != TIP && rev != WORKING_COPY && rev != BAD_REVISION && rev != NO_REVISION; |
155 } | 155 } |
156 | 156 |
157 // throws HgInvalidRevisionException or IllegalArgumentException if [start..end] range is not a subrange of [0..lastRevision] | 157 // throws HgInvalidRevisionException or IllegalArgumentException if [start..end] range is not a subrange of [0..lastRevision] |
158 public static void checkRevlogRange(int start, int end, int lastRevision) throws HgInvalidRevisionException { | 158 public static void checkRevlogRange(int start, int end, int lastRevision) throws HgInvalidRevisionException { |