Exemple #1
0
		public void Cat (string pathorurl, SvnRevision rev, Stream stream)
		{
			if (pathorurl == null || stream == null)
				throw new ArgumentNullException ();
		
			LibSvnClient.Rev revision = (LibSvnClient.Rev) rev;
			
			IntPtr localpool = newpool (pool);
			try {
				pathorurl = NormalizePath (pathorurl, localpool);
				StreamCollector collector = new StreamCollector (stream);
				IntPtr svnstream = svn.stream_create (IntPtr.Zero, localpool);
				svn.stream_set_write (svnstream, new LibSvnClient.svn_readwrite_fn_t (collector.Func));
				LibSvnClient.Rev peg_revision = LibSvnClient.Rev.Blank;
				CheckError (svn.client_cat2 (svnstream, pathorurl, ref peg_revision, ref revision, ctx, localpool));
			} finally {
				apr.pool_destroy (localpool);
			}
		}
		public void Cat (string pathorurl, SvnRevision rev, Stream stream)
		{
			if (pathorurl == null || stream == null)
				throw new ArgumentNullException ();
		
			LibSvnClient.Rev revision = (LibSvnClient.Rev) rev;
			
			IntPtr localpool = IntPtr.Zero;
			try {
				localpool = TryStartOperation (null);
				pathorurl = NormalizePath (pathorurl, localpool);
				StreamCollector collector = new StreamCollector (stream);
				IntPtr svnstream = svn.stream_create (IntPtr.Zero, localpool);
				svn.stream_set_write (svnstream, collector.Func);
				// Setting peg_revision to revision.
				// Otherwise, it will use Head as peg and it will throw exceptions.
				CheckError (svn.client_cat2 (svnstream, pathorurl, ref revision, ref revision, ctx, localpool), 195007);
			} finally {
				TryEndOperation (localpool);
			}
		}
        public void Cat(string pathorurl, Rev revision, Stream stream)
        {
            if (pathorurl == null) throw new ArgumentException();
            if (stream == null) throw new ArgumentException();

            IntPtr localpool = newpool(pool);
            try {
                StreamCollector collector = new StreamCollector(stream);
                IntPtr svnstream = svn_stream_create(IntPtr.Zero, localpool);
                svn_stream_set_write(svnstream, new svn_readwrite_fn_t(collector.Func));
                CheckError(svn_client_cat(svnstream, pathorurl, ref revision, ctx, localpool));
            } finally {
                apr_pool_destroy(localpool);
            }
        }