Package org.tmatesoft.hg.util

Examples of org.tmatesoft.hg.util.PathRewrite


  }

  // There seem to be no cases when access to HgDirstate is required from outside
  // (guess, working dir/revision walkers may hide dirstate access and no public visibility needed)
  /*package-local*/ final HgDirstate loadDirstate(Path.Source pathFactory) throws HgInvalidControlFileException {
    PathRewrite canonicalPath = null;
    if (!impl.isCaseSensitiveFileSystem()) {
      canonicalPath = new PathRewrite() {

        public CharSequence rewrite(CharSequence path) {
          return path.toString().toLowerCase();
        }
      };
View Full Code Here


    return new StoragePathHelper((requiresFlags & STORE) != 0, (requiresFlags & FNCACHE) != 0, (requiresFlags & DOTENCODE) != 0, cs);
  }

  public PathRewrite buildStoreFilesHelper() {
    if ((requiresFlags & STORE) != 0) {
      return new PathRewrite() {
        public CharSequence rewrite(CharSequence path) {
          return "store/" + path;
        }
      };
    } else {
View Full Code Here

    return repo.loadDirstate(new Path.SimpleSource());
  }
 
  // tests
  public HgDirstate createDirstate(boolean caseSensitiveFileSystem) throws HgInvalidControlFileException {
    PathRewrite canonicalPath = null;
    if (!caseSensitiveFileSystem) {
      canonicalPath = new PathRewrite() {

        public CharSequence rewrite(CharSequence path) {
          return path.toString().toLowerCase();
        }
      };
View Full Code Here

  @Test
  public void testNationalChars() {
    String s = "Привет.txt";
    //
    propertyOverrides.put(Internals.CFG_PROPERTY_FS_FILENAME_ENCODING, "cp1251");
    PathRewrite sph = repoInit.buildDataFilesHelper(sessionCtx);
    errorCollector.checkThat(sph.rewrite(s), CoreMatchers.<CharSequence>equalTo("store/data/~cf~f0~e8~e2~e5~f2.txt.i"));
    //
    propertyOverrides.put(Internals.CFG_PROPERTY_FS_FILENAME_ENCODING, "UTF8");
    sph = repoInit.buildDataFilesHelper(sessionCtx);
    errorCollector.checkThat(sph.rewrite(s), CoreMatchers.<CharSequence>equalTo("store/data/~d0~9f~d1~80~d0~b8~d0~b2~d0~b5~d1~82.txt.i"));
  }
View Full Code Here

  private final PathPool pathHelper;

  public StatusOutputParser() {
//    pattern = Pattern.compile("^([MAR?IC! ]) ([\\w \\.-/\\\\]+)$", Pattern.MULTILINE);
    pattern = Pattern.compile("^([MAR?IC! ]) (.+)$", Pattern.MULTILINE);
    pathHelper = new PathPool(new PathRewrite() {
     
      private final boolean winPathSeparator = File.separatorChar == '\\';

      public CharSequence rewrite(CharSequence s) {
        if (winPathSeparator) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.util.PathRewrite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.