<commit_before>"use strict";

define(['logManager'], function (logManager) {

    var RepositoryLogControl;

    RepositoryLogControl = function (myClient, myView) {
        var self = this;

        this._client = myClient;
        this._view = myView;

        //override view event handlers
        this._view.onCommitDblClick = function (params) {
            self._client.loadCommit(params.id);
        };

        this._logger = logManager.create("RepositoryLogControl");
        this._logger.debug("Created");
    };

    RepositoryLogControl.prototype.generateHistory = function () {
        this._updateHistory();
    };

    RepositoryLogControl.prototype._updateHistory = function () {
        var currentCommitId = this._client.getActualCommit(),
            commits = this._client.getCommits(),
            i = commits.length,
            com;

        while (i--) {
            com = commits[i];

            this._view.addCommit({"id": com._id,
                                  "name": com.name,
                                  "message": com.message,
                                  "parents": com.parents,
                                  "timestamp": com.time || com.end, //TODO: end is obsolete, time should be used
                                  "isEnd": false,
                                  "actual": com._id === currentCommitId });
        }

        this._view.render();
    };

    return RepositoryLogControl;
});<commit_msg>adding fake data manually just for testing<commit_after>"use strict";

define(['logManager'], function (logManager) {

    var RepositoryLogControl;

    RepositoryLogControl = function (myClient, myView) {
        var self = this;

        this._client = myClient;
        this._view = myView;

        //override view event handlers
        this._view.onCommitDblClick = function (params) {
            self._client.loadCommit(params.id);
        };

        this._logger = logManager.create("RepositoryLogControl");
        this._logger.debug("Created");
    };

    RepositoryLogControl.prototype.generateHistory = function () {
        this._updateHistory(false);
    };

    RepositoryLogControl.prototype._updateHistory = function (useFake) {
        var currentCommitId = this._client.getActualCommit(),
            commits = useFake ? this._getFakeCommits() : this._client.getCommits(),
            i = commits.length,
            com;

        while (i--) {
            com = commits[i];

            this._view.addCommit({"id": com._id,
                                  "name": com.name,
                                  "message": com.message,
                                  "parents": com.parents,
                                  "timestamp": com.time || com.end, //TODO: end is obsolete, time should be used
                                  "isEnd": false,
                                  "actual": com._id === currentCommitId });
        }

        this._view.render();
    };

    RepositoryLogControl.prototype._getFakeCommits = function () {
        var result = [],
            num = 16,
            c = num,
            commit,
            branches = ["master", "b1", "b2"];

        while (c--) {
            commit = {};
            commit._id = num - c - 1 + "";
            //branch name
            commit.name = branches[0];
            commit.message = "Message " + commit._id;
            commit.timestamp = new Date();
            commit.parents = [];

            //regular parents in line
            if (commit._id > 0) {
                commit.parents.push(commit._id - 1);
            }

            result.push(commit);
        }

        //create
        result[3].parents = ["1"];
        result[5].parents = ["2", "4"];

        result[8].parents = ["1"];


        result[9].parents = ["6"];


        result[10].parents = ["8"];
        result[11].parents = ["9", "7"];

        result[12].parents = ["10", "11"];



        return result;
    };

    return RepositoryLogControl;
});
{'fraction_non_alphanumeric': 0.12609457092819615, 'fraction_numerical': 0.007505629221916437, 'mean_word_length': 1.530379746835443, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '978725', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1011, 'n_words': 216}