Package com.google.devtools.moe.client.codebase

Examples of com.google.devtools.moe.client.codebase.LocalClone


   */
  protected abstract LocalClone cloneAtLocalRoot(String localroot);

  @Override
  public Codebase create(Map<String, String> options) throws CodebaseCreationError {
    LocalClone headClone;
    File archiveLocation;
    String localRoot = options.get("localroot");
    if (Strings.isNullOrEmpty(localRoot)) {
      Revision rev = revisionHistory.findHighestRevision(options.get("revision"));
      headClone = headCloneSupplier.get();
      archiveLocation = headClone.archiveAtRevision(rev.revId);
    } else {
      // TODO(user): Archive only (don't clone) if localroot is set.
      headClone = cloneAtLocalRoot(localRoot);
      archiveLocation = headClone.archiveAtRevision(null);
    }

    // Filter files in the codebase by RepositoryConfig#ignoreFileRes.
    Predicate<CharSequence> nonIgnoredFilePred =
        Utils.nonMatchingPredicateFromRes(headClone.getConfig().getIgnoreFileRes());
    Utils.filterFiles(archiveLocation, nonIgnoredFilePred);

    return new Codebase(
        archiveLocation,
        projectSpace,
        new RepositoryExpression(new Term(headClone.getRepositoryName(), options)));
  }
View Full Code Here


  public void testGetLocation() {
    final File mockRepoPath = new File("/mockrepo");

    IMocksControl control = EasyMock.createControl();
    LocalClone mockRevClone = control.createMock(LocalClone.class);
    expect(mockRevClone.getLocalTempDir()).andReturn(mockRepoPath);

    control.replay();

    DvcsDraftRevision dr = new DvcsDraftRevision(mockRevClone);
    assertEquals(mockRepoPath.getAbsolutePath(), dr.getLocation());
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.codebase.LocalClone

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.