当前位置: 首页>>代码示例>>C#>>正文


C# HgRepository.FixUnicodeAudio方法代码示例

本文整理汇总了C#中HgRepository.FixUnicodeAudio方法的典型用法代码示例。如果您正苦于以下问题:C# HgRepository.FixUnicodeAudio方法的具体用法?C# HgRepository.FixUnicodeAudio怎么用?C# HgRepository.FixUnicodeAudio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HgRepository的用法示例。


在下文中一共展示了HgRepository.FixUnicodeAudio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SyncNow

        public SyncResults SyncNow(SyncOptions options)
        {
            SyncResults results = new SyncResults();
            List<RepositoryAddress> sourcesToTry = options.RepositorySourcesToTry;
            //this just saves us from trying to connect twice to the same repo that is, for example, no there.
            Dictionary<RepositoryAddress, bool> connectionAttempts = new Dictionary<RepositoryAddress, bool>();

            try
            {
                if (_progress.ProgressIndicator != null)
                {
                    _progress.ProgressIndicator.IndicateUnknownProgress();
                }
                var repo = new HgRepository(_localRepositoryPath, _progress);

                RemoveLocks(repo);
                repo.RecoverFromInterruptedTransactionIfNeeded();
                repo.FixUnicodeAudio();
                string branchName = _sychronizerAdjunct.BranchName;
                ChangeBranchIfNecessary(branchName);
                Commit(options);

                var workingRevBeforeSync = repo.GetRevisionWorkingSetIsBasedOn();

                if (options.DoPullFromOthers)
                {
                    results.DidGetChangesFromOthers = PullFromOthers(repo, sourcesToTry, connectionAttempts);
                }

                if (options.DoMergeWithOthers)
                {
                    MergeHeadsOrRollbackAndThrow(repo, workingRevBeforeSync);
                }

                if (options.DoSendToOthers)
                {
                    SendToOthers(repo, sourcesToTry, connectionAttempts);
                }

                //If we did pull any data or a trivial merge succeeded we should call UpdateToTheDescendantRevision
                if (results.DidGetChangesFromOthers || //we pulled something
                    (workingRevBeforeSync!=null //will be null if this is the 1st checkin ever, but no files were added so there was no actual rev created
                    && !repo.GetRevisionWorkingSetIsBasedOn().Number.Hash.Equals(workingRevBeforeSync.Number.Hash))) //a merge happened
                {
                    UpdateToTheDescendantRevision(repo, workingRevBeforeSync);
                }
                _sychronizerAdjunct.CheckRepositoryBranches(repo.BranchingHelper.GetBranches(), _progress);

                results.Succeeded = true;
               _progress.WriteMessage("Done");
            }
            catch (SynchronizationException error)
            {
                error.DoNotifications(Repository, _progress);
                results.Succeeded = false;
                results.ErrorEncountered = error;
            }
            catch (UserCancelledException error)
            {
                results.Succeeded = false;
                results.Cancelled = true;
                results.ErrorEncountered = null;
            }
            catch (Exception error)
            {
                if (error.InnerException != null)
                {
                    _progress.WriteVerbose("inner exception:");
                    _progress.WriteError(error.InnerException.Message);
                    _progress.WriteVerbose(error.InnerException.StackTrace);
                }

                _progress.WriteException(error);//this preserves the whole exception for later retrieval by the client
                _progress.WriteError(error.Message);//review still needed if we have this new WriteException?
                _progress.WriteVerbose(error.StackTrace);//review still needed if we have this new WriteException?

                results.Succeeded = false;
                results.ErrorEncountered = error;
            }
            return results;
        }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:81,代码来源:Synchronizer.cs


注:本文中的HgRepository.FixUnicodeAudio方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。