comparison src/org/tmatesoft/hg/repo/HgInternals.java @ 673:545b1d4cc11d

Refactor HgBundle.GroupElement (clear experimental mark), resolve few technical debt issues
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 12 Jul 2013 20:14:24 +0200
parents e1b29756f901
children
comparison
equal deleted inserted replaced
672:d2552e6a5af6 673:545b1d4cc11d
26 import java.net.UnknownHostException; 26 import java.net.UnknownHostException;
27 27
28 import org.tmatesoft.hg.core.Nodeid; 28 import org.tmatesoft.hg.core.Nodeid;
29 import org.tmatesoft.hg.internal.Experimental; 29 import org.tmatesoft.hg.internal.Experimental;
30 import org.tmatesoft.hg.internal.Internals; 30 import org.tmatesoft.hg.internal.Internals;
31 import org.tmatesoft.hg.internal.Patch;
31 import org.tmatesoft.hg.internal.RelativePathRewrite; 32 import org.tmatesoft.hg.internal.RelativePathRewrite;
32 import org.tmatesoft.hg.internal.WinToNixPathRewrite; 33 import org.tmatesoft.hg.internal.WinToNixPathRewrite;
34 import org.tmatesoft.hg.repo.HgBundle.GroupElement;
33 import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind; 35 import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind;
34 import org.tmatesoft.hg.util.FileIterator; 36 import org.tmatesoft.hg.util.FileIterator;
35 import org.tmatesoft.hg.util.FileWalker; 37 import org.tmatesoft.hg.util.FileWalker;
36 import org.tmatesoft.hg.util.Path; 38 import org.tmatesoft.hg.util.Path;
37 import org.tmatesoft.hg.util.PathRewrite; 39 import org.tmatesoft.hg.util.PathRewrite;
112 BufferedReader br = source instanceof BufferedReader ? (BufferedReader) source : new BufferedReader(source); 114 BufferedReader br = source instanceof BufferedReader ? (BufferedReader) source : new BufferedReader(source);
113 hgIgnore.read(br); 115 hgIgnore.read(br);
114 br.close(); 116 br.close();
115 return hgIgnore; 117 return hgIgnore;
116 } 118 }
119
120 // XXX just to access package local method. Perhaps, GroupElement shall be redesigned
121 // to allow classes from .internal to access its details?
122 // or Patch may become public?
123 public static Patch patchFromData(GroupElement ge) throws IOException {
124 return ge.patch();
125 }
117 126
118 // in fact, need a setter for this anyway, shall move to internal.Internals perhaps? 127 public static File getBundleFile(HgBundle bundle) {
128 return bundle.bundleFile;
129 }
130
131 // TODO in fact, need a setter for this anyway, shall move to internal.Internals perhaps?
119 public String getNextCommitUsername() { 132 public String getNextCommitUsername() {
120 String hgUser = System.getenv("HGUSER"); 133 String hgUser = System.getenv("HGUSER");
121 if (hgUser != null && hgUser.trim().length() > 0) { 134 if (hgUser != null && hgUser.trim().length() > 0) {
122 return hgUser.trim(); 135 return hgUser.trim();
123 } 136 }