Example #1
0
        /// <inheritdoc/>
        public IEnumerable <SvnStatusResult> Status(string fileOrDirectoryPath, SvnStatusSettings settings)
        {
            var statusResults = new List <SvnStatusEventArgs>();

            Status(
                fileOrDirectoryPath,
                settings.ToSvnStatusArgs(),
                statusHandler: (s, e) =>
            {
                statusResults.Add(e);
            });

            return
                ((from eventArg in statusResults
                  select new SvnStatusResult(
                      eventArg.RepositoryId,
                      eventArg.RepositoryRoot,
                      eventArg.LastChangeAuthor,
                      eventArg.Revision,
                      eventArg.LastChangeRevision,
                      eventArg.Uri,
                      eventArg.Path,
                      eventArg.FullPath,
                      eventArg.LocalNodeStatus.ToSvnStatus())).ToList());
        }
            public void Should_Set_ThrowOnCancel_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.True(settings.ThrowOnCancel);
            }
            public void Should_Set_Revision_To_Null_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.Null(settings.Revision);
            }
            public void Should_Not_RetrieveRemoteStatus_ByDefault()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.False(settings.RetrieveRemoteStatus);
            }
            public void Should_Not_KeepDepth_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.False(settings.KeepDepth);
            }
            public void Should_Not_IgnoreWorkingCopyStatus_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.False(settings.IgnoreWorkingCopyStatus);
            }
            public void Should_IgnoreExternals_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.True(settings.IgnoreExternals);
            }
            public void Should_Set_ThrowOnWarning_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.False(settings.ThrowOnWarning);
            }
            public void Should_Set_Infinity_Depth_By_Default()
            {
                // Given, When
                var settings = new SvnStatusSettings();

                // Then
                Assert.Equal(SvnDepth.Infinity, settings.Depth);
            }
 internal SvnStatusFixture()
 {
     Environment   = Substitute.For <ICakeEnvironment>();
     SvnClient     = Substitute.For <ISvnClient>();
     Settings      = new SvnStatusSettings();
     DirectoryPath = new DirectoryPath(@"C:\test\");
     FilePath      = new FilePath(@"C:\test\test.cs");
     GetSvnClient  = () => SvnClient;
 }
Example #11
0
        public static IEnumerable <SvnStatusResult> SvnStatusDirectory(this ICakeContext context, DirectoryPath directoryPath, SvnStatusSettings settings)
        {
            var commands = new SvnStatusTool(context.Environment, SvnClientFactoryMethod);

            return(commands.Status(directoryPath, settings ?? new SvnStatusSettings()));
        }