Changeset 44
- Timestamp:
- 07/02/04 02:49:43
- Files:
-
- trunk/SubversionSharp/dev/src/Svn.cs (modified) (1 diff)
- trunk/SubversionSharp/dev/src/SvnAuthBaton.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnAuthCred.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnAuthProvider.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnAuthSslServerCertInfo.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnClient.cs (modified) (17 diffs)
- trunk/SubversionSharp/dev/src/SvnClientBase.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnClientCommitInfo.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnClientCommitItem.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnClientContext.cs (modified) (5 diffs)
- trunk/SubversionSharp/dev/src/SvnClientPropListItem.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnConfig.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnDirEnt.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnError.cs (modified) (3 diffs)
- trunk/SubversionSharp/dev/src/SvnOptRevision.cs (modified) (8 diffs)
- trunk/SubversionSharp/dev/src/SvnStream.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnString.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnStringBuf.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnWcEntry.cs (modified) (2 diffs)
- trunk/SubversionSharp/dev/src/SvnWcStatus.cs (modified) (2 diffs)
- trunk/SubversionSharp/test/src/Main.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SubversionSharp/dev/src/Svn.cs
r40 r44 31 31 } 32 32 33 public enum Revision { 34 Unspecified, 35 Number, 36 Date, 37 Committed, 38 Previous, 39 Base, 40 Working, 41 Head 42 } 33 43 34 44 internal delegate IntPtr svn_cancel_func_t(IntPtr baton); trunk/SubversionSharp/dev/src/SvnAuthBaton.cs
r40 r44 17 17 namespace Softec.SubversionSharp 18 18 { 19 public struct SvnAuthBaton 19 public struct SvnAuthBaton : IAprUnmanaged 20 20 { 21 21 public enum Param { … … 103 103 } 104 104 105 public static implicit operator IntPtr(SvnAuthBaton authProviderObject)105 public IntPtr ToIntPtr() 106 106 { 107 return authProviderObject.mAuthBaton; 107 return mAuthBaton; 108 } 109 110 public static implicit operator IntPtr(SvnAuthBaton authBaton) 111 { 112 return authBaton.mAuthBaton; 108 113 } 109 114 trunk/SubversionSharp/dev/src/SvnAuthCred.cs
r31 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe struct SvnAuthCredSimple 18 public unsafe struct SvnAuthCredSimple : IAprUnmanaged 19 19 { 20 20 private svn_auth_cred_simple_t *mCred; … … 58 58 } 59 59 60 public IntPtr ToIntPtr() 61 { 62 return new IntPtr(mCred); 63 } 64 60 65 public static implicit operator IntPtr(SvnAuthCredSimple cred) 61 66 { trunk/SubversionSharp/dev/src/SvnAuthProvider.cs
r31 r44 15 15 namespace Softec.SubversionSharp 16 16 { 17 public struct SvnAuthProviderObject 17 public struct SvnAuthProviderObject : IAprUnmanaged 18 18 { 19 19 private IntPtr mAuthProviderObject; … … 52 52 } 53 53 54 public IntPtr ToIntPtr() 55 { 56 return mAuthProviderObject; 57 } 58 54 59 public static implicit operator IntPtr(SvnAuthProviderObject authProviderObject) 55 60 { trunk/SubversionSharp/dev/src/SvnAuthSslServerCertInfo.cs
r31 r44 17 17 { 18 18 19 public unsafe struct SvnAuthSslServerCertInfo 19 public unsafe struct SvnAuthSslServerCertInfo : IAprUnmanaged 20 20 { 21 21 private svn_auth_ssl_server_cert_info *mSslServerCertInfo; … … 62 62 } 63 63 64 public IntPtr ToIntPtr() 65 { 66 return new IntPtr(mSslServerCertInfo); 67 } 68 64 69 public static implicit operator IntPtr(SvnAuthSslServerCertInfo clientContext) 65 70 { trunk/SubversionSharp/dev/src/SvnClient.cs
r42 r44 18 18 public class SvnClient : SvnClientBase 19 19 { 20 AprPool mGlobalPool; 20 21 AprPool mPool; 21 22 SvnClientContext mContext; 22 23 ArrayList mAuthObjs; 23 24 24 #region ctors 25 #region ctors and finalize 25 26 static SvnClient() 26 27 { … … 30 31 public SvnClient() 31 32 { 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); 35 37 mAuthObjs = null; 36 38 } … … 38 40 public SvnClient(AprPool pool) 39 41 { 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); 43 46 mAuthObjs = null; 44 47 } … … 46 49 public SvnClient(SvnClientContext ctx, AprPool pool) 47 50 { 48 mPool = pool; 51 mGlobalPool = pool; 52 mPool = Svn.PoolCreate(mGlobalPool); 49 53 mContext = ctx; 50 54 mAuthObjs = null; … … 52 56 #endregion 53 57 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); 203 88 } 204 89 205 90 public void Add(string path, bool recurse) 206 91 { 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 247 259 #endregion 248 260 … … 252 264 if( mAuthObjs == null ) 253 265 mAuthObjs = new ArrayList(); 254 mAuthObjs.Add(SvnAuthProviderObject.GetSimpleProvider(m Pool));266 mAuthObjs.Add(SvnAuthProviderObject.GetSimpleProvider(mGlobalPool)); 255 267 } 256 268 … … 259 271 if( mAuthObjs == null ) 260 272 mAuthObjs = new ArrayList(); 261 mAuthObjs.Add(SvnAuthProviderObject.GetUsernameProvider(m Pool));273 mAuthObjs.Add(SvnAuthProviderObject.GetUsernameProvider(mGlobalPool)); 262 274 } 263 275 … … 266 278 if( mAuthObjs == null ) 267 279 mAuthObjs = new ArrayList(); 268 mAuthObjs.Add(SvnAuthProviderObject.GetSslServerTrustFileProvider(m Pool));280 mAuthObjs.Add(SvnAuthProviderObject.GetSslServerTrustFileProvider(mGlobalPool)); 269 281 } 270 282 … … 273 285 if( mAuthObjs == null ) 274 286 mAuthObjs = new ArrayList(); 275 mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertFileProvider(m Pool));287 mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertFileProvider(mGlobalPool)); 276 288 } 277 289 … … 280 292 if( mAuthObjs == null ) 281 293 mAuthObjs = new ArrayList(); 282 mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertPwFileProvider(m Pool));294 mAuthObjs.Add(SvnAuthProviderObject.GetSslClientCertPwFileProvider(mGlobalPool)); 283 295 } 284 296 … … 289 301 mAuthObjs = new ArrayList(); 290 302 mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton, 291 retryLimit, m Pool));303 retryLimit, mGlobalPool)); 292 304 } 293 305 … … 298 310 mAuthObjs = new ArrayList(); 299 311 mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton, 300 retryLimit, m Pool));312 retryLimit, mGlobalPool)); 301 313 } 302 314 … … 307 319 mAuthObjs = new ArrayList(); 308 320 mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton, 309 m Pool));321 mGlobalPool)); 310 322 } 311 323 … … 316 328 mAuthObjs = new ArrayList(); 317 329 mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton, 318 retryLimit, m Pool));330 retryLimit, mGlobalPool)); 319 331 } 320 332 … … 325 337 mAuthObjs = new ArrayList(); 326 338 mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton, 327 retryLimit, m Pool));339 retryLimit, mGlobalPool)); 328 340 } 329 341 … … 332 344 if( mAuthObjs == null ) 333 345 mAuthObjs = new ArrayList(); 334 mContext.AuthBaton = SvnAuthBaton.Open(mAuthObjs,m Pool);346 mContext.AuthBaton = SvnAuthBaton.Open(mAuthObjs,mGlobalPool); 335 347 mAuthObjs = null; 336 348 } … … 338 350 339 351 #region Member access throught properties 352 public AprPool GlobalPool 353 { 354 get 355 { 356 return(mGlobalPool); 357 } 358 } 340 359 public AprPool Pool 341 360 { trunk/SubversionSharp/dev/src/SvnClientBase.cs
r42 r44 179 179 } 180 180 181 public static void Blame(string path _or_url,181 public static void Blame(string pathOrUrl, 182 182 SvnOptRevision start, SvnOptRevision end, 183 183 BlameReceiver receiver, IntPtr baton, … … 185 185 { 186 186 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, 189 189 (Svn.svn_client_blame_receiver_t)receiverDelegate.Wrapper, 190 190 baton, trunk/SubversionSharp/dev/src/SvnClientCommitInfo.cs
r31 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnClientCommitInfo 18 public unsafe class SvnClientCommitInfo : IAprUnmanaged 19 19 { 20 20 private svn_client_commit_info_t *mCommitInfo; … … 58 58 } 59 59 60 public IntPtr ToIntPtr() 61 { 62 return new IntPtr(mCommitInfo); 63 } 64 60 65 public static implicit operator IntPtr(SvnClientCommitInfo commitInfo) 61 66 { trunk/SubversionSharp/dev/src/SvnClientCommitItem.cs
r31 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnClientCommitItem 18 public unsafe class SvnClientCommitItem : IAprUnmanaged 19 19 { 20 20 private svn_client_commit_item_t *mCommitItem; … … 62 62 } 63 63 64 public IntPtr ToIntPtr() 65 { 66 return new IntPtr(mCommitItem); 67 } 68 64 69 public static implicit operator IntPtr(SvnClientCommitItem clientCommit) 65 70 { trunk/SubversionSharp/dev/src/SvnClientContext.cs
r31 r44 17 17 { 18 18 19 public unsafe class SvnClientContext 19 public unsafe class SvnClientContext : IAprUnmanaged 20 20 { 21 21 private svn_client_ctx_t *mClientContext; … … 24 24 private SvnDelegate mLogMsgFunc; 25 25 private SvnDelegate mCancelFunc; 26 private GCHandle mHandle;27 26 28 27 [StructLayout( LayoutKind.Sequential )] … … 47 46 mLogMsgFunc = SvnDelegate.NullFunc; 48 47 mCancelFunc = SvnDelegate.NullFunc; 49 mHandle = new GCHandle();50 48 } 51 49 … … 57 55 mLogMsgFunc = SvnDelegate.NullFunc; 58 56 mCancelFunc = SvnDelegate.NullFunc; 59 mHandle = new GCHandle();60 57 } 61 58 … … 79 76 } 80 77 78 public IntPtr ToIntPtr() 79 { 80 return new IntPtr(mClientContext); 81 } 82 81 83 public static implicit operator IntPtr(SvnClientContext clientContext) 82 84 { trunk/SubversionSharp/dev/src/SvnClientPropListItem.cs
r40 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnClientPropListItem 18 public unsafe class SvnClientPropListItem : IAprUnmanaged 19 19 { 20 20 private svn_client_proplist_item_t *mPropList; … … 57 57 } 58 58 59 public IntPtr ToIntPtr() 60 { 61 return new IntPtr(mPropList); 62 } 63 59 64 public static implicit operator IntPtr(SvnClientPropListItem clientPropList) 60 65 { trunk/SubversionSharp/dev/src/SvnConfig.cs
r31 r44 16 16 { 17 17 18 public struct SvnConfig 18 public struct SvnConfig : IAprUnmanaged 19 19 { 20 20 IntPtr mConfig; … … 45 45 } 46 46 47 public IntPtr ToIntPtr() 48 { 49 return mConfig; 50 } 51 47 52 public static implicit operator IntPtr(SvnConfig config) 48 53 { trunk/SubversionSharp/dev/src/SvnDirEnt.cs
r40 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnDirEnt 18 public unsafe class SvnDirEnt : IAprUnmanaged 19 19 { 20 20 private svn_dirent_t *mDirEnt; … … 61 61 } 62 62 63 public IntPtr ToIntPtr() 64 { 65 return new IntPtr(mDirEnt); 66 } 67 63 68 public static implicit operator IntPtr(SvnDirEnt entry) 64 69 { trunk/SubversionSharp/dev/src/SvnError.cs
r31 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnError 18 public unsafe class SvnError : IAprUnmanaged 19 19 { 20 20 private svn_error_t *mError; … … 52 52 } 53 53 54 public bool IsNull 55 { 56 get 57 { 58 return( mError == null ); 59 } 60 } 61 54 62 private void CheckPtr() 55 63 { … … 63 71 } 64 72 73 public IntPtr ToIntPtr() 74 { 75 if( IsNoError ) 76 return IntPtr.Zero; 77 else 78 return new IntPtr(mError); 79 } 80 65 81 public static implicit operator IntPtr(SvnError error) 66 82 { trunk/SubversionSharp/dev/src/SvnOptRevision.cs
r31 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnOptRevision18 public class SvnRevision 19 19 { 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 { 31 149 private svn_opt_revision_t *mOptRevision; 32 150 … … 50 168 } 51 169 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 52 199 public SvnOptRevision(out GCHandle handle) 53 200 { 54 201 handle = GCHandle.Alloc(new svn_opt_revision_t(),GCHandleType.Pinned); 55 202 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; 56 231 } 57 232 … … 75 250 } 76 251 252 public IntPtr ToIntPtr() 253 { 254 return new IntPtr(mOptRevision); 255 } 256 77 257 public static implicit operator IntPtr(SvnOptRevision revision) 78 258 { … … 92 272 93 273 #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); 113 280 } 114 281 set … … 124 291 { 125 292 CheckPtr(); 126 if( ( RevisionKind) mOptRevision->kind != RevisionKind.Number )293 if( (Svn.Revision) mOptRevision->kind != Svn.Revision.Number ) 127 294 throw new AprNullReferenceException(); 128 295 return(mOptRevision->number); … … 131 298 { 132 299 CheckPtr(); 133 mOptRevision->kind = (int) Revision Kind.Number;300 mOptRevision->kind = (int) Revision.Number; 134 301 mOptRevision->number = value; 135 302 } … … 141 308 { 142 309 CheckPtr(); 143 if( (RevisionKind) mOptRevision->kind != RevisionKind.Date )310 if((Svn.Revision)mOptRevision->kind != Svn.Revision.Date ) 144 311 throw new AprNullReferenceException(); 145 312 return(mOptRevision->date); … … 148 315 { 149 316 CheckPtr(); 150 mOptRevision->kind = (int) Revision Kind.Date;317 mOptRevision->kind = (int) Revision.Date; 151 318 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; 152 337 } 153 338 } trunk/SubversionSharp/dev/src/SvnStream.cs
r40 r44 15 15 namespace Softec.SubversionSharp 16 16 { 17 public struct SvnStream 17 public struct SvnStream : IAprUnmanaged 18 18 { 19 19 public delegate SvnError ReadFunc(IntPtr baton, IntPtr buffer, ref int len); … … 70 70 } 71 71 72 public IntPtr ToIntPtr() 73 { 74 return mStream; 75 } 76 72 77 public static implicit operator IntPtr(SvnStream stream) 73 78 { trunk/SubversionSharp/dev/src/SvnString.cs
r40 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnString 18 public unsafe class SvnString : IAprUnmanaged 19 19 { 20 20 private svn_string_t *mString; … … 101 101 } 102 102 103 public IntPtr ToIntPtr() 104 { 105 return new IntPtr(mString); 106 } 107 103 108 public static implicit operator IntPtr(SvnString str) 104 109 { trunk/SubversionSharp/dev/src/SvnStringBuf.cs
r40 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnStringBuf 18 public unsafe class SvnStringBuf : IAprUnmanaged 19 19 { 20 20 private svn_stringbuf_t *mStringBuf; … … 103 103 } 104 104 105 public IntPtr ToIntPtr() 106 { 107 return new IntPtr(mStringBuf); 108 } 109 105 110 public static implicit operator IntPtr(SvnStringBuf str) 106 111 { trunk/SubversionSharp/dev/src/SvnWcEntry.cs
r38 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnWcEntry 18 public unsafe class SvnWcEntry : IAprUnmanaged 19 19 { 20 20 public enum WcSchedule { … … 85 85 } 86 86 87 public IntPtr ToIntPtr() 88 { 89 return new IntPtr(mEntry); 90 } 91 87 92 public static implicit operator IntPtr(SvnWcEntry entry) 88 93 { trunk/SubversionSharp/dev/src/SvnWcStatus.cs
r36 r44 16 16 namespace Softec.SubversionSharp 17 17 { 18 public unsafe class SvnWcStatus 18 public unsafe class SvnWcStatus : IAprUnmanaged 19 19 { 20 20 public delegate void Func(IntPtr baton, AprString path, SvnWcStatus status); … … 82 82 } 83 83 84 public IntPtr ToIntPtr() 85 { 86 return new IntPtr(mStatus); 87 } 88 84 89 public static implicit operator IntPtr(SvnWcStatus status) 85 90 { trunk/SubversionSharp/test/src/Main.cs
r42 r44 36 36 37 37 client.Checkout("https://www.softec.st/svn/test", 38 " /home/denisg/dev/lib/SubversionSharp/test/bin/Debug/test",38 "test", 39 39 100, true); 40 client.Update(" /home/denisg/dev/lib/SubversionSharp/test/bin/Debug/test",41 Svn OptRevision.RevisionKind.Head, true);40 client.Update("test", 41 Svn.Revision.Head, true); 42 42 43 43 client.Pool.Destroy();