本文整理匯總了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;
}
});
}
示例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;
}
示例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;
}
示例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();
}
示例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(" ", 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;
}
示例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;
}
}
});
}
示例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);
}
}
}
示例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;
}
示例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;
});
}
示例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;
}
}
示例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));
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
});
}
示例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;
}