當前位置: 首頁>>代碼示例>>Java>>正文


Java VcsUser類代碼示例

本文整理匯總了Java中com.intellij.vcs.log.VcsUser的典型用法代碼示例。如果您正苦於以下問題:Java VcsUser類的具體用法?Java VcsUser怎麽用?Java VcsUser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VcsUser類屬於com.intellij.vcs.log包,在下文中一共展示了VcsUser類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: VcsLogUserFilterImpl

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
public VcsLogUserFilterImpl(@NotNull Collection<String> users,
                            @NotNull Map<VirtualFile, VcsUser> meData,
                            @NotNull Set<VcsUser> allUsers) {
  myUsers = users;
  myData = meData;
  myAllUserNames = ContainerUtil.mapNotNull(allUsers, new Function<VcsUser, String>() {
    @Override
    public String fun(VcsUser vcsUser) {
      String name = vcsUser.getName();
      if (!name.isEmpty()) {
        return name.toLowerCase();
      }
      String email = vcsUser.getEmail();
      int at = email.indexOf('@');
      if (at > 0) {
        return email.substring(0, at).toLowerCase();
      }

      return null;
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:VcsLogUserFilterImpl.java

示例2: getUserNames

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@NotNull
@Override
public Collection<String> getUserNames(@NotNull final VirtualFile root) {
  Set<String> result = ContainerUtil.newHashSet();
  for (String user : myUsers) {
    if (ME.equals(user)) {
      VcsUser vcsUser = myData.get(root);
      if (vcsUser != null) {
        result.addAll(getVariants(vcsUser.getName()));
      }
    }
    else {
      result.addAll(getVariants(user));
    }
  }
  return result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:VcsLogUserFilterImpl.java

示例3: getOrReadUser

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@Nullable
public VcsUser getOrReadUser(@NotNull VirtualFile root) {
  VcsUser user = myUserMap.get(root);
  if (user == null) {
    try {
      user = readCurrentUser(myProject, root);
      if (user != null) {
        myUserMap.put(root, user);
      }
    }
    catch (VcsException e) {
      LOG.warn("Could not retrieve user name in " + root, e);
    }
  }
  return user;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:GitUserRegistry.java

示例4: hasProblem

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
public static boolean hasProblem(@NotNull Project project,
                                 @NotNull VirtualFile root,
                                 @NotNull String baseRef,
                                 @NotNull String currentRef) {
  final Ref<Boolean> mergeFound = Ref.create(Boolean.FALSE);
  Consumer<TimedVcsCommit> detectingConsumer = new Consumer<TimedVcsCommit>() {
    @Override
    public void consume(TimedVcsCommit commit) {
      mergeFound.set(true);
    }
  };

  String range = baseRef + ".." + currentRef;
  try {
    GitHistoryUtils.readCommits(project, root, Arrays.asList(range, "--merges"),
                                EmptyConsumer.<VcsUser>getInstance(), EmptyConsumer.<VcsRef>getInstance(), detectingConsumer);
  }
  catch (VcsException e) {
    LOG.warn("Couldn't get git log --merges " + range, e);
  }
  return mergeFound.get();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:GitRebaseOverMergeProblem.java

示例5: getCommitterText

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@Nonnull
private static String getCommitterText(@Nullable VcsUser committer, @Nonnull String commitTimeText, int offset) {
  String alignment = "<br/>" + StringUtil.repeat("&nbsp;", offset);
  String gray = ColorUtil.toHex(JBColor.GRAY);

  String graySpan = "<span style='color:#" + gray + "'>";

  String text = alignment + graySpan + "committed";
  if (committer != null) {
    text += " by " + VcsUserUtil.getShortPresentation(committer);
    if (!committer.getEmail().isEmpty()) {
      text += "</span>" + getEmailText(committer) + graySpan;
    }
  }
  text += commitTimeText + "</span>";
  return text;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:18,代碼來源:CommitPanel.java

示例6: IndexSpeedSearch

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
public IndexSpeedSearch(@Nonnull Project project, @Nonnull VcsLogIndex index, @Nonnull VcsLogGraphTable component) {
  super(component);
  myIndex = index;
  myUserRegistry = ServiceManager.getService(project, VcsUserRegistry.class);

  addChangeListener(evt -> {
    if (evt.getPropertyName().equals(ENTERED_PREFIX_PROPERTY_NAME)) {
      String newValue = (String)evt.getNewValue();
      if (newValue != null) {
        String oldValue = (String)evt.getOldValue();
        Collection<VcsUser> usersToExamine = myUserRegistry.getUsers();
        if (oldValue != null && newValue.contains(oldValue) && myMatchedUsers != null) {
          if (myMatchedUsers.isEmpty()) return;
          usersToExamine = myMatchedUsers;
        }
        myMatchedUsers = ContainerUtil.filter(usersToExamine,
                                              user -> compare(VcsUserUtil.getShortPresentation(user), newValue));
        myMatchedByUserCommits = myIndex.filter(Collections.singletonList(new SimpleVcsLogUserFilter(myMatchedUsers)));
      }
      else {
        myMatchedByUserCommits = null;
        myMatchedUsers = null;
      }
    }
  });
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:27,代碼來源:IndexSpeedSearch.java

示例7: VcsLogUserFilterImpl

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
public VcsLogUserFilterImpl(@Nonnull Collection<String> users,
                            @Nonnull Map<VirtualFile, VcsUser> meData,
                            @Nonnull Set<VcsUser> allUsers) {
  myUsers = users;
  myData = meData;

  for (VcsUser user : allUsers) {
    String name = user.getName();
    if (!name.isEmpty()) {
      myAllUsersByNames.putValue(VcsUserUtil.getNameInStandardForm(name), user);
    }
    String email = user.getEmail();
    String nameFromEmail = VcsUserUtil.getNameFromEmail(email);
    if (nameFromEmail != null) {
      myAllUsersByEmails.putValue(VcsUserUtil.getNameInStandardForm(nameFromEmail), user);
    }
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:19,代碼來源:VcsLogUserFilterImpl.java

示例8: getUsers

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@Nonnull
private Set<VcsUser> getUsers(@Nonnull VirtualFile root, @Nonnull String name) {
  Set<VcsUser> users = ContainerUtil.newHashSet();
  if (ME.equals(name)) {
    VcsUser vcsUser = myData.get(root);
    if (vcsUser != null) {
      users.addAll(getUsers(vcsUser.getName())); // do not just add vcsUser, also add synonyms
      String emailNamePart = VcsUserUtil.getNameFromEmail(vcsUser.getEmail());
      if (emailNamePart != null) {
        users.addAll(getUsers(emailNamePart));
      }
    }
  }
  else {
    users.addAll(getUsers(name));
  }
  return users;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:19,代碼來源:VcsLogUserFilterImpl.java

示例9: matches

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@Override
public boolean matches(@Nonnull final VcsCommitMetadata commit) {
  return ContainerUtil.exists(myUsers, name -> {
    Set<VcsUser> users = getUsers(commit.getRoot(), name);
    if (!users.isEmpty()) {
      return users.contains(commit.getAuthor());
    }
    else if (!name.equals(ME)) {
      String lowerUser = VcsUserUtil.nameToLowerCase(name);
      boolean result = VcsUserUtil.nameToLowerCase(commit.getAuthor().getName()).equals(lowerUser) ||
                       VcsUserUtil.emailToLowerCase(commit.getAuthor().getEmail()).startsWith(lowerUser + "@");
      if (result) {
        LOG.warn("Unregistered author " + commit.getAuthor() + " for commit " + commit.getId().asString() + "; search pattern " + name);
      }
      return result;
    }
    return false;
  });
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:20,代碼來源:VcsLogUserFilterImpl.java

示例10: initEnumerator

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@Nullable
private PersistentEnumerator<VcsUser> initEnumerator(@NotNull final File mapFile) {
  try {
    return IOUtil.openCleanOrResetBroken(new ThrowableComputable<PersistentEnumerator<VcsUser>, IOException>() {
      @Override
      public PersistentEnumerator<VcsUser> compute() throws IOException {
        return new PersistentEnumerator<VcsUser>(mapFile, new MyDescriptor(), Page.PAGE_SIZE);
      }
    }, mapFile);
  }
  catch (IOException e) {
    LOG.warn(e);
    return null;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:VcsUserRegistryImpl.java

示例11: createUser

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@NotNull
@Override
public VcsUser createUser(@NotNull String name, @NotNull String email) {
  synchronized (myInterner) {
    return myInterner.intern(new VcsUserImpl(name, email));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:VcsUserRegistryImpl.java

示例12: addUser

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
public void addUser(@NotNull VcsUser user) {
  try {
    if (myPersistentEnumerator != null) {
      myPersistentEnumerator.enumerate(user);
    }
  }
  catch (IOException e) {
    LOG.warn(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:VcsUserRegistryImpl.java

示例13: getUsers

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@Override
@NotNull
public Set<VcsUser> getUsers() {
  try {
    Collection<VcsUser> users = myPersistentEnumerator != null ?
                                myPersistentEnumerator.getAllDataObjects(ACCEPT_ALL_DATA_FILTER) :
                                Collections.<VcsUser>emptySet();
    return ContainerUtil.newHashSet(users);
  }
  catch (IOException e) {
    LOG.warn(e);
    return Collections.emptySet();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:VcsUserRegistryImpl.java

示例14: getAllValues

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
@NotNull
@Override
protected List<String> getAllValues() {
  return ContainerUtil.map(myDataHolder.getAllUsers(), new Function<VcsUser, String>() {
    @Override
    public String fun(VcsUser user) {
      return user.getName();
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:UserFilterPopupComponent.java

示例15: VcsChangesLazilyParsedDetails

import com.intellij.vcs.log.VcsUser; //導入依賴的package包/類
public VcsChangesLazilyParsedDetails(@NotNull Hash hash, @NotNull List<Hash> parents, long commitTime, @NotNull VirtualFile root,
                                     @NotNull String subject, @NotNull VcsUser author, @NotNull String message,
                                     @NotNull VcsUser committer, long authorTime,
                                     @NotNull ThrowableComputable<Collection<Change>, ? extends Exception> changesGetter) {
  super(hash, parents, commitTime, root, subject, author, message, committer, authorTime);
  myChangesGetter = changesGetter;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:VcsChangesLazilyParsedDetails.java


注:本文中的com.intellij.vcs.log.VcsUser類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。