Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgInternals.java @ 295:981f9f50bb6c
Issue 11: Error log facility. SessionContext to share common facilities
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 16 Sep 2011 05:35:32 +0200 |
parents | 7232b94f2ae3 |
children | 02f2963c70fa |
comparison
equal
deleted
inserted
replaced
294:32890bab7209 | 295:981f9f50bb6c |
---|---|
23 import java.io.IOException; | 23 import java.io.IOException; |
24 import java.io.Reader; | 24 import java.io.Reader; |
25 import java.net.InetAddress; | 25 import java.net.InetAddress; |
26 import java.net.UnknownHostException; | 26 import java.net.UnknownHostException; |
27 | 27 |
28 import org.tmatesoft.hg.core.SessionContext; | |
28 import org.tmatesoft.hg.internal.ConfigFile; | 29 import org.tmatesoft.hg.internal.ConfigFile; |
29 import org.tmatesoft.hg.internal.Experimental; | 30 import org.tmatesoft.hg.internal.Experimental; |
30 import org.tmatesoft.hg.internal.RelativePathRewrite; | 31 import org.tmatesoft.hg.internal.RelativePathRewrite; |
31 import org.tmatesoft.hg.util.FileIterator; | 32 import org.tmatesoft.hg.util.FileIterator; |
32 import org.tmatesoft.hg.util.FileWalker; | 33 import org.tmatesoft.hg.util.FileWalker; |
112 // Impl note: simple source is enough as files in the working dir are all unique | 113 // Impl note: simple source is enough as files in the working dir are all unique |
113 // even if they might get reused (i.e. after FileIterator#reset() and walking once again), | 114 // even if they might get reused (i.e. after FileIterator#reset() and walking once again), |
114 // path caching is better to be done in the code which knows that path are being reused | 115 // path caching is better to be done in the code which knows that path are being reused |
115 return new FileWalker(repoRoot, pathSrc, workindDirScope); | 116 return new FileWalker(repoRoot, pathSrc, workindDirScope); |
116 } | 117 } |
118 | |
119 // expose othewise package-local information primarily to use in our own o.t.hg.core package | |
120 public static SessionContext getContext(HgRepository repo) { | |
121 return repo.getContext(); | |
122 } | |
117 | 123 |
118 | 124 |
119 // Convenient check of local revision number for validity (not all negative values are wrong as long as we use negative constants) | 125 // Convenient check of local revision number for validity (not all negative values are wrong as long as we use negative constants) |
120 public static boolean wrongLocalRevision(int rev) { | 126 public static boolean wrongLocalRevision(int rev) { |
121 return rev < 0 && rev != TIP && rev != WORKING_COPY && rev != BAD_REVISION; | 127 return rev < 0 && rev != TIP && rev != WORKING_COPY && rev != BAD_REVISION; |