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


C# HgRepository类代码示例

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


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

示例1: Shell

 public Shell(HgRepository repository, BrowseForRepositoryEvent browseForRepositoryEvent)
 {
     _browseForRepositoryEvent = browseForRepositoryEvent;
     InitializeComponent();
     Text = Application.ProductName + " "+Application.ProductVersion +" - "+ repository.PathToRepo;
     _tabControl.TabPages.Clear();
 }
开发者ID:sillsdev,项目名称:chack,代码行数:7,代码来源:Shell.cs

示例2: MakeCloneFromLocalToLocal

        //TODO: get rid of this, or somehow combine it with the other Clone() options out there
        /// <returns>path to clone, or empty if it failed</returns>
        public static string MakeCloneFromLocalToLocal(string sourcePath, string targetDirectory, bool alsoDoCheckout, IProgress progress)
        {
            RequireThat.Directory(sourcePath).Exists();
            //Handled by GetUniqueFolderPath call now down in CloneLocal call. RequireThat.Directory(targetDirectory).DoesNotExist();
            RequireThat.Directory(targetDirectory).Parent().Exists();

            HgRepository local = new HgRepository(sourcePath, progress);

            if (!local.RemoveOldLocks())
            {
                progress.WriteError("Chorus could not create the clone at this time.  Try again after restarting the computer.");
                return string.Empty;
            }

            using (new ConsoleProgress("Trying to Create repository clone at {0}", targetDirectory))
            {
                targetDirectory = local.CloneLocalWithoutUpdate(targetDirectory);
                File.WriteAllText(Path.Combine(targetDirectory, "~~Folder has an invisible repository.txt"), "In this folder, there is a (possibly hidden) folder named '.hg' that contains the actual data of this Chorus repository. Depending on your Operating System settings, that leading '.' might make the folder invisible to you. But Chorus clients (WeSay, FLEx, OneStory, etc.) can see it and can use this folder to perform Send/Receive operations.");

                if (alsoDoCheckout)
                {
                    // string userIdForCLone = string.Empty; /* don't assume it's this user... a repo on a usb key probably shouldn't have a user default */
                    var clone = new HgRepository(targetDirectory, progress);
                    clone.Update();
                }
                return targetDirectory;
            }
        }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:30,代码来源:HgHighLevel.cs

示例3: Revision

 public Revision(HgRepository repository, string name, string localRevisionNumber, string hash, string comment)
     : this(repository)
 {
     UserId = name;
     Number = new RevisionNumber(localRevisionNumber, hash);
     Summary = comment;
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:7,代码来源:Revision.cs

示例4: CommitCop

 public CommitCop(HgRepository repository, ChorusFileTypeHandlerCollection handlers, IProgress progress)
 {
     _repository = repository;
     _handlerCollection = handlers;
     _progress = progress;
     ValidateModifiedFiles();
 }
开发者ID:sillsdev,项目名称:chack,代码行数:7,代码来源:CommitCop.cs

示例5: HgResumeTransport

 ///<summary>
 ///</summary>
 public HgResumeTransport(HgRepository repo, string targetLabel, IApiServer apiServer, IProgress progress)
 {
     _repo = repo;
     _targetLabel = targetLabel;
     _apiServer = apiServer;
     _progress = progress;
 }
开发者ID:papeh,项目名称:chorus,代码行数:9,代码来源:HgResumeTransport.cs

示例6: HgTestSetup

 public HgTestSetup()
 {
     _progress = new ConsoleProgress();
     Root = new TemporaryFolder("ChorusHgWrappingTest");
     HgRepository.CreateRepositoryInExistingDir(Root.Path,_progress);
     Repository = new HgRepository(Root.Path, new NullProgress());
 }
开发者ID:regnrand,项目名称:chorus,代码行数:7,代码来源:HgTestSetup.cs

示例7: Find2WayDifferences

		public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
		{
			var diffReports = new List<IChangeReport>(1);

			// The only relevant change to report is the version number.
			var childData = child.GetFileContents(repository);
			var splitData = SplitData(childData);
			var childModelNumber = Int32.Parse(splitData[1]);
			if (parent == null)
			{
				diffReports.Add(new FieldWorksModelVersionAdditionChangeReport(child, childModelNumber));
			}
			else
			{
				var parentData = parent.GetFileContents(repository);
				splitData = SplitData(parentData);
				var parentModelNumber = Int32.Parse(splitData[1]);
				if (parentModelNumber != childModelNumber)
					diffReports.Add(new FieldWorksModelVersionUpdatedReport(parent, child, parentModelNumber, childModelNumber));
				else
					throw new InvalidOperationException("The version number has downgraded");
			}

			return diffReports;
		}
开发者ID:gmartin7,项目名称:flexbridge,代码行数:25,代码来源:ModelVersionFileTypeHandlerStrategy.cs

示例8: MakeCloneFromLocalToLocal

        //TODO: get rid of this, or somehow combine it with the other Clone() options out there
        /// <returns>path to clone, or empty if it failed</returns>
        private static string MakeCloneFromLocalToLocal(string sourcePath, string targetDirectory, bool cloningFromUsb, IProgress progress)
        {
            RequireThat.Directory(sourcePath).Exists();
            //Handled by GetUniqueFolderPath call now down in CloneLocal call. RequireThat.Directory(targetDirectory).DoesNotExist();
            RequireThat.Directory(targetDirectory).Parent().Exists();

            HgRepository local = new HgRepository(sourcePath, progress);

            if (!local.RemoveOldLocks())
            {
                progress.WriteError("Chorus could not create the clone at this time.  Try again after restarting the computer.");
                return string.Empty;
            }

            using (new ConsoleProgress("Trying to Create repository clone at {0}", targetDirectory))
            {
                // Make a backward compatibile clone if cloning to USB (http://mercurial.selenic.com/wiki/UpgradingMercurial)
                targetDirectory = local.CloneLocalWithoutUpdate(targetDirectory, cloningFromUsb ? null : "--config format.dotencode=false --pull");
                File.WriteAllText(Path.Combine(targetDirectory, "~~Folder has an invisible repository.txt"), "In this folder, there is a (possibly hidden) folder named '.hg' that contains the actual data of this Chorus repository. Depending on your Operating System settings, that leading '.' might make the folder invisible to you. But Chorus clients (WeSay, FLEx, OneStory, etc.) can see it and can use this folder to perform Send/Receive operations.");

                if (cloningFromUsb)
                {
                    var clone = new HgRepository(targetDirectory, progress);
                    clone.Update();
                }
                return targetDirectory;
            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:30,代码来源:HgHighLevel.cs

示例9: UpdateDisplay

 private void UpdateDisplay()
 {
     var repo = new HgRepository(ProjectFolderPath, new NullProgress());
     string message;
     var ready = repo.GetIsReadyForInternetSendReceive(out message);
     _warningImage.Visible = !ready;
     _chorusReadinessMessage.Text = message;
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:8,代码来源:ReadinessPanel.cs

示例10: Find2WayDifferences

		public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
		{
			return Xml2WayDiffService.ReportDifferences(
				repository,
				parent,
				child,
				SharedConstants.Header,
				SharedConstants.WfiWordform, SharedConstants.GuidStr);
		}
开发者ID:gmartin7,项目名称:flexbridge,代码行数:9,代码来源:WordformInventoryFileTypeHandlerStrategy.cs

示例11: Find2WayDifferences

		public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
		{
			return Xml2WayDiffService.ReportDifferences(
				repository,
				parent,
				child,
				null,
				SharedConstants.MoMorphData, SharedConstants.GuidStr);
		}
开发者ID:gmartin7,项目名称:flexbridge,代码行数:9,代码来源:MorphAndSynFileTypeHandlerStrategy.cs

示例12: CanConnect

 /// <summary>
 /// Find out if ChorusHub can connect or not.
 /// </summary>
 public override bool CanConnect(HgRepository localRepository, string projectName, IProgress progress)
 {
     // It can connect for either of these reasons:
     //	1. 'localRepository' Identifier matches one of the ids of _sourceRepositoryInformation. (Name may not be the same as 'projectName')
     //	2. The name of one of _sourceRepositoryInformation matches or begins with 'projectName' AND the id is 'newRepo'.
     //     (A clone of this isn't useful.)
     string dummy;
     return TryGetBestRepoMatch(localRepository.Identifier, projectName, out dummy, out dummy);
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:12,代码来源:RepositoryAddress.cs

示例13: GetCloneFromInternetDialog

        public GetCloneFromInternetDialog(GetCloneFromInternetModel model)
        {
            _model = model;
            //#if !MONO
            Font = SystemFonts.MessageBoxFont;
            //#endif
            InitializeComponent();

            Font = SystemFonts.MessageBoxFont;

            _backgroundWorker = new BackgroundWorker();
            _backgroundWorker.WorkerSupportsCancellation = true;
            _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted;
            _backgroundWorker.DoWork += _backgroundWorker_DoWork;

            _logBox.ShowCopyToClipboardMenuItem = true;
            _logBox.ShowDetailsMenuItem = true;
            _logBox.ShowDiagnosticsMenuItem = true;
            _logBox.ShowFontMenuItem = true;

            _model.AddProgress(_statusProgress);
            _statusProgress.Text = "";
            _statusProgress.Visible = false;
            _model.AddMessageProgress(_logBox);
            _model.ProgressIndicator = _progressBar;
            _model.UIContext = SynchronizationContext.Current;

            _serverSettingsControl = new ServerSettingsControl(){Model=_model};
            _serverSettingsControl.TabIndex = 0;
            _serverSettingsControl.Anchor = (AnchorStyles.Top | AnchorStyles.Left);
            Controls.Add(_serverSettingsControl);

            _targetFolderControl = new TargetFolderControl(_model);
            _targetFolderControl.Anchor = (AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            _targetFolderControl._downloadButton.Click+=OnDownloadClick;
            _targetFolderControl.Location = new Point(0, _serverSettingsControl.Height +10);
            MinimumSize = new Size(_targetFolderControl.MinimumSize.Width+20, _targetFolderControl.Bottom +20);
            if (_targetFolderControl.Bottom +30> Bottom)
            {
                this.Size = new Size(this.Width,_targetFolderControl.Bottom + 30);
            }
            _targetFolderControl.TabIndex = 1;
            this.Controls.Add(_targetFolderControl);
            _okButton.TabIndex = 90;
            _cancelButton.TabIndex = 91;

            _fixSettingsButton.Left = _cancelButton.Left;
             _targetFolderControl._downloadButton.Top = _okButton.Top-_targetFolderControl.Top	;
             _targetFolderControl._downloadButton.Left = _okButton.Left - 15;

            _logBox.GetDiagnosticsMethod = (progress) =>
                                           	{
                                                var hg = new HgRepository(PathToNewlyClonedFolder, progress);
                                                hg.GetDiagnosticInformationForRemoteProject(progress, ThreadSafeUrl);
                                           	};
        }
开发者ID:sillsdev,项目名称:chack,代码行数:56,代码来源:GetCloneFromInternetDialog.cs

示例14: RevisionInRepositoryModel

        public RevisionInRepositoryModel(HgRepository repository,
										RevisionSelectedEvent revisionSelectedEvent,
										RevisionListOptions options)
        {
            Guard.AgainstNull(repository, "repository");
            _repository = repository;
            _revisionSelectedEvent = revisionSelectedEvent;
            _options = options;
            DiscoveredRevisionsQueue =  new Queue<Revision>();
        }
开发者ID:regnrand,项目名称:chorus,代码行数:10,代码来源:RevisionInRepositoryModel.cs

示例15: HgNormalTransport

 public HgNormalTransport(HgRepository repo, string targetLabel, string targetUri, IProgress progress)
 {
     _repo = repo;
     _targetUri = targetUri;
     _targetLabel = targetLabel;
     _progress = progress;
     if (_progress.ProgressIndicator != null)
     {
         _progress.ProgressIndicator.IndicateUnknownProgress();
     }
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:11,代码来源:HgNormalTransport.cs


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