Search in sources :

Example 1 with LineInfo

use of aserg.gtf.util.LineInfo in project Truck-Factor by aserg-ufmg.

the class GitTruckFactor method applyFilterFiles.

private static void applyFilterFiles(List<LineInfo> filteredFilesInfo, List<NewFileInfo> files) {
    if (filteredFilesInfo != null) {
        for (LineInfo lineInfo : filteredFilesInfo) {
            String path = lineInfo.getValues().get(0);
            for (NewFileInfo newFileInfo : files) {
                if (newFileInfo.getPath().equals(path)) {
                    newFileInfo.setFiltered(true);
                    newFileInfo.setFilterInfo(lineInfo.getValues().get(1));
                }
            }
        }
    }
}
Also used : LineInfo(aserg.gtf.util.LineInfo) NewFileInfo(aserg.gtf.model.NewFileInfo)

Example 2 with LineInfo

use of aserg.gtf.util.LineInfo in project Truck-Factor by aserg-ufmg.

the class GitTruckFactorRepList method applyFilterFiles.

private static void applyFilterFiles(List<LineInfo> filteredFilesInfo, List<NewFileInfo> files) {
    if (filteredFilesInfo != null) {
        for (LineInfo lineInfo : filteredFilesInfo) {
            String path = lineInfo.getValues().get(0);
            for (NewFileInfo newFileInfo : files) {
                if (newFileInfo.getPath().equals(path)) {
                    newFileInfo.setFiltered(true);
                    newFileInfo.setFilterInfo(lineInfo.getValues().get(1));
                    System.out.println(path);
                }
            }
        }
    }
}
Also used : LineInfo(aserg.gtf.util.LineInfo) NewFileInfo(aserg.gtf.model.NewFileInfo)

Example 3 with LineInfo

use of aserg.gtf.util.LineInfo in project Truck-Factor by aserg-ufmg.

the class NewAliasHandler method treatFileAlias.

private void treatFileAlias() {
    for (LineInfo info : fileAliases) {
        String rep = info.getRepositoryName();
        String dev1 = info.getValues().get(0);
        String dev2 = info.getValues().get(1);
        String usernameDev1 = devNameMap.get(dev1.toUpperCase()).get(0).getUserName();
        String usernameDev2 = devNameMap.get(dev2.toUpperCase()).get(0).getUserName();
        String newUsername = usernameDev1.contains(usernameDev2) ? usernameDev1 : (usernameDev2.contains(usernameDev1) ? usernameDev2 : usernameDev1 + "$$" + usernameDev2);
        for (LogCommitInfo commit : devUsernameMap.get(usernameDev1)) {
            if (!commit.getUserName().equals(usernameDev2)) {
                setNewUsername(commit, newUsername);
            //commit.setUserName(newUsername);					
            }
        }
        for (LogCommitInfo commit : devUsernameMap.get(usernameDev2)) {
            if (!commit.getUserName().equals(usernameDev1)) {
                setNewUsername(commit, newUsername);
            //commit.setUserName(newUsername);					
            }
        }
    }
}
Also used : LogCommitInfo(aserg.gtf.model.LogCommitInfo) LineInfo(aserg.gtf.util.LineInfo)

Example 4 with LineInfo

use of aserg.gtf.util.LineInfo in project Truck-Factor by aserg-ufmg.

the class AliasHandler method treatFileAlias.

private void treatFileAlias(Map<String, List<LogCommitInfo>> namesMap, Collection<LogCommitInfo> commits) {
    for (LineInfo info : fileAliases) {
        String rep = info.getRepositoryName();
        String dev1 = info.getValues().get(0);
        String dev2 = info.getValues().get(1);
        String mainUserName = namesMap.get(dev1.toUpperCase()).get(0).getUserName();
        for (LogCommitInfo commit : commits) {
            if (commit.getMainName().equalsIgnoreCase(dev2) && !commit.getUserName().equals(mainUserName)) {
                commit.setUserName(mainUserName);
            }
        }
    }
}
Also used : LogCommitInfo(aserg.gtf.model.LogCommitInfo) LineInfo(aserg.gtf.util.LineInfo)

Aggregations

LineInfo (aserg.gtf.util.LineInfo)4 LogCommitInfo (aserg.gtf.model.LogCommitInfo)2 NewFileInfo (aserg.gtf.model.NewFileInfo)2