Example #1
0
        public void Reset()
        {
            lock (_instanceLock)
            {
                LogRequest rq = _currentRequest;
                if (rq != null)
                {
                    _currentRequest = null;
                    rq.Cancel       = true;
                }
                _running = false;
            }

            _logItems.Clear();
            Items.Clear();
            _lastRevision = -1;
            fetchCount    = 0;
        }
Example #2
0
        void OnBatchDone(LogRequest rq)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new Action <LogRequest>(OnBatchDone), rq);
                return;
            }

            if (_fetchAll)
            {
                FetchAll();
            }

            if (BatchDone != null)
            {
                BatchDone(this, new BatchFinishedEventArgs(rq, Items.Count, _logItems.Count));
            }

            ExtendList();
        }
Example #3
0
        void DoFetch(SvnLogArgs args)
        {
            LogRequest rq = _currentRequest = null;

            ShowBusyIndicator();
            try
            {
                using (SvnClient client = _context.GetService <ISvnClientPool>().GetClient())
                {
                    SvnOrigin single = EnumTools.GetSingle(LogSource.Targets);
                    if (single != null)
                    {
                        // TODO: Use peg information
                    }
                    List <Uri> uris = new List <Uri>();
                    foreach (SvnOrigin o in LogSource.Targets)
                    {
                        uris.Add(o.Uri);
                    }

                    switch (_mode)
                    {
                    case LogMode.Log:
                        SvnLogArgs la = new SvnLogArgs();
                        la.AddExpectedError(
                            SvnErrorCode.SVN_ERR_CLIENT_UNRELATED_RESOURCES, // File not there, prevent exception
                            SvnErrorCode.SVN_ERR_UNSUPPORTED_FEATURE);       // Merge info from 1.4 server
                        la.Start                   = args.Start;
                        la.End                     = args.End;
                        la.Limit                   = args.Limit;
                        la.StrictNodeHistory       = args.StrictNodeHistory;
                        la.RetrieveMergedRevisions = args.RetrieveMergedRevisions;

                        _currentRequest = rq = new LogRequest(la, OnReceivedItem);
                        client.Log(uris, la, null);
                        break;

                    case LogMode.MergesEligible:
                        SvnMergesEligibleArgs meArgs = new SvnMergesEligibleArgs();
                        meArgs.AddExpectedError(
                            SvnErrorCode.SVN_ERR_CLIENT_UNRELATED_RESOURCES, // File not there, prevent exception
                            SvnErrorCode.SVN_ERR_UNSUPPORTED_FEATURE);       // Merge info from 1.4 server
                        meArgs.RetrieveChangedPaths = true;

                        _currentRequest = rq = new LogRequest(meArgs, OnReceivedItem);
                        client.ListMergesEligible(LogSource.MergeTarget.Target, single.Target, meArgs, null);
                        break;

                    case LogMode.MergesMerged:
                        SvnMergesMergedArgs mmArgs = new SvnMergesMergedArgs();
                        mmArgs.AddExpectedError(
                            SvnErrorCode.SVN_ERR_CLIENT_UNRELATED_RESOURCES, // File not there, prevent exception
                            SvnErrorCode.SVN_ERR_UNSUPPORTED_FEATURE);       // Merge info from 1.4 server
                        mmArgs.RetrieveChangedPaths = true;
                        _currentRequest             = rq = new LogRequest(mmArgs, OnReceivedItem);
                        client.ListMergesMerged(LogSource.MergeTarget.Target, single.Target, mmArgs, null);
                        break;
                    }
                }
            }
            finally
            {
                // Don't lock here, we can be called from within a lock
                if (rq == _currentRequest)
                {
                    _running = false;
                    OnBatchDone(rq);
                }
                HideBusyIndicator();
            }
        }
Example #4
0
 internal BatchFinishedEventArgs(LogRequest rq, int totalCount, int batchCount)
 {
     _rq         = rq;
     _totalCount = totalCount;
     _batchCount = batchCount;
 }