当前位置: 首页>>代码示例>>Java>>正文


Java DfsRepositoryDescription类代码示例

本文整理汇总了Java中org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription的典型用法代码示例。如果您正苦于以下问题:Java DfsRepositoryDescription类的具体用法?Java DfsRepositoryDescription怎么用?Java DfsRepositoryDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DfsRepositoryDescription类属于org.eclipse.jgit.internal.storage.dfs包,在下文中一共展示了DfsRepositoryDescription类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: open

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
public Repository open(DaemonClient client, String name)
        throws RepositoryNotFoundException,
        ServiceNotAuthorizedException, ServiceNotEnabledException,
        ServiceMayNotContinueException {
    CassandraRepository repo = repositories.get(name);
    if (repo == null) {
        try {
            repo = new CassandraRepository(
                    new DfsRepositoryDescription(sanitiseName(name)),
                    storeconn);
        } catch (Exception e) {
            throw new ServiceMayNotContinueException(e);
        }
        repositories.put(name, repo);
    }
    return repo;
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:19,代码来源:CassandraRepositoryResolver.java

示例2: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  TestKey key1 = validKeyWithoutExpiration();
  TestKey key3 = expiredKey();
  repo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
  store = new PublicKeyStore(repo);
  store.add(key1.getPublicKeyRing());
  store.add(key3.getPublicKeyRing());

  PersonIdent ident = new PersonIdent("A U Thor", "[email protected]");
  CommitBuilder cb = new CommitBuilder();
  cb.setAuthor(ident);
  cb.setCommitter(ident);
  assertEquals(RefUpdate.Result.NEW, store.save(cb));

  signedPushConfig = new SignedPushConfig();
  signedPushConfig.setCertNonceSeed("sekret");
  signedPushConfig.setCertNonceSlopLimit(60 * 24);
  checker = newChecker(true);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:PushCertificateCheckerTest.java

示例3: newBatchRefUpdate

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@SafeVarargs
private static BatchRefUpdate newBatchRefUpdate(Consumer<ReceiveCommand>... resultSetters) {
  try (Repository repo = new InMemoryRepository(new DfsRepositoryDescription("repo"))) {
    BatchRefUpdate bru = repo.getRefDatabase().newBatchUpdate();
    for (int i = 0; i < resultSetters.length; i++) {
      ReceiveCommand cmd =
          new ReceiveCommand(
              ObjectId.fromString(String.format("%039x1", i)),
              ObjectId.fromString(String.format("%039x2", i)),
              "refs/heads/branch" + i);
      bru.addCommand(cmd);
      resultSetters[i].accept(cmd);
    }
    return bru;
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:17,代码来源:RefUpdateUtilTest.java

示例4: openUncached

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
Repository openUncached(GitRepository repo, boolean mustExist) throws IOException {
  String objectPath = repo.getObjectPath();

  // ByteString suffix = ZERO.concat(ByteString.copyFromUtf8(absolutePath)).concat(ZERO);
  // KeyValuePath refsPath = refsBase.child(suffix);

  DfsRepositoryDescription description = new DfsRepositoryDescription(objectPath);
  ObjectStorePath repoPath = new ObjectStorePath(objectStore, objectPath);
  CloudDfsRepository dfs = new CloudDfsRepository(repo.getData(), description, repoPath, dataStore, tempDir);

  try {
    if (!dfs.exists()) {
      if (mustExist) {
        throw new RepositoryNotFoundException(repo.getData().getName());
      }
      dfs.create(true);
      dfs.updateRef(Constants.HEAD).link("refs/heads/master");
    }
  } catch (IOException e) {
    throw new IllegalStateException("Error creating repository", e);
  }

  dfs.getConfig().setBoolean("http", null, "receivepack", true);

  return dfs;
}
 
开发者ID:justinsb,项目名称:cloudata,代码行数:27,代码来源:CloudGitRepositoryStore.java

示例5: RepositoryS3Test

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public RepositoryS3Test() {
    try {
        this.repository = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription()));
        this.uut = new RepositoryS3(BUCKET, repository.getRepository(), amazonS3, new Branch(Constants.MASTER));
    }
    catch (Exception e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:berlam,项目名称:github-bucket,代码行数:10,代码来源:RepositoryS3Test.java

示例6: CassandraRepository

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
/**
 * Creating a new repository object may result in creating a new repository
 * in the storage layer, or if the repository identified by "repoDesc" already
 * exists, it will be used instead.
 *
 * @param repoDesc  description of the repository that this object will
 *                  provide access to.
 */
@SuppressWarnings("rawtypes")
public CassandraRepository(DfsRepositoryDescription repoDesc, StoreConnection conn)
        throws IOException {
    super(new DfsRepositoryBuilder<DfsRepositoryBuilder, CassandraRepository>() {
        @Override
        public CassandraRepository build() throws IOException {
            throw new UnsupportedOperationException();
        }
    }.setRepositoryDescription(repoDesc));

    objdb = new CassandraObjDatabase(this, conn);
    refdb = new CassandraRefDatabase(this, conn);
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:22,代码来源:CassandraRepository.java

示例7: ObjStore

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param keyspace the Cassandra keyspace
 * @param session  a Cassandra session instance
 * @throws NullPointerException if either of the parameters are null
 * @throws IOException          if an exception occurs when communicating to the
 *                              database
 */
public ObjStore(String keyspace, Session session,
                DfsRepositoryDescription repoDesc) throws IOException {
    if (keyspace == null || session == null) {
        throw new NullPointerException();
    }
    this.keyspace = keyspace;
    this.session = session;
    this.repoDesc = repoDesc;
    createSchemaIfNotExist();
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:20,代码来源:ObjStore.java

示例8: cloneProject

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public static TestRepository<InMemoryRepository> cloneProject(Project.NameKey project, String uri)
    throws Exception {
  DfsRepositoryDescription desc = new DfsRepositoryDescription("clone of " + project.get());

  FS fs = FS.detect();

  // Avoid leaking user state into our tests.
  fs.setUserHome(null);

  InMemoryRepository dest =
      new InMemoryRepository.Builder()
          .setRepositoryDescription(desc)
          // SshTransport depends on a real FS to read ~/.ssh/config, but
          // InMemoryRepository by default uses a null FS.
          // TODO(dborowitz): Remove when we no longer depend on SSH.
          .setFS(fs)
          .build();
  Config cfg = dest.getConfig();
  cfg.setString("remote", "origin", "url", uri);
  cfg.setString("remote", "origin", "fetch", "+refs/heads/*:refs/remotes/origin/*");
  TestRepository<InMemoryRepository> testRepo = newTestRepository(dest);
  FetchResult result = testRepo.git().fetch().setRemote("origin").call();
  String originMaster = "refs/remotes/origin/master";
  if (result.getTrackingRefUpdate(originMaster) != null) {
    testRepo.reset(originMaster);
  }
  return testRepo;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:29,代码来源:GitUtil.java

示例9: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  repo = new TestRepository<DfsRepository>(
      new InMemoryRepository(new DfsRepositoryDescription("test")));
  parser = new RevisionParser(
      repo.getRepository(),
      new TestGitilesAccess(repo.getRepository()).forRequest(null),
      new VisibilityCache(false, CacheBuilder.newBuilder().maximumSize(0)));
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:10,代码来源:RevisionParserTest.java

示例10: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  repo = new TestRepository<DfsRepository>(
      new InMemoryRepository(new DfsRepositoryDescription("test")));
  servlet = new RepositoryIndexServlet(
      new DefaultRenderer(),
      new TestGitilesAccess(repo.getRepository()),
      new TimeCache());
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:10,代码来源:RepositoryIndexServletTest.java

示例11: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  repo = new TestRepository<DfsRepository>(
      new InMemoryRepository(new DfsRepositoryDescription("test")));
  walk = new RevWalk(repo.getRepository());
  cache = new TimeCache();
  start = repo.getClock().getTime() / 1000;
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:9,代码来源:TimeCacheTest.java

示例12: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  DfsRepository r = new InMemoryRepository(new DfsRepositoryDescription("test"));
  repo = new TestRepository<DfsRepository>(r);

  RevCommit commit = repo.branch("refs/heads/master").commit().create();
  repo.update("refs/heads/branch", commit);
  repo.update("refs/tags/ctag", commit);
  RevTag tag = repo.tag("atag", commit);
  repo.update("refs/tags/atag", tag);
  r.updateRef("HEAD").link("refs/heads/master");

  servlet = TestGitilesServlet.create(repo);
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:15,代码来源:RefServletTest.java

示例13: CloudDfsRepository

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public CloudDfsRepository(RepositoryData data, DfsRepositoryDescription repoDesc, ObjectStorePath repoPath,
    DataStore dataStore, File tempDir) {
  super(new DfsRepositoryBuilder<DfsRepositoryBuilder, CloudDfsRepository>() {
    @Override
    public CloudDfsRepository build() throws IOException {
      throw new UnsupportedOperationException();
    }
  }.setRepositoryDescription(repoDesc));
  this.data = data;

  this.objdb = new CloudObjDatabase(this, repoPath, tempDir);
  this.refdb = new CloudRefDatabase(this, dataStore);
}
 
开发者ID:justinsb,项目名称:cloudata,代码行数:14,代码来源:CloudDfsRepository.java

示例14: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    desc = new DfsPackDescription(new DfsRepositoryDescription(), DESC_NAME);
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:5,代码来源:DescMapperTest.java

示例15: inMemoryRepo

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Nonnull
public static GfsConfiguration inMemoryRepo() {
  return repo(new InMemoryRepository(new DfsRepositoryDescription()));
}
 
开发者ID:beijunyi,项目名称:ParallelGit,代码行数:5,代码来源:GfsConfiguration.java


注:本文中的org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。