Exemple #1
0
        public FakeTFS()
        {
            _branchMap = new treelib.AVLDict <string, string, treelib.StringSorterInsensitive>();

            _branchMap.insert("$/IGT_0803/development/dev_advantage/EGS/", "devadv");
            _branchMap.insert("$/IGT_0803/release/EGS8.1/SP2/RTM/EGS/", "81sp2rtm");
            _branchMap.insert("$/IGT_0803/release/EGS8.1/SP2/HF/EGS/", "81sp2hf");
            _branchMap.insert("$/IGT_0803/release/EGS8.1/SP1/HF/EGS/", "81sp1hf");
            _branchMap.insert("$/IGT_0803/release/EGS8.1/SP0/HF/EGS/", "81rtm");
            _branchMap.insert("$/IGT_0803/release/EGS8.1/dev_sp/EGS/", "81devsp");
            _branchMap.insert("$/IGT_0803/main/EGS/", "main");
            _branchMap.insert("$/IGT_0803/development/dev_uInstall/EGS/", "devuinstall");
            _branchMap.insert("$/IGT_0803/development/dev_tableManager/EGS/", "devtableManager");
            _branchMap.insert("$/IGT_0803/development/dev_tableID/EGS/", "dev_tableID");
            _branchMap.insert("$/IGT_0803/development/dev_mariposa/EGS/", "dev_mariposa");
            _branchMap.insert("$/IGT_0803/development/dev_MA/EGS/", "dev_ma");
            _branchMap.insert("$/IGT_0803/development/dev_eft/EGS/", "deveft");
            _branchMap.insert("$/IGT_0803/development/dev_build/EGS/", "dev_build");
            _branchMap.insert("$/IGT_0803/development/dev_AX/EGS/", "dev_ax");
            _branchMap.insert("$/IGT_0803/development/dev_AdvAsia/EGS/", "dev_advasias");
        }
Exemple #2
0
        private void _load(ChangesetCont changesets)
        {
            /* walk each changeset. */
            for (ChangesetCont.iterator it = changesets.begin();
                 it != changesets.end();
                 ++it)
            {
                /* get the list of branches for this changeset. */
                it.item().buildBranches();

                /* add branches to the master list of branches. */
                foreach (string b1 in it.item().Branches)
                {
                    string branch = b1;
                    treelib.AVLDict <string, string, treelib.StringSorterInsensitive> .iterator bmit =
                        _branchMap.find(branch);

                    if (bmit != _branchMap.end())
                    {
                        branch = bmit.value();
                    }

                    /* add the changeset to the proper branch. */
                    BranchChangesets.iterator bit = _branchChangesets.find(branch);
                    Revision rev =
                        new Revision(it.item().ID,
                                     branch,
                                     it.item().Author,
                                     it.item().Date,
                                     it.item().Comment);

                    if (_changesetIdx.end() == _changesetIdx.find(it.item().ID))
                    {
                        /* add the changeset to the changeset index. */
                        _changesetIdx.insert(it.item().ID, rev);
                    }

                    if (bit != _branchChangesets.end())
                    {
                        if (bit.value().find(it.item().ID) == bit.value().end())
                        {
                            bit.value().insert(it.item().ID, rev);
                        }
                    }
                    else
                    {
                        ChangesetIdx branchIdx = new ChangesetIdx();

                        branchIdx.insert(it.item().ID, rev);
                        _branchChangesets.insert(branch, branchIdx);
                    }

                    /* add the branch to the list of available branches. */
                    if (_branches.find(branch) == _branches.end())
                    {
                        _branches.insert(branch);
                    }
                }
            }

            /* now we need to populate the parents. */
            for (BranchChangesets.iterator bcit = _branchChangesets.begin();
                 bcit != _branchChangesets.end();
                 ++bcit)
            {
                Revision prev = null;

                for (ChangesetIdx.iterator csit = bcit.value().begin();
                     csit != bcit.value().end();
                     ++csit)
                {
                    /* this should list everything from largest to smallest
                     *
                     * so largest has a parent of the next item in the list.
                     */
                    if (prev != null)
                    {
                        prev.addParent(csit.value().ID);
                    }

                    prev = csit.value();
                }
            }
        }