Ejemplo n.º 1
0
        /// <summary>
        /// run VersionControlServer.QueryHistory
        /// </summary>
        internal static TFSDB QueryHistory(VersionControlServer vcs, string branch,
                                           ulong limit, string startID, SQLiteStorage.SQLiteCache cache)
        {
            TFSDB tfsdb = new TFSDB(vcs, branch, cache);

            tfsdb._history = new ChangesetsDesc();

            VersionSpec fromVer = null;
            VersionSpec toVer   = null;

            if (startID != null)
            {
                toVer = new ChangesetVersionSpec(startID);
            }

            logger.DebugFormat("qh[{0},{1}]", branch, limit);
            IEnumerable foo =
                vcs.QueryHistory(branch, VersionSpec.Latest, 0, RecursionType.Full,
                                 null, fromVer, toVer,                                                                 /* user, from ver, to ver */
                                 (int)limit,
                                 true, false, false);

            /* inc changes, slot mode, inc download info. */

            /* sort the changesets in Descending order */
            foreach (object o in foo)
            {
                tfsdb._history.insert(o as Changeset);
            }

            return(tfsdb);
        }
Ejemplo n.º 2
0
        internal TFSDB(VersionControlServer vcs, string branch,
                       SQLiteStorage.SQLiteCache cache)
        {
            _vcs    = vcs;
            _branch = branch;
            _cache  = cache;

            _visitor = new TFSDBVisitor();

            _qp = new QueryProcessor(_visitor, _vcs);
        }
Ejemplo n.º 3
0
        public override void open()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Title              = "Open a sqlite revision database";
            ofd.Filter             = "SQLite DBs (*.db)|*.db|All files (*.*)|*.*";
            ofd.Multiselect        = false;
            ofd.CheckFileExists    = false;
            ofd.AutoUpgradeEnabled = true;

            DialogResult result = ofd.ShowDialog();

            if (result == DialogResult.OK)
            {
                _db = new SQLiteStorage.SQLiteCache();
                _db.load(ofd.FileName);
            }
        }
Ejemplo n.º 4
0
        internal void save(SQLiteStorage.SQLiteCache db)
        {
            object data = db.start();

            for (BranchChangesets.iterator bit = _branchChangesets.begin();
                 bit != _branchChangesets.end();
                 ++bit)
            {
                for (RevisionIdx.iterator rit = bit.value().begin();
                     rit != bit.value().end();
                     ++rit)
                {
                    TFSDB.logger.DebugFormat("s[{0}]", rit.value().ID);

                    /* database. */
                    db.save(data, rit.value());
                }
            }

            db.end(data);
        }
Ejemplo n.º 5
0
        public override void open()
        {
            if (_cache != null)
            {
                _cache.close();
                _cache = null;
                _vcs   = null;
                _name  = null;
            }

            //TFSServersSelectorForm form = new TFSServersSelectorForm();
            //DialogResult result = form.ShowDialog();
            //if (result == DialogResult.OK)
            {
                //string serverName = form.getSelection();
                string serverName = "rnotfsat";
                _name  = serverName;
                _vcs   = megahistory.Utils.GetTFSServer(serverName);
                _cache = new SQLiteStorage.SQLiteCache();
                _cache.load(serverName + ".db");
            }
        }
Ejemplo n.º 6
0
 public override void close()
 {
     _vcs = null;
     _cache.close();
     _cache = null;
 }