AddRepositoryString() public method

public AddRepositoryString ( string repository ) : void
repository string
return void
Example #1
0
		public void GetChangesets()
		{
			var filterBuilder = new ChangesetFindFilterBuilder();
			filterBuilder.AddDateRange(new DateTime(2013, 01, 01), new DateTime(2014, 01, 01));
			filterBuilder.AddRepositoryString(PlasticTestHelpers.LibGit2Workspace.Repository);
			var res = Plastic.GetChangesets(filterBuilder.ToString(), Environment.CurrentDirectory);
			Assert.AreEqual(2234, res.Count);
		}
		private async Task<IEnumerable<ChangesetInfo>> GetSortedChangesetsAsync()
		{
			var csfb = new ChangesetFindFilterBuilder();
			csfb.AddBranch(Branch);
			csfb.AddRepositoryString(Repository);
			var workingDirectory = SessionState.Path.CurrentFileSystemLocation.ProviderPath;
			var changesets = await Plastic.GetChangesetsAsync(csfb.ToString(), workingDirectory, CancellationToken);
			return changesets.OrderByDescending(c => c.ChangesetId);
		}
Example #3
0
		public async Task GetChangesetsOnBranchAsync()
		{
			var workspace = Plastic.GetWorkspaces().First(ws => ws.Name == "libgit2");
			var filterBuilder = new ChangesetFindFilterBuilder();
			filterBuilder.AddBranch(new[] {"/vmg-no-lookup"});
			filterBuilder.AddRepositoryString(new[] {workspace.Repository});
			var res = await Plastic.GetChangesetsAsync(filterBuilder.ToString(), Environment.CurrentDirectory);
			Assert.AreEqual(3, res.Count);
		}
Example #4
0
		public void SetChangesetAttributeTest()
		{
			var libGit2Workspace = PlasticTestHelpers.LibGit2Workspace;
			const string AttributeName = "UnitTestAttribute";
			try
			{
				Plastic.MakeAttributeType(AttributeName, libGit2Workspace.Path, libGit2Workspace.Repository);
			}
			catch (AttributeAlreadyExistException)
			{
			}
			Plastic.SetChangesetAttribute(AttributeName, "10", 5188, libGit2Workspace.Path, libGit2Workspace.Repository);
			var changesetFindFilterBuilder = new ChangesetFindFilterBuilder();
			changesetFindFilterBuilder.AddAttribute(AttributeName);
			changesetFindFilterBuilder.AddChangesetId(5188);
			changesetFindFilterBuilder.AddRepositoryString(new[] {libGit2Workspace.Repository});
			var res = Plastic.GetChangesets(changesetFindFilterBuilder.ToString(), libGit2Workspace.Path);
			Assert.AreEqual(1, res.Count);
			Assert.AreEqual(5188, res[0].ChangesetId);
			Plastic.RemoveAttributeType(AttributeName, libGit2Workspace.Path, libGit2Workspace.Repository);
		}