Esempio n. 1
0
        protected virtual bool UpKeep(bool force = false)
        {
            if (!force && !Keep.IsChanged)
            {
                if (!Keep.QuickMode && FChangeIndexOut.SliceCount != 0)
                {
                    FChangeIndexOut.FlushNil();
                    FChangeOut.FlushNil();
                }
                return(false);
            }

            if (Keep.QuickMode)
            {
                Keep.Sync();
            }
            else
            {
                IEnumerable <Message> changes;
                IEnumerable <int>     indexes;
                changes = Keep.Sync(out indexes);

                FChangeIndexOut.FlushResult(indexes);
                FChangeOut.FlushResult(changes);
            }

            FOutput.FlushResult(Keep);
            FCountOut.FlushInt(Keep.Count);

            return(true);
        }
Esempio n. 2
0
        protected virtual bool UpKeep(bool force = false)
        {
            if (!force && !Keep.IsChanged)
            {
                if (!Keep.QuickMode && FChangeOut.SliceCount != 0)
                {
                    FChangeOut.FlushNil();
                    FChangeIndexOut.FlushNil();
                }

                var recentCommits = from message in Keep
                                    where message.HasRecentCommit()
                                    select message;

                foreach (var message in recentCommits)
                {
                    message.Commit(Keep);
                }
                return(false);
            }

            if (Keep.QuickMode)
            {
                Keep.Sync();
            }
            else
            {
                IEnumerable <int> indexes;
                var changes = Keep.Sync(out indexes);

                FChangeIndexOut.FlushResult(indexes);
                FChangeOut.FlushResult(changes);
            }

            FOutput.FlushResult(Keep);
            FCountOut.FlushItem <int>(Keep.Count);
            return(true);
        }