Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgRepositoryNotFoundException


      repository = null;
      dir = dir.getParentFile();
     
    } while(dir != null);
    if (repository == null) {
      throw new HgRepositoryNotFoundException(String.format("Can't locate .hg/ directory of Mercurial repository in %s nor in parent dirs", location)).setLocation(location.getPath());
    }
    try {
      String repoPath = repository.getParentFile().getAbsolutePath();
      HgRepository rv = new HgRepository(getSessionContext(), repoPath, repository);
      int requiresFlags = rv.getImplHelper().getRequiresFlags();
      if ((requiresFlags & RequiresFile.REVLOGV1) == 0) {
        throw new HgRepositoryNotFoundException(String.format("%s: repository version is not supported (Mercurial <0.9?)", repoPath)).setLocation(location.getPath());
      }
      return rv;
    } catch (HgRuntimeException ex) {
      HgRepositoryNotFoundException e = new HgRepositoryNotFoundException("Failed to initialize Hg4J library").setLocation(location.getPath());
      e.initCause(ex);
      throw e;
    }
  }
View Full Code Here


    }
  }
 
  public HgBundle loadBundle(File location) throws HgRepositoryNotFoundException {
    if (location == null || !location.canRead()) {
      throw new HgRepositoryNotFoundException(String.format("Can't read file %s", location)).setLocation(String.valueOf(location));
    }
    return new HgBundle(getSessionContext(), new DataAccessProvider(getSessionContext()), location).link();
  }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.core.HgRepositoryNotFoundException

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.