Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.BasicSessionContext


  }
 
  private void testTreeTraversal() throws Exception {
    File repoRoot = hgRepo.getWorkingDir();
    Path.Source pathSrc = new Path.SimpleSource(new PathRewrite.Composite(new RelativePathRewrite(repoRoot), hgRepo.getToRepoPathHelper()));
    FileWalker w =  new FileWalker(new BasicSessionContext(null), repoRoot, pathSrc);
    int count = 0;
    final long start = System.currentTimeMillis();
    while (w.hasNext()) {
      count++;
      w.next();
View Full Code Here


  Between two subsequent revisions (i.e. direct child in remote of a local root)
  cmd=between&pairs=71ddbf8603e8e09d54ac9c5fe4bb5ae824589f1d-8c8e3f372fa1fbfcf92b004b6f2ada2dbaf60028
   empty result
   */
  public static void main(String[] args) throws Exception {
    ConfigFile cfg =  new ConfigFile(new BasicSessionContext(null));
    cfg.addLocation(new File(System.getProperty("user.home"), ".hgrc"));
    String svnkitServer = cfg.getSection("paths").get("svnkit");
//    URL url = new URL(svnkitServer + "?cmd=branches&nodes=30bd389788464287cee22ccff54c330a4b715de5");
//    URL url = new URL(svnkitServer + "?cmd=between");
    URL url = new URL(svnkitServer + "?cmd=changegroup&roots=71ddbf8603e8e09d54ac9c5fe4bb5ae824589f1d");
View Full Code Here

    return globalCfg;
  }

  public SessionContext getSessionContext() {
    if (sessionContext == null) {
      sessionContext = new BasicSessionContext(null);
    }
    return sessionContext;
  }
View Full Code Here

  @Rule
  public ErrorCollectorExt errorCollector = new ErrorCollectorExt();

  @Test
  public void testConfigFile() throws Exception {
    ConfigFile configFile = new ConfigFile(new BasicSessionContext(null));
    configFile.addLocation(new File(Configuration.get().getTestDataDir(), "sample.rc"));
    // section1 has key1 unset, key2 overridden from included, key4 from second occurence
    HashMap<String, String> section1 = new HashMap<String, String>();
    section1.put("key2", "alternative value 2");
    section1.put("key3", "value 3");
View Full Code Here

  public void testPullFromNonPublishing() throws Exception {
    // copy, not clone as latter updates phase information
    File srcRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-pull-nopub-src");
    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-pull-nopub-dst");
    Map<String,?> props = Collections.singletonMap(Internals.CFG_PROPERTY_CREATE_PHASEROOTS, true);
    final HgLookup hgLookup = new HgLookup(new BasicSessionContext(props, null));
    HgRepository srcRepo = hgLookup.detect(srcRepoLoc);   
    // revisions 6 and 9 are secret, so
    // index of revisions 4 and 5 won't change, but that of 7 and 8 would
    Nodeid r7 = srcRepo.getChangelog().getRevision(7);
    Nodeid r8 = srcRepo.getChangelog().getRevision(8);
View Full Code Here

  @Test
  public void testWorkingCopyFileAccess() throws Exception {
    final File repoDir = RepoUtils.initEmptyTempRepo("testWorkingCopyFileAccess");
    final Map<String, ?> props = Collections.singletonMap(Internals.CFG_PROPERTY_REVLOG_STREAM_CACHE, false);
    repo = new HgLookup(new BasicSessionContext(props, null)).detect(repoDir);
    File f1 = new File(repoDir, "file1");
    final String c1 = "First", c2 = "Second", c3 = "Third";
    ByteArrayChannel ch;
    ExecHelper exec = new ExecHelper(new OutputParser.Stub(), repoDir);
    // commit cset 0
View Full Code Here

  @Rule
  public ErrorCollectorExt errorCollector = new ErrorCollectorExt();
 
  @Test
  public void testCopyOnWriteTransaction() throws Exception {
    final BasicSessionContext ctx = new BasicSessionContext(null);
    Transaction.Factory f = new COWTransaction.Factory();
    File dir = RepoUtils.createEmptyDir("test-transaction-cow");
    File f1 = new File(dir, "f1");
    File f2 = new File(dir, "f2");
    File f3 = new File(dir, "f3");
View Full Code Here

public class HgRepoFacade implements SessionContext.Source {
  private HgRepository repo;
  private final SessionContext context;

  public HgRepoFacade() {
    this(new BasicSessionContext(null));
  }
View Full Code Here

  }

  public static void main(String[] args) throws Exception {
    Map<String, Object> po = new HashMap<String, Object>();
    po.put(DataAccessProvider.CFG_PROPERTY_MAPIO_LIMIT, 0);
    final HgLookup hgLookup = new HgLookup(new BasicSessionContext(po , null));
    final File rebaseFromRepoLoc = RepoUtils.cloneRepoToTempLocation(new File("/temp/hg/junit-test-repos/test-annotate"), "repo-lock-remote", false, true);
    final File rebaseToRepoLoc = RepoUtils.cloneRepoToTempLocation(rebaseFromRepoLoc, "repo-lock-local", false, true);
    final File remoteChanges = new File(rebaseFromRepoLoc, "file1");
    //
    // create commit in the "local" repository that will be rebased on top of changes
View Full Code Here

    test.errorCollector.verify();
  }
 
  public TestStorePath() {
    propertyOverrides.put("hg.consolelog.debug", true);
    sessionCtx = new BasicSessionContext(propertyOverrides, null);
    repoInit = new RepoInitializer().setRequires(REVLOGV1 | STORE | FNCACHE | DOTENCODE);
    storePathHelper = repoInit.buildDataFilesHelper(sessionCtx);
  }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.BasicSessionContext

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.