Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.PersonIdent


    final long delta = TimeUnit.MILLISECONDS.convert(5 * 60,
        TimeUnit.SECONDS);
    final long now = author.getWhen().getTime() + delta;
    final int tz = mockSystemReader.getTimezone(now);

    author = new PersonIdent(author, now, tz);
    committer = new PersonIdent(committer, now, tz);
  }
View Full Code Here


      throws IOException {
    final ObjectId oldId = update.getOldObjectId();
    final ObjectId newId = update.getNewObjectId();
    final Ref ref = update.getRef();

    PersonIdent ident = update.getRefLogIdent();
    if (ident == null)
      ident = new PersonIdent(parent);
    else
      ident = new PersonIdent(ident);

    final StringBuilder r = new StringBuilder();
    r.append(ObjectId.toString(oldId));
    r.append(' ');
    r.append(ObjectId.toString(newId));
    r.append(' ');
    r.append(ident.toExternalString());
    r.append('\t');
    r.append(msg);
    r.append('\n');
    final byte[] rec = encode(r.toString());
View Full Code Here

              host = peer.getHostAddress();
            final ReceivePack rp = new ReceivePack(db);
            final InputStream in = dc.getInputStream();
            final String name = "anonymous";
            final String email = name + "@" + host;
            rp.setRefLogIdent(new PersonIdent(name, email));
            rp.setTimeout(Daemon.this.getTimeout());
            rp.receive(in, dc.getOutputStream(), null);
          }
        } };
  }
View Full Code Here

    long timeof(RevObject o) {
      if (o instanceof RevCommit)
        return ((RevCommit) o).getCommitTime();
      if (o instanceof RevTag) {
        RevTag tag = (RevTag) o;
        PersonIdent who = tag.getTaggerIdent();
        return who != null ? who.getWhen().getTime() : 0;
      }
      return 0;
    }
View Full Code Here

    add(new Label("userUsername", user.username));
    LinkPanel email = new LinkPanel("userEmail", null, user.emailAddress, "mailto:#");
    email.setRenderBodyOnly(true);
    add(email.setVisible(app().settings().getBoolean(Keys.web.showEmailAddresses, true) && !StringUtils.isEmpty(user.emailAddress)));

    PersonIdent person = new PersonIdent(user.getDisplayName(), user.emailAddress == null ? user.getDisplayName() : user.emailAddress);
    add(new GravatarImage("gravatar", person, 210));

    UserModel sessionUser = GitBlitWebSession.get().getUser();
    if (sessionUser != null && user.canCreate() && sessionUser.equals(user)) {
      // user can create personal repositories
View Full Code Here

  public static boolean createOrphanBranch(Repository repository, String branchName,
      PersonIdent author) {
    boolean success = false;
    String message = "Created branch " + branchName;
    if (author == null) {
      author = new PersonIdent("Gitblit", "gitblit@localhost");
    }
    try {
      ObjectInserter odi = repository.newObjectInserter();
      try {
        // Create a blob object to insert into a tree
View Full Code Here

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(final Item<RevCommit> item) {
          RevCommit commit = item.getModelObject();
          PersonIdent author = commit.getAuthorIdent();
          item.add(new GravatarImage("authorAvatar", author.getName(), author.getEmailAddress(), null, 16, false));
          item.add(new Label("author", commit.getAuthorIdent().getName()));
          item.add(new LinkPanel("commitId", null, getShortObjectId(commit.getName()),
              CommitPage.class, WicketUtils.newObjectParameter(repositoryName, commit.getName()), true));
          item.add(new LinkPanel("diff", "link", getString("gb.diff"), CommitDiffPage.class,
              WicketUtils.newObjectParameter(repositoryName, commit.getName()), true));
View Full Code Here

    if (oldRef != null) {
      // rename old ref to refs/meta/gitblit/tickets
      RefRename cmd;
      try {
        cmd = db.renameRef(oldRef.getName(), BRANCH);
        cmd.setRefLogIdent(new PersonIdent("Gitblit", "gitblit@localhost"));
        cmd.setRefLogMessage("renamed " + oldRef.getName() + " => " + BRANCH);
        Result res = cmd.rename();
        switch (res) {
        case RENAMED:
          log.info(db.getDirectory() + " " + cmd.getRefLogMessage());
View Full Code Here

    try {
      // Create the in-memory index of the new/updated ticket
      ObjectId indexTreeId = index.writeTree(odi);

      // Create a commit object
      PersonIdent ident = new PersonIdent(author, "gitblit@localhost");
      CommitBuilder commit = new CommitBuilder();
      commit.setAuthor(ident);
      commit.setCommitter(ident);
      commit.setEncoding(Constants.ENCODING);
      commit.setMessage(message);
View Full Code Here

   * @param ticket
   * @param patchset
   * @return true, if successful
   */
  public MergeStatus merge(TicketModel ticket) {
    PersonIdent committer = new PersonIdent(user.getDisplayName(), StringUtils.isEmpty(user.emailAddress) ? (user.username + "@gitblit") : user.emailAddress);
    Patchset patchset = ticket.getCurrentPatchset();
    String message = MessageFormat.format("Merged #{0,number,0} \"{1}\"", ticket.number, ticket.title);
    Ref oldRef = null;
    try {
      oldRef = getRepository().getRef(ticket.mergeTo);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.PersonIdent

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.