List<String> parentIds = new ArrayList<String>(); for (Commit parent : parents) parentIds.add(parent.getSha()); params.put("parents", parentIds); //$NON-NLS-1$
created = new Commit(); info(MessageFormat.format("Creating commit with SHA-1: {0}", created.getSha())); } catch (IOException e) { throw new MojoExecutionException("Error creating commit: " object.setType(TYPE_COMMIT).setSha(created.getSha()); if (ref != null) { info(MessageFormat.format( "Updating reference {0} from {1} to {2}", branch, commit.getParents().get(0).getSha(), created.getSha())); if (!dryRun) service.editReference(repository, ref, force); info(MessageFormat.format( "Creating reference {0} starting at commit {1}", branch, created.getSha())); if (!dryRun) service.createReference(repository, ref);
created = new Commit(); info(MessageFormat.format("Creating commit with SHA-1: {0}", created.getSha())); } catch (IOException e) { throw new MojoExecutionException("Error creating commit: " object.setType(TYPE_COMMIT).setSha(created.getSha()); if (ref != null) { info(MessageFormat.format( "Updating reference {0} from {1} to {2}", branch, commit.getParents().get(0).getSha(), created.getSha())); if (!dryRun) service.editReference(repository, ref, force); info(MessageFormat.format( "Creating reference {0} starting at commit {1}", branch, created.getSha())); if (!dryRun) service.createReference(repository, ref);
/** * Saves a commit object into the data * * there are some critical elements of information that are no longer * saved in the v3 api vs v2. Namely the date of the commit and the * parents of the commit. * * @param commit * @return */ public Vertex saveCommit(final Commit commit) { log.trace("saveCommit: enter"); Vertex node = getOrCreateCommit(commit.getSha()); if (commit.getAuthor() != null) { Vertex author = saveUser(commit.getAuthor()); createEdgeIfNotExist(node, author, EdgeType.COMMITAUTHOR); setProperty(node, PropertyName.AUTHORED_DATE, commit.getAuthor().getDate()); } if (commit.getCommitter() != null) { Vertex committer = saveUser(commit.getCommitter()); createEdgeIfNotExist(node, committer, EdgeType.COMMITTER); setProperty(node, PropertyName.COMMITTED_DATE, commit.getCommitter().getDate()); } setProperty(node, PropertyName.COMMIT_ID, commit.getSha()); setProperty(node, PropertyName.MESSAGE, commit.getMessage()); setProperty(node, PropertyName.TREE, commit.getTree()); setProperty(node, PropertyName.URL, commit.getUrl()); log.trace("saveCommit: exit"); return node; }
Commit created = service.createCommit(repository, commit); TypedResource object = new TypedResource(); object.setType(TypedResource.TYPE_COMMIT).setSha(created.getSha()); if (ref != null) {