Changeset 44

Show
Ignore:
Timestamp:
07/02/04 02:49:43
Author:
DenisG
Message:

[SubversionSharp] Add IAprUnmanaged, create SvnRevision? and add more

non-static SvnClient? methods

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SubversionSharp/dev/src/Svn.cs

    r40 r44  
    3131        } 
    3232 
     33        public enum Revision { 
     34            Unspecified, 
     35            Number, 
     36            Date, 
     37            Committed, 
     38            Previous, 
     39            Base, 
     40            Working, 
     41            Head 
     42        } 
    3343 
    3444        internal delegate IntPtr svn_cancel_func_t(IntPtr baton); 
  • trunk/SubversionSharp/dev/src/SvnAuthBaton.cs

    r40 r44  
    1717namespace Softec.SubversionSharp 
    1818{ 
    19     public struct SvnAuthBaton 
     19    public struct SvnAuthBaton : IAprUnmanaged 
    2020    { 
    2121        public enum Param { 
     
    103103        } 
    104104 
    105         public static implicit operator IntPtr(SvnAuthBaton authProviderObject
     105        public IntPtr ToIntPtr(
    106106        { 
    107             return authProviderObject.mAuthBaton; 
     107            return mAuthBaton; 
     108        } 
     109         
     110        public static implicit operator IntPtr(SvnAuthBaton authBaton) 
     111        { 
     112            return authBaton.mAuthBaton; 
    108113        } 
    109114         
  • trunk/SubversionSharp/dev/src/SvnAuthCred.cs

    r31 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe struct SvnAuthCredSimple 
     18    public unsafe struct SvnAuthCredSimple : IAprUnmanaged 
    1919    { 
    2020        private svn_auth_cred_simple_t *mCred; 
     
    5858        } 
    5959 
     60        public IntPtr ToIntPtr() 
     61        { 
     62            return new IntPtr(mCred); 
     63        } 
     64         
    6065        public static implicit operator IntPtr(SvnAuthCredSimple cred) 
    6166        { 
  • trunk/SubversionSharp/dev/src/SvnAuthProvider.cs

    r31 r44  
    1515namespace Softec.SubversionSharp 
    1616{ 
    17     public struct SvnAuthProviderObject 
     17    public struct SvnAuthProviderObject : IAprUnmanaged 
    1818    { 
    1919        private IntPtr mAuthProviderObject; 
     
    5252        } 
    5353 
     54        public IntPtr ToIntPtr() 
     55        { 
     56            return mAuthProviderObject; 
     57        } 
     58         
    5459        public static implicit operator IntPtr(SvnAuthProviderObject authProviderObject) 
    5560        { 
  • trunk/SubversionSharp/dev/src/SvnAuthSslServerCertInfo.cs

    r31 r44  
    1717{ 
    1818 
    19     public unsafe struct SvnAuthSslServerCertInfo 
     19    public unsafe struct SvnAuthSslServerCertInfo : IAprUnmanaged 
    2020    { 
    2121        private svn_auth_ssl_server_cert_info *mSslServerCertInfo; 
     
    6262        } 
    6363 
     64        public IntPtr ToIntPtr() 
     65        { 
     66            return new IntPtr(mSslServerCertInfo); 
     67        } 
     68         
    6469        public static implicit operator IntPtr(SvnAuthSslServerCertInfo clientContext) 
    6570        { 
  • trunk/SubversionSharp/dev/src/SvnClient.cs

    r42 r44  
    1818    public class SvnClient : SvnClientBase 
    1919    { 
     20        AprPool mGlobalPool; 
    2021        AprPool mPool; 
    2122        SvnClientContext mContext; 
    2223        ArrayList mAuthObjs; 
    2324         
    24         #region ctors 
     25        #region ctors and finalize 
    2526        static SvnClient() 
    2627        { 
     
    3031        public SvnClient() 
    3132        { 
    32             mPool = Svn.PoolCreate(); 
    33             mContext = SvnClientContext.Create(mPool); 
    34             mContext.Config = SvnConfig.GetConfig(mPool); 
     33            mGlobalPool = Svn.PoolCreate(); 
     34            mPool = Svn.PoolCreate(mGlobalPool); 
     35            mContext = SvnClientContext.Create(mGlobalPool); 
     36            mContext.Config = SvnConfig.GetConfig(mGlobalPool); 
    3537            mAuthObjs = null; 
    3638        } 
     
    3840        public SvnClient(AprPool pool) 
    3941        { 
    40             mPool = pool; 
    41             mContext = SvnClientContext.Create(mPool); 
    42             mContext.Config = SvnConfig.GetConfig(mPool); 
     42            mGlobalPool = pool; 
     43            mPool = Svn.PoolCreate(mGlobalPool); 
     44            mContext = SvnClientContext.Create(mGlobalPool); 
     45            mContext.Config = SvnConfig.GetConfig(mGlobalPool); 
    4346            mAuthObjs = null; 
    4447        } 
     
    4649        public SvnClient(SvnClientContext ctx, AprPool pool) 
    4750        { 
    48             mPool = pool; 
     51            mGlobalPool = pool; 
     52            mPool = Svn.PoolCreate(mGlobalPool); 
    4953            mContext = ctx; 
    5054            mAuthObjs = null; 
     
    5256        #endregion 
    5357         
    54         #region Checkout methods 
    55         public int Checkout(string url, string path, SvnOptRevision.RevisionKind revision,  
    56                             bool recurse, AprPool pool) 
    57         { 
    58             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    59             optRev.Kind = revision; 
    60             return Checkout(url, path, optRev, recurse, mContext, pool); 
    61         } 
    62          
    63         public int Checkout(string url, string path, SvnOptRevision.RevisionKind revision,  
    64                             bool recurse) 
    65         { 
    66             AprPool pool = Svn.PoolCreate(mPool); 
    67             int rev = Checkout(url, path, revision, recurse, pool); 
    68             pool.Destroy(); 
    69             return(rev); 
    70         } 
    71  
    72         public int Checkout(string url, string path, int revision, bool recurse, AprPool pool) 
    73         { 
    74             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    75             optRev.Number = revision; 
    76             return Checkout(url, path, optRev, recurse, mContext, pool); 
    77         } 
    78          
    79         public int Checkout(string url, string path, int revision, bool recurse) 
    80         { 
    81             AprPool pool = Svn.PoolCreate(mPool); 
    82             int rev = Checkout(url, path, revision, recurse, pool); 
    83             pool.Destroy(); 
    84             return(rev); 
    85         } 
    86  
    87         public int Checkout(string url, string path, long revision, bool recurse, AprPool pool) 
    88         { 
    89             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    90             optRev.Date = revision; 
    91             return Checkout(url, path, optRev, recurse, mContext, pool); 
    92         } 
    93          
    94         public int Checkout(string url, string path, long revision, bool recurse) 
    95         { 
    96             AprPool pool = Svn.PoolCreate(mPool); 
    97             int rev = Checkout(url, path, revision, recurse, pool); 
    98             pool.Destroy(); 
    99             return(rev); 
    100         } 
    101         #endregion 
    102          
    103         #region Update methods 
    104         public int Update(string path, SvnOptRevision.RevisionKind revision, bool recurse, 
    105                           AprPool pool) 
    106         { 
    107             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    108             optRev.Kind = revision; 
    109             return Update(path, optRev, recurse, mContext, pool); 
    110         } 
    111          
    112         public int Update(string path, SvnOptRevision.RevisionKind revision, bool recurse) 
    113         { 
    114             AprPool pool = Svn.PoolCreate(mPool); 
    115             int rev = Update(path, revision, recurse, pool); 
    116             return(rev); 
    117         } 
    118  
    119         public int Update(string path, int revision, bool recurse, AprPool pool) 
    120         { 
    121             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    122             optRev.Number = revision; 
    123             return Update(path, optRev, recurse, mContext, pool); 
    124         } 
    125          
    126         public int Update(string path, int revision, bool recurse) 
    127         { 
    128             AprPool pool = Svn.PoolCreate(mPool); 
    129             int rev = Update(path, revision, recurse, pool); 
    130             return(rev); 
    131         } 
    132  
    133         public int Update(string path, long revision, bool recurse, AprPool pool) 
    134         { 
    135             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    136             optRev.Date = revision; 
    137             return Update(path, optRev, recurse, mContext, pool); 
    138         } 
    139          
    140         public int Update(string path, long revision, bool recurse) 
    141         { 
    142             AprPool pool = Svn.PoolCreate(mPool); 
    143             int rev = Update(path, revision, recurse, pool); 
    144             return(rev); 
    145         } 
    146  
    147         #endregion 
    148          
    149         #region Switch methods 
    150         public int Switch(string path, string url,  
    151                           SvnOptRevision.RevisionKind revision, bool recurse, 
    152                           AprPool pool) 
    153         { 
    154             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    155             optRev.Kind = revision; 
    156             return Switch(path, url, optRev, recurse, mContext, pool); 
    157         } 
    158          
    159         public int Switch(string path, string url,  
    160                           SvnOptRevision.RevisionKind revision, bool recurse) 
    161         { 
    162             AprPool pool = Svn.PoolCreate(mPool); 
    163             int rev = Switch(path, url, revision, recurse, pool); 
    164             pool.Destroy(); 
    165             return(rev); 
    166         } 
    167  
    168         public int Switch(string path, string url, int revision, bool recurse, AprPool pool) 
    169         { 
    170             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    171             optRev.Number = revision; 
    172             return Switch(path, url, optRev, recurse, mContext, pool); 
    173         } 
    174          
    175         public int Switch(string path, string url, int revision, bool recurse) 
    176         { 
    177             AprPool pool = Svn.PoolCreate(mPool); 
    178             int rev = Switch(path, url, revision, recurse, pool); 
    179             pool.Destroy(); 
    180             return(rev); 
    181         } 
    182  
    183         public int Switch(string path, string url, long revision, bool recurse, AprPool pool) 
    184         { 
    185             SvnOptRevision optRev = SvnOptRevision.Alloc(pool); 
    186             optRev.Date = revision; 
    187             return Switch(path, url, optRev, recurse, mContext, pool); 
    188         } 
    189          
    190         public int Switch(string path, string url, long revision, bool recurse) 
    191         { 
    192             AprPool pool = Svn.PoolCreate(mPool); 
    193             int rev = Switch(path, url, revision, recurse, pool); 
    194             pool.Destroy(); 
    195             return(rev); 
    196         } 
    197         #endregion 
    198          
    199         #region Add method 
    200         public void Add(string path, bool recurse, AprPool pool) 
    201         { 
    202             Add(path, recurse, mContext, pool); 
     58        #region Methods 
     59        public void Clear() 
     60        { 
     61            mPool.Clear(); 
     62        } 
     63         
     64        public void Reset() 
     65        { 
     66            mPool.Destroy(); 
     67            mPool = Svn.PoolCreate(mGlobalPool); 
     68        } 
     69        #endregion 
     70         
     71        #region Client methods 
     72        public int Checkout(string url, string path, SvnRevision revision, bool recurse) 
     73        { 
     74            return Checkout(url, path, revision.ToSvnOpt(mPool), recurse,  
     75                            mContext, mPool); 
     76        } 
     77         
     78        public int Update(string path, SvnRevision revision, bool recurse) 
     79        { 
     80            return Update(path, revision.ToSvnOpt(mPool), recurse, 
     81                          mContext, mPool); 
     82        } 
     83         
     84        public int Switch(string path, string url, SvnRevision revision, bool recurse) 
     85        { 
     86            return Switch(path, url, revision.ToSvnOpt(mPool), recurse, 
     87                          mContext, mPool); 
    20388        } 
    20489         
    20590        public void Add(string path, bool recurse) 
    20691        { 
    207             AprPool pool = Svn.PoolCreate(mPool); 
    208             Add(path, recurse, mContext, pool); 
    209             pool.Destroy(); 
    210         } 
    211         #endregion 
    212          
    213         #region Mkdir methods 
    214         public SvnClientCommitInfo Mkdir(AprArray paths, AprPool pool) 
    215         { 
    216             return Mkdir(paths, mContext, pool); 
    217         } 
    218          
    219         public void Mkdir(AprArray paths) 
    220         { 
    221             AprPool pool = Svn.PoolCreate(mPool); 
    222             Mkdir(paths, mContext, pool); 
    223             pool.Destroy(); 
    224         } 
    225         #endregion 
    226          
    227         #region Delete methods 
    228         public SvnClientCommitInfo Delete(AprArray paths, bool force, AprPool pool) 
    229         { 
    230             return Delete(paths, force, mContext, pool); 
    231         } 
    232          
    233         public void Delete(AprArray paths, bool force) 
    234         { 
    235             AprPool pool = Svn.PoolCreate(mPool); 
    236             Delete(paths, force, mContext, pool); 
    237             pool.Destroy(); 
    238         } 
    239         #endregion 
    240          
    241         #region Import methods 
    242         public SvnClientCommitInfo Import(string path, string url, bool nonrecursive,   
    243                                           AprPool pool) 
    244         { 
    245             return Import(path, url, nonrecursive, mContext, pool); 
    246         } 
     92            Add(path, recurse, mContext, mPool); 
     93        } 
     94 
     95        public SvnClientCommitInfo Mkdir(ICollection paths) 
     96        { 
     97            return Mkdir(AprArray.Make(mPool,paths), mContext, mPool); 
     98        } 
     99         
     100        public SvnClientCommitInfo Delete(AprArray paths, bool force) 
     101        { 
     102            return Delete(paths, force, mContext, mPool); 
     103        } 
     104         
     105        public SvnClientCommitInfo Import(string path, string url, bool nonrecursive) 
     106        { 
     107            return Import(path, url, nonrecursive, mContext, mPool); 
     108        } 
     109         
     110        public SvnClientCommitInfo Commit(AprArray targets, bool nonrecursive, AprPool pool) 
     111        { 
     112            return Commit(targets, nonrecursive, mContext, mPool); 
     113        } 
     114         
     115        public int Status(string path, SvnRevision revision, 
     116                          SvnWcStatus.Func statusFunc, IntPtr statusBaton, 
     117                          bool descend, bool getAll, bool update, bool noIgnore) 
     118        { 
     119            return Status(path, revision.ToSvnOpt(mPool), statusFunc, statusBaton, 
     120                          descend, getAll, update, noIgnore, mContext, mPool); 
     121        } 
     122 
     123        public void Log(AprArray targets,  
     124                        SvnRevision start, SvnRevision end, 
     125                        bool discoverChangedPaths, bool strictNodeHistory, 
     126                        LogMessageReceiver receiver, IntPtr baton) 
     127        { 
     128            Log(targets,  
     129                start.ToSvnOpt(mPool), end.ToSvnOpt(mPool), 
     130                discoverChangedPaths, strictNodeHistory, receiver, baton, 
     131                mContext, mPool); 
     132        } 
     133 
     134        public void Blame(string pathOrUrl, 
     135                          SvnRevision start, SvnRevision end,  
     136                          BlameReceiver receiver, IntPtr baton) 
     137        { 
     138            Blame(pathOrUrl,  
     139                  start.ToSvnOpt(mPool), end.ToSvnOpt(mPool), 
     140                  receiver, baton, mContext, mPool); 
     141        } 
     142 
     143        public void Diff(AprArray diffOptions, 
     144                         string path1, SvnRevision revision1, 
     145                         string path2, SvnRevision revision2, 
     146                         bool recurse, bool ignoreAncestry, bool noDiffDeleted, 
     147                         AprFile outFile, AprFile errFile) 
     148        { 
     149            Diff(diffOptions, 
     150                 path1, revision1.ToSvnOpt(mPool), 
     151                 path2, revision2.ToSvnOpt(mPool), 
     152                 recurse, ignoreAncestry, noDiffDeleted, 
     153                 outFile, errFile, mContext, mPool); 
     154        } 
     155         
     156        public void Merge(string source1, SvnRevision revision1, 
     157                          string source2, SvnRevision revision2, 
     158                          string targetWCPath, bool recurse, 
     159                          bool ignoreAncestry, bool force, bool dryRun) 
     160        { 
     161            Merge(source1, revision1.ToSvnOpt(mPool), 
     162                  source2, revision2.ToSvnOpt(mPool), 
     163                  targetWCPath, recurse, ignoreAncestry, force, dryRun, mContext, mPool); 
     164        } 
     165         
     166        public void CleanUp(string dir) 
     167        { 
     168            CleanUp(dir, mContext, mPool); 
     169        } 
     170         
     171        public void Relocate(string dir, string from, string to, bool recurse) 
     172        { 
     173            Relocate(dir, from, to, recurse, mContext, mPool); 
     174        } 
     175         
     176        public void Revert(AprArray paths, bool recurse) 
     177        { 
     178            Revert(paths, recurse, mContext, mPool); 
     179        } 
     180         
     181        public void Resolved(string path, bool recurse) 
     182        { 
     183            Resolved(path, recurse, mContext, mPool); 
     184        } 
     185         
     186        public SvnClientCommitInfo Copy(string srcPath, SvnRevision srcRevision, string dstPath) 
     187        { 
     188            return Copy(srcPath, srcRevision.ToSvnOpt(mPool), dstPath, mContext, mPool); 
     189        } 
     190                                     
     191        public SvnClientCommitInfo Move(string srcPath, SvnRevision srcRevision, 
     192                                        string dstPath, bool force) 
     193        { 
     194            return Move(srcPath, srcRevision.ToSvnOpt(mPool), dstPath, force, 
     195                        mContext, mPool); 
     196        } 
     197         
     198        public void PropSet(string propName, SvnString propVal, string target, bool recurse)         
     199        { 
     200            PropSet(propName, propVal, target, recurse, mPool); 
     201        } 
     202         
     203        public int RevPropSet(string propName, SvnString propVal, 
     204                              string url, SvnRevision revision, bool force)      
     205        { 
     206            return RevPropSet(propName, propVal, url, revision.ToSvnOpt(mPool), force, 
     207                              mContext, mPool); 
     208        } 
     209         
     210        public AprHash PropGet(string propName, string target, 
     211                               SvnRevision revision, bool recurse)       
     212        { 
     213            return PropGet(propName, target, revision.ToSvnOpt(mPool), recurse, 
     214                           mContext, mPool); 
     215        } 
     216         
     217        public SvnString RevPropGet(string propName, string url, 
     218                                    SvnRevision revision, out int setRev)        
     219        { 
     220            return RevPropGet(propName, url, revision.ToSvnOpt(mPool), out setRev, 
     221                              mContext, mPool); 
     222        } 
     223         
     224        public AprHash PropList(string target, SvnRevision revision, bool recurse)       
     225        { 
     226            return PropList(target, revision.ToSvnOpt(mPool), recurse, mContext, mPool); 
     227        } 
     228         
     229        public AprHash RevPropList(string url, SvnRevision revision, out int setRev)         
     230        { 
     231            return RevPropList(url, revision.ToSvnOpt(mPool), out setRev, mContext, mPool); 
     232        } 
     233 
     234        public int Export(string from, string to, SvnRevision revision, bool force) 
     235        { 
     236            return Export(from, to, revision.ToSvnOpt(mPool), force, mContext, mPool); 
     237        } 
     238         
     239        public AprHash List(string pathOrUrl, SvnRevision revision, bool recurse)        
     240        { 
     241            return List(pathOrUrl, revision.ToSvnOpt(mPool), recurse, mContext, mPool); 
     242        } 
     243         
     244        public void Cat(SvnStream stream, string pathOrUrl, SvnRevision revision)        
     245        { 
     246            Cat(stream, pathOrUrl, revision.ToSvnOpt(mPool), mContext, mPool); 
     247        } 
     248         
     249        public AprString UrlFromPath(string pathOrUrl) 
     250        { 
     251            return UrlFromPath(pathOrUrl, mPool); 
     252        } 
     253         
     254        public AprString UuidFromUrl(string url) 
     255        { 
     256            return UuidFromUrl(url, mContext, mPool); 
     257        } 
     258 
    247259        #endregion 
    248260         
     
    252264            if( mAuthObjs == null ) 
    253265                mAuthObjs = new ArrayList(); 
    254             mAuthObjs.Add(SvnAuthProviderObject.GetSimpleProvider(mPool)); 
     266            mAuthObjs.Add(SvnAuthProviderObject.GetSimpleProvider(mGlobalPool)); 
    255267        } 
    256268         
     
    259271            if( mAuthObjs == null ) 
    260272                mAuthObjs = new ArrayList(); 
    261             mAuthObjs.Add(SvnAuthProviderObject.GetUsernameProvider(mPool)); 
     273            mAuthObjs.Add(SvnAuthProviderObject.GetUsernameProvider(mGlobalPool)); 
    262274        } 
    263275         
     
    266278            if( mAuthObjs == null ) 
    267279                mAuthObjs = new ArrayList(); 
    268             mAuthObjs.Add(SvnAuthProviderObject.GetSslServerTrustFileProvider(mPool)); 
     280            mAuthObjs.Add(SvnAuthProviderObject.GetSslServerTrustFileProvider(mGlobalPool)); 
    269281        } 
    270282         
     
    273285            if( mAuthObjs == null ) 
    274286                mAuthObjs = new ArrayList(); 
    275             mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertFileProvider(mPool)); 
     287            mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertFileProvider(mGlobalPool)); 
    276288        } 
    277289         
     
    280292            if( mAuthObjs == null ) 
    281293                mAuthObjs = new ArrayList(); 
    282             mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertPwFileProvider(mPool)); 
     294            mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertPwFileProvider(mGlobalPool)); 
    283295        } 
    284296 
     
    289301                mAuthObjs = new ArrayList(); 
    290302            mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton,  
    291                                                                   retryLimit, mPool)); 
     303                                                                  retryLimit, mGlobalPool)); 
    292304        } 
    293305 
     
    298310                mAuthObjs = new ArrayList(); 
    299311            mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton,  
    300                                                                   retryLimit, mPool)); 
     312                                                                  retryLimit, mGlobalPool)); 
    301313        } 
    302314 
     
    307319                mAuthObjs = new ArrayList(); 
    308320            mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton,  
    309                                                                   mPool)); 
     321                                                                  mGlobalPool)); 
    310322        } 
    311323 
     
    316328                mAuthObjs = new ArrayList(); 
    317329            mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton,  
    318                                                                   retryLimit, mPool)); 
     330                                                                  retryLimit, mGlobalPool)); 
    319331        } 
    320332 
     
    325337                mAuthObjs = new ArrayList(); 
    326338            mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton,  
    327                                                                   retryLimit, mPool)); 
     339                                                                  retryLimit, mGlobalPool)); 
    328340        } 
    329341         
     
    332344            if( mAuthObjs == null ) 
    333345                mAuthObjs = new ArrayList(); 
    334             mContext.AuthBaton = SvnAuthBaton.Open(mAuthObjs,mPool); 
     346            mContext.AuthBaton = SvnAuthBaton.Open(mAuthObjs,mGlobalPool); 
    335347            mAuthObjs = null; 
    336348        } 
     
    338350         
    339351        #region Member access throught properties 
     352        public AprPool GlobalPool 
     353        { 
     354            get 
     355            { 
     356                return(mGlobalPool); 
     357            } 
     358        } 
    340359        public AprPool Pool 
    341360        { 
  • trunk/SubversionSharp/dev/src/SvnClientBase.cs

    r42 r44  
    179179        } 
    180180         
    181         public static void Blame(string path_or_url, 
     181        public static void Blame(string pathOrUrl, 
    182182                                 SvnOptRevision start, SvnOptRevision end,  
    183183                                 BlameReceiver receiver, IntPtr baton, 
     
    185185        { 
    186186            SvnDelegate receiverDelegate = new SvnDelegate(receiver); 
    187             Debug.WriteLine(String.Format("svn_client_blame({0},{1},{2},{3},{4:X},{5},{6})",path_or_url,start,end,receiver.Method.Name,baton.ToInt32(),ctx,pool)); 
    188             SvnError err = Svn.svn_client_blame(path_or_url, start, end, 
     187            Debug.WriteLine(String.Format("svn_client_blame({0},{1},{2},{3},{4:X},{5},{6})",pathOrUrl,start,end,receiver.Method.Name,baton.ToInt32(),ctx,pool)); 
     188            SvnError err = Svn.svn_client_blame(pathOrUrl, start, end, 
    189189                                                (Svn.svn_client_blame_receiver_t)receiverDelegate.Wrapper, 
    190190                                                baton, 
  • trunk/SubversionSharp/dev/src/SvnClientCommitInfo.cs

    r31 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnClientCommitInfo 
     18    public unsafe class SvnClientCommitInfo : IAprUnmanaged 
    1919    { 
    2020        private svn_client_commit_info_t *mCommitInfo; 
     
    5858        } 
    5959 
     60        public IntPtr ToIntPtr() 
     61        { 
     62            return new IntPtr(mCommitInfo); 
     63        } 
     64         
    6065        public static implicit operator IntPtr(SvnClientCommitInfo commitInfo) 
    6166        { 
  • trunk/SubversionSharp/dev/src/SvnClientCommitItem.cs

    r31 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnClientCommitItem 
     18    public unsafe class SvnClientCommitItem : IAprUnmanaged 
    1919    { 
    2020        private svn_client_commit_item_t *mCommitItem; 
     
    6262        } 
    6363 
     64        public IntPtr ToIntPtr() 
     65        { 
     66            return new IntPtr(mCommitItem); 
     67        } 
     68         
    6469        public static implicit operator IntPtr(SvnClientCommitItem clientCommit) 
    6570        { 
  • trunk/SubversionSharp/dev/src/SvnClientContext.cs

    r31 r44  
    1717{ 
    1818 
    19     public unsafe class SvnClientContext 
     19    public unsafe class SvnClientContext : IAprUnmanaged 
    2020    { 
    2121        private svn_client_ctx_t *mClientContext; 
     
    2424        private SvnDelegate mLogMsgFunc; 
    2525        private SvnDelegate mCancelFunc; 
    26         private GCHandle mHandle; 
    2726 
    2827        [StructLayout( LayoutKind.Sequential )] 
     
    4746            mLogMsgFunc = SvnDelegate.NullFunc; 
    4847            mCancelFunc = SvnDelegate.NullFunc; 
    49             mHandle = new GCHandle(); 
    5048        } 
    5149         
     
    5755            mLogMsgFunc = SvnDelegate.NullFunc; 
    5856            mCancelFunc = SvnDelegate.NullFunc; 
    59             mHandle = new GCHandle(); 
    6057        } 
    6158         
     
    7976        } 
    8077 
     78        public IntPtr ToIntPtr() 
     79        { 
     80            return new IntPtr(mClientContext); 
     81        } 
     82         
    8183        public static implicit operator IntPtr(SvnClientContext clientContext) 
    8284        { 
  • trunk/SubversionSharp/dev/src/SvnClientPropListItem.cs

    r40 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnClientPropListItem 
     18    public unsafe class SvnClientPropListItem : IAprUnmanaged 
    1919    { 
    2020        private svn_client_proplist_item_t *mPropList; 
     
    5757        } 
    5858 
     59        public IntPtr ToIntPtr() 
     60        { 
     61            return new IntPtr(mPropList); 
     62        } 
     63         
    5964        public static implicit operator IntPtr(SvnClientPropListItem clientPropList) 
    6065        { 
  • trunk/SubversionSharp/dev/src/SvnConfig.cs

    r31 r44  
    1616{ 
    1717 
    18     public struct SvnConfig 
     18    public struct SvnConfig : IAprUnmanaged 
    1919    { 
    2020        IntPtr mConfig; 
     
    4545        } 
    4646 
     47        public IntPtr ToIntPtr() 
     48        { 
     49            return mConfig; 
     50        } 
     51         
    4752        public static implicit operator IntPtr(SvnConfig config) 
    4853        { 
  • trunk/SubversionSharp/dev/src/SvnDirEnt.cs

    r40 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnDirEnt 
     18    public unsafe class SvnDirEnt : IAprUnmanaged 
    1919    { 
    2020        private svn_dirent_t *mDirEnt; 
     
    6161        } 
    6262 
     63        public IntPtr ToIntPtr() 
     64        { 
     65            return new IntPtr(mDirEnt); 
     66        } 
     67         
    6368        public static implicit operator IntPtr(SvnDirEnt entry) 
    6469        { 
  • trunk/SubversionSharp/dev/src/SvnError.cs

    r31 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18    public unsafe class SvnError 
     18   public unsafe class SvnError : IAprUnmanaged 
    1919   { 
    2020        private svn_error_t *mError; 
     
    5252        } 
    5353 
     54        public bool IsNull 
     55        { 
     56            get 
     57            { 
     58                return( mError == null ); 
     59            } 
     60        } 
     61         
    5462        private void CheckPtr() 
    5563        { 
     
    6371        } 
    6472 
     73        public IntPtr ToIntPtr() 
     74        { 
     75            if( IsNoError ) 
     76                return IntPtr.Zero; 
     77            else 
     78                return new IntPtr(mError); 
     79        } 
     80         
    6581        public static implicit operator IntPtr(SvnError error) 
    6682        { 
  • trunk/SubversionSharp/dev/src/SvnOptRevision.cs

    r31 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnOptRevision 
     18    public class SvnRevision 
    1919    { 
    20         public enum RevisionKind { 
    21             Unspecified, 
    22             Number, 
    23             Date, 
    24             Committed, 
    25             Previous, 
    26             Base, 
    27             Working, 
    28             Head 
    29         } 
    30  
     20        Svn.Revision mKind; 
     21        int mNumber; 
     22        long mDate; 
     23         
     24        #region Ctors 
     25        public SvnRevision(Svn.Revision kind) 
     26        { 
     27            mKind = kind; 
     28            mNumber = 0; 
     29            mDate = 0; 
     30        } 
     31 
     32        public SvnRevision(int number) 
     33        { 
     34            mKind = Svn.Revision.Number; 
     35            mNumber = number; 
     36            mDate = 0; 
     37        } 
     38 
     39        public SvnRevision(long date) 
     40        { 
     41            mKind = Svn.Revision.Date; 
     42            mNumber = 0; 
     43            mDate = date; 
     44        } 
     45         
     46        public SvnRevision(SvnOptRevision rev) 
     47        { 
     48            mKind = rev.Kind; 
     49            if(mKind == Svn.Revision.Number) 
     50                mNumber = rev.Number; 
     51            else if(mKind == Svn.Revision.Date) 
     52                mDate = rev.Date; 
     53        } 
     54        #endregion 
     55 
     56        #region Operators 
     57        public static implicit operator SvnRevision(Svn.Revision revision) 
     58        { 
     59            return new SvnRevision(revision); 
     60        } 
     61         
     62        public static implicit operator SvnRevision(int revision) 
     63        { 
     64            return new SvnRevision(revision); 
     65        } 
     66         
     67        public static implicit operator SvnRevision(long revision) 
     68        { 
     69            return new SvnRevision(revision); 
     70        } 
     71         
     72        public static implicit operator SvnRevision(SvnOptRevision revision) 
     73        { 
     74            return new SvnRevision(revision); 
     75        } 
     76        #endregion 
     77         
     78        #region Methods 
     79        public SvnOptRevision ToSvnOpt(AprPool pool) 
     80        { 
     81            return(new SvnOptRevision(this,pool)); 
     82        } 
     83 
     84        public SvnOptRevision ToSvnOpt(out GCHandle handle) 
     85        { 
     86            return(new SvnOptRevision(this, out handle)); 
     87        } 
     88        #endregion 
     89 
     90        #region Properties 
     91        public Svn.Revision Kind 
     92        { 
     93            get 
     94            { 
     95                return(mKind); 
     96            } 
     97            set 
     98            { 
     99                mKind = value; 
     100            } 
     101        }  
     102 
     103        public int Number 
     104        { 
     105            get 
     106            { 
     107                if( mKind != Svn.Revision.Number ) 
     108                    throw new AprNullReferenceException();  
     109                return(mNumber); 
     110            } 
     111            set 
     112            { 
     113                mKind = Svn.Revision.Number; 
     114                mNumber = value; 
     115            } 
     116        } 
     117 
     118        public long Date 
     119        { 
     120            get 
     121            { 
     122                if( mKind != Svn.Revision.Date ) 
     123                    throw new AprNullReferenceException();  
     124                return(mDate); 
     125            } 
     126            set 
     127            { 
     128                mKind = Svn.Revision.Date; 
     129                mDate = value; 
     130            } 
     131        } 
     132 
     133        public SvnOptRevision Revision 
     134        { 
     135            set 
     136            { 
     137                mKind = value.Kind; 
     138                if(mKind == Svn.Revision.Number) 
     139                    mNumber = value.Number; 
     140                else if(mKind == Svn.Revision.Date) 
     141                    mDate = value.Date; 
     142            } 
     143        } 
     144        #endregion 
     145    } 
     146     
     147    public unsafe struct SvnOptRevision : IAprUnmanaged 
     148    { 
    31149        private svn_opt_revision_t *mOptRevision; 
    32150 
     
    50168        } 
    51169         
     170        public SvnOptRevision(AprPool pool) 
     171        { 
     172            mOptRevision = (svn_opt_revision_t *) pool.CAlloc(sizeof(svn_opt_revision_t)); 
     173        } 
     174         
     175        public SvnOptRevision(Svn.Revision revKind, AprPool pool) 
     176        { 
     177            mOptRevision = (svn_opt_revision_t *) pool.CAlloc(sizeof(svn_opt_revision_t)); 
     178            Kind = revKind; 
     179        } 
     180 
     181        public SvnOptRevision(int revNum, AprPool pool) 
     182        { 
     183            mOptRevision = (svn_opt_revision_t *) pool.CAlloc(sizeof(svn_opt_revision_t)); 
     184            Number = revNum; 
     185        } 
     186         
     187        public SvnOptRevision(long revDate, AprPool pool) 
     188        { 
     189            mOptRevision = (svn_opt_revision_t *) pool.CAlloc(sizeof(svn_opt_revision_t)); 
     190            Date = revDate; 
     191        } 
     192 
     193        public SvnOptRevision(SvnRevision rev, AprPool pool) 
     194        { 
     195            mOptRevision = (svn_opt_revision_t *) pool.CAlloc(sizeof(svn_opt_revision_t)); 
     196            Revision = rev; 
     197        } 
     198         
    52199        public SvnOptRevision(out GCHandle handle) 
    53200        { 
    54201            handle = GCHandle.Alloc(new svn_opt_revision_t(),GCHandleType.Pinned); 
    55202            mOptRevision = (svn_opt_revision_t *)handle.AddrOfPinnedObject().ToPointer(); 
     203        } 
     204         
     205        public SvnOptRevision(Svn.Revision revKind, out GCHandle handle) 
     206        { 
     207            handle = GCHandle.Alloc(new svn_opt_revision_t(),GCHandleType.Pinned); 
     208            mOptRevision = (svn_opt_revision_t *)handle.AddrOfPinnedObject().ToPointer(); 
     209            Kind = revKind; 
     210        } 
     211         
     212        public SvnOptRevision(int revNum, out GCHandle handle) 
     213        { 
     214            handle = GCHandle.Alloc(new svn_opt_revision_t(),GCHandleType.Pinned); 
     215            mOptRevision = (svn_opt_revision_t *)handle.AddrOfPinnedObject().ToPointer(); 
     216            Number = revNum; 
     217        } 
     218         
     219        public SvnOptRevision(long revDate, out GCHandle handle) 
     220        { 
     221            handle = GCHandle.Alloc(new svn_opt_revision_t(),GCHandleType.Pinned); 
     222            mOptRevision = (svn_opt_revision_t *)handle.AddrOfPinnedObject().ToPointer(); 
     223            Date = revDate; 
     224        } 
     225         
     226        public SvnOptRevision(SvnRevision rev, out GCHandle handle) 
     227        { 
     228            handle = GCHandle.Alloc(new svn_opt_revision_t(),GCHandleType.Pinned); 
     229            mOptRevision = (svn_opt_revision_t *)handle.AddrOfPinnedObject().ToPointer(); 
     230            Revision = rev; 
    56231        } 
    57232         
     
    75250        } 
    76251 
     252        public IntPtr ToIntPtr() 
     253        { 
     254            return new IntPtr(mOptRevision); 
     255        } 
     256         
    77257        public static implicit operator IntPtr(SvnOptRevision revision) 
    78258        { 
     
    92272         
    93273        #region Properties wrappers 
    94         public static SvnOptRevision Alloc(AprPool pool) 
    95         { 
    96             return(new SvnOptRevision((svn_opt_revision_t *)pool.CAlloc(sizeof(svn_opt_revision_t)))); 
    97         } 
    98  
    99         public static SvnOptRevision Alloc(out GCHandle handle) 
    100         { 
    101             return(new SvnOptRevision(out handle)); 
    102         } 
    103         #endregion 
    104  
    105          
    106         #region Properties wrappers 
    107         public RevisionKind Kind 
    108         { 
    109             get 
    110             { 
    111                 CheckPtr(); 
    112                 return((RevisionKind)mOptRevision->kind); 
     274        public Svn.Revision Kind 
     275        { 
     276            get 
     277            { 
     278                CheckPtr(); 
     279                return((Svn.Revision)mOptRevision->kind); 
    113280            } 
    114281            set 
     
    124291            { 
    125292                CheckPtr(); 
    126                 if( (RevisionKind) mOptRevision->kind != RevisionKind.Number ) 
     293                if( (Svn.Revision) mOptRevision->kind != Svn.Revision.Number ) 
    127294                    throw new AprNullReferenceException();  
    128295                return(mOptRevision->number); 
     
    131298            { 
    132299                CheckPtr(); 
    133                 mOptRevision->kind = (int) RevisionKind.Number;  
     300                mOptRevision->kind = (int) Revision.Number;  
    134301                mOptRevision->number = value; 
    135302            } 
     
    141308            { 
    142309                CheckPtr(); 
    143                 if( (RevisionKind) mOptRevision->kind != RevisionKind.Date ) 
     310                if((Svn.Revision)mOptRevision->kind != Svn.Revision.Date ) 
    144311                    throw new AprNullReferenceException();  
    145312                return(mOptRevision->date); 
     
    148315            { 
    149316                CheckPtr(); 
    150                 mOptRevision->kind = (int) RevisionKind.Date;  
     317                mOptRevision->kind = (int) Revision.Date;  
    151318                mOptRevision->date = value; 
     319            } 
     320        } 
     321         
     322        public SvnRevision Revision 
     323        { 
     324            get 
     325            { 
     326                CheckPtr(); 
     327                return(new SvnRevision(this)); 
     328            } 
     329            set 
     330            { 
     331                CheckPtr(); 
     332                mOptRevision->kind = (int) value.Kind; 
     333                if((Svn.Revision)mOptRevision->kind == Svn.Revision.Number) 
     334                    mOptRevision->number = value.Number; 
     335                else if((Svn.Revision)mOptRevision->kind == Svn.Revision.Date) 
     336                    mOptRevision->date = value.Date; 
    152337            } 
    153338        } 
  • trunk/SubversionSharp/dev/src/SvnStream.cs

    r40 r44  
    1515namespace Softec.SubversionSharp 
    1616{ 
    17     public struct SvnStream 
     17    public struct SvnStream : IAprUnmanaged 
    1818    { 
    1919        public delegate SvnError ReadFunc(IntPtr baton, IntPtr buffer, ref int len); 
     
    7070        } 
    7171 
     72        public IntPtr ToIntPtr() 
     73        { 
     74            return mStream; 
     75        } 
     76         
    7277        public static implicit operator IntPtr(SvnStream stream) 
    7378        { 
  • trunk/SubversionSharp/dev/src/SvnString.cs

    r40 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnString 
     18    public unsafe class SvnString : IAprUnmanaged 
    1919    { 
    2020        private svn_string_t *mString; 
     
    101101        } 
    102102 
     103        public IntPtr ToIntPtr() 
     104        { 
     105            return new IntPtr(mString); 
     106        } 
     107         
    103108        public static implicit operator IntPtr(SvnString str) 
    104109        { 
  • trunk/SubversionSharp/dev/src/SvnStringBuf.cs

    r40 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnStringBuf 
     18    public unsafe class SvnStringBuf : IAprUnmanaged 
    1919    { 
    2020        private svn_stringbuf_t *mStringBuf; 
     
    103103        } 
    104104 
     105        public IntPtr ToIntPtr() 
     106        { 
     107            return new IntPtr(mStringBuf); 
     108        } 
     109         
    105110        public static implicit operator IntPtr(SvnStringBuf str) 
    106111        { 
  • trunk/SubversionSharp/dev/src/SvnWcEntry.cs

    r38 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnWcEntry 
     18    public unsafe class SvnWcEntry : IAprUnmanaged 
    1919    { 
    2020        public enum WcSchedule { 
     
    8585        } 
    8686 
     87        public IntPtr ToIntPtr() 
     88        { 
     89            return new IntPtr(mEntry); 
     90        } 
     91         
    8792        public static implicit operator IntPtr(SvnWcEntry entry) 
    8893        { 
  • trunk/SubversionSharp/dev/src/SvnWcStatus.cs

    r36 r44  
    1616namespace Softec.SubversionSharp 
    1717{ 
    18     public unsafe class SvnWcStatus 
     18    public unsafe class SvnWcStatus : IAprUnmanaged 
    1919    { 
    2020        public delegate void Func(IntPtr baton, AprString path, SvnWcStatus status); 
     
    8282        } 
    8383 
     84        public IntPtr ToIntPtr() 
     85        { 
     86            return new IntPtr(mStatus); 
     87        } 
     88         
    8489        public static implicit operator IntPtr(SvnWcStatus status) 
    8590        { 
  • trunk/SubversionSharp/test/src/Main.cs

    r42 r44  
    3636         
    3737        client.Checkout("https://www.softec.st/svn/test",  
    38                         "/home/denisg/dev/lib/SubversionSharp/test/bin/Debug/test", 
     38                        "test", 
    3939                        100, true); 
    40         client.Update("/home/denisg/dev/lib/SubversionSharp/test/bin/Debug/test", 
    41                       SvnOptRevision.RevisionKind.Head, true); 
     40        client.Update("test", 
     41                      Svn.Revision.Head, true); 
    4242 
    4343        client.Pool.Destroy();