Exemple #1
0
        public void GetPathProperties_Revision17_Properties()
        {
            var properties = api.GetPathProperties("/Folder/Second", 17);

            Assert.That(properties, Has.Count.EqualTo(3));
            Assert.That(properties["cr:test"], Is.EqualTo("nur ein test"));
            Assert.That(properties["cr:test2"], Is.EqualTo("another test"));
            Assert.That(properties["cr:test3"], Is.EqualTo("more tests"));
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HitViewModel hitViewModel = ApplicationIndex.GetHitById(Context.Request.QueryString["id"]);
            string       path         = hitViewModel.Path;
            int          revision     = hitViewModel.Revision;

            // getting _properties from the index
            Title               = path.Substring(path.LastIndexOf('/') + 1);
            _header.InnerText   = path;
            _author.InnerText   = hitViewModel.Author;
            _modified.InnerText = hitViewModel.LastModification;
            if (hitViewModel.MaxSize > 0)
            {
                _size.InnerText = hitViewModel.Size;
            }
            else
            {
                _sizeRow.Visible = false;
            }
            _revisions.InnerText = hitViewModel.RevFirst + " - " + hitViewModel.RevLast;

            // getting _properties from subversion
            _message.InnerText = Svn.GetLogMessage(revision);

            if (path[0] == '$')
            {
                return;                 // Revision Log
            }
            bool binary = InitProperties(Svn.GetPathProperties(path, revision));

            if (hitViewModel.MaxSize > 512 * 1024)
            {
                _contentWarning.InnerText = "Content size is too big to display";
            }
            else if (binary)
            {
                _contentWarning.InnerText = "Content type is binary";
            }
            else if (hitViewModel.MaxSize > 0)
            {
                _content.InnerText = Svn.GetPathContent(path, revision, hitViewModel.MaxSize);

                var syntaxHighlighter = new SyntaxHighlightBrushMapper(path);
                if (syntaxHighlighter.IsAvailable)
                {
                    AddScriptInclude(syntaxHighlighter.GetScript());
                    AddStartupScript();
                    _content.Attributes.Add("class", syntaxHighlighter.GetClass());
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Fetches some more information from the repository for an item
        /// </summary>
        /// <param name="jobData"></param>
        void FetchJob(IndexJobData jobData)
        {
            if (!_args.SingleRevision || jobData.RevisionLast == Revision.Head) // don't fetch if this data would be deleted anyway
            {
                if (_args.Verbosity > 1)
                {
                    Console.WriteLine("Fetch          " + jobData.Path + "   " + jobData.RevisionFirst + ":" + jobData.RevisionLast);
                }

                jobData.Properties = _svn.GetPathProperties(jobData.Path, jobData.RevisionFirst);
                if (IsIndexable(jobData))
                {
                    jobData.Content = _svn.GetPathContent(jobData.Path, jobData.RevisionFirst, jobData.Info.Size);
                }
            }
            QueueIndexJob(jobData);
        }