Changeset 33

Show
Ignore:
Timestamp:
06/29/04 23:15:36
Author:
DenisG
Message:

[SubversionSharp] Add more client function

- Add structure SvnWcStatus? and SvnWcEntry? for Status method
- Mkdir, Delete, Import and Commit methods
- Add all DllImports? for svn_client_* function

Files:

Legend:

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

    r31 r33  
    1818    <File name="./SvnClientCommitInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
    1919    <File name="./SvnClientCommitItem.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
     20    <File name="./SvnWcStatus.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
     21    <File name="./SvnWcEntry.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
    2022  </Contents> 
    2123  <References> 
  • trunk/SubversionSharp/dev/src/Svn.cs

    r31 r33  
    6666        public static AprPool PoolCreate(AprPool pool, AprAllocator allocator) 
    6767        { 
    68             return(AprPool.Create(pool, allocator)); 
     68            AprPool newpool = AprPool.Create(pool, allocator); 
     69            allocator.Owner = pool; 
     70            return(newpool); 
    6971        } 
    7072        #endregion 
     
    179181                                                              
    180182        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
    181         internal IntPtr svn_client_checkout(out int result_rev, string URL,  
     183        internal IntPtr svn_client_checkout(out uint result_rev, string URL,  
    182184                                            string path, IntPtr revision, int recurse,  
    183185                                            IntPtr ctx, IntPtr pool); 
    184186                                             
    185187        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
    186         internal IntPtr svn_client_update (out int result_rev, string path,  
     188        internal IntPtr svn_client_update (out uint result_rev, string path,  
    187189                                           IntPtr revision, int recurse, 
    188190                                           IntPtr ctx, IntPtr pool); 
    189191         
    190192        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
    191         internal IntPtr svn_client_switch(out int result_rev, string path, string url,  
     193        internal IntPtr svn_client_switch(out uint result_rev, string path, string url,  
    192194                                          IntPtr revision, int recurse,  
    193195                                          IntPtr ctx, IntPtr pool); 
     
    196198        internal IntPtr svn_client_add(string path, int recursive,  
    197199                                       IntPtr ctx, IntPtr pool); 
     200         
     201        [DllImport("svn_client-1")] static extern 
     202        internal IntPtr svn_client_mkdir(out IntPtr commit_info, IntPtr paths, 
     203                                         IntPtr ctx, IntPtr pool); 
     204         
     205        [DllImport("svn_client-1")] static extern 
     206        internal IntPtr svn_client_delete(out IntPtr commit_info, IntPtr paths, int force,  
     207                                          IntPtr ctx, IntPtr pool); 
     208 
     209        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     210        internal IntPtr svn_client_import(out IntPtr commit_info,  
     211                                          string path, string url, int nonrecursive,  
     212                                          IntPtr ctx, IntPtr pool); 
     213 
     214        [DllImport("svn_client-1")] static extern 
     215        internal IntPtr svn_client_commit(out IntPtr commit_info,  
     216                                          IntPtr targets, int nonrecursive, 
     217                                          IntPtr ctx, IntPtr pool); 
     218 
     219        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     220        internal IntPtr svn_client_status(out uint result_rev,  
     221                                          string path, IntPtr revision, 
     222                                          IntPtr status_func, IntPtr status_baton,  
     223                                          int descend, int get_all, int update, int no_ignore,  
     224                                          IntPtr ctx, IntPtr pool); 
     225 
     226        [DllImport("svn_client-1")] static extern 
     227        internal IntPtr svn_client_log(IntPtr targets, IntPtr start, IntPtr end, 
     228                                       int discover_changed_paths, int strict_node_history,  
     229                                       IntPtr receiver, IntPtr receiver_baton,  
     230                                       IntPtr ctx, IntPtr pool); 
     231     
     232        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     233        internal IntPtr svn_client_blame(string path_or_url, IntPtr start, IntPtr end,  
     234                                         IntPtr receiver, IntPtr receiver_baton,  
     235                                         IntPtr ctx, IntPtr pool); 
     236 
     237        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     238        internal IntPtr svn_client_diff(IntPtr diff_options,  
     239                                        string path1, IntPtr revision1,  
     240                                        string path2, IntPtr revision2,  
     241                                        int recurse, int ignore_ancestry, int no_diff_deleted,  
     242                                        IntPtr outfile, IntPtr errfile,  
     243                                        IntPtr ctx, IntPtr pool); 
     244 
     245        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     246        internal IntPtr svn_client_merge(string source1, IntPtr revision1,  
     247                                         string source2, IntPtr revision2, 
     248                                         string target_wcpath,  
     249                                         int recurse, int ignore_ancestry, int force, int dry_run,  
     250                                         IntPtr ctx, IntPtr pool); 
     251         
     252        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     253        internal IntPtr svn_client_cleanup(string dir, IntPtr ctx, IntPtr pool); 
     254 
     255        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     256        internal IntPtr svn_client_relocate(string dir,  
     257                                            string from, string to, int recurse,  
     258                                            IntPtr ctx, IntPtr pool); 
     259 
     260        [DllImport("svn_client-1")] static extern 
     261        internal IntPtr svn_client_revert(IntPtr paths, int recursive, IntPtr ctx, IntPtr pool); 
     262 
     263        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     264        internal IntPtr svn_client_resolved(string path, int recursive, IntPtr ctx, IntPtr pool); 
     265 
     266        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     267        internal IntPtr svn_client_copy(out IntPtr commit_info,  
     268                                        string src_path, IntPtr src_revision,  
     269                                        string dst_path,  
     270                                        IntPtr ctx, IntPtr pool); 
     271 
     272        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     273        internal IntPtr svn_client_move(out IntPtr commit_info,  
     274                                        string src_path, IntPtr src_revision,  
     275                                        string dst_path, int force,  
     276                                        IntPtr ctx, IntPtr pool); 
     277 
     278        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     279        internal IntPtr svn_client_propset(string propname, IntPtr propval, string target,  
     280                                           int recurse, 
     281                                           IntPtr pool); 
     282 
     283        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     284        internal IntPtr svn_client_revprop_set(string propname, IntPtr propval,  
     285                                               string Url, IntPtr revision,  
     286                                               out uint set_rev, int force,  
     287                                               IntPtr ctx, IntPtr pool); 
     288 
     289        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     290        internal IntPtr svn_client_propget(out IntPtr props, string propname, string target,  
     291                                           IntPtr revision, int recurse,  
     292                                           IntPtr ctx, IntPtr pool); 
     293 
     294        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     295        internal IntPtr svn_client_revprop_get(string propname, out IntPtr propval,  
     296                                               string URL, IntPtr revision, out uint set_rev,  
     297                                               IntPtr ctx, IntPtr pool); 
     298 
     299        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     300        internal IntPtr svn_client_proplist(out IntPtr props,  
     301                                            string target, IntPtr revision, int recurse,  
     302                                            IntPtr ctx, IntPtr pool); 
     303 
     304        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     305        internal IntPtr svn_client_revprop_list(out IntPtr props, 
     306                                                string URL, IntPtr revision, out uint set_rev,  
     307                                                IntPtr ctx, IntPtr pool); 
     308 
     309        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     310        internal IntPtr svn_client_export(out uint result_rev,  
     311                                          string from, string to, IntPtr revision, int force,  
     312                                          IntPtr ctx, IntPtr pool); 
     313 
     314        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     315        internal IntPtr svn_client_ls(out IntPtr dirents,  
     316                                      string path_or_url, IntPtr revision, int recurse,  
     317                                      IntPtr ctx, IntPtr pool); 
     318 
     319        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     320        internal IntPtr svn_client_cat(IntPtr output,  
     321                                       string path_or_url, IntPtr revision, 
     322                                       IntPtr ctx, IntPtr pool); 
     323 
     324        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     325        internal IntPtr svn_client_url_from_path(string url, string path_or_url, IntPtr pool); 
     326 
     327        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     328        internal IntPtr svn_client_uuid_from_url(string uuid, string url, IntPtr ctx, IntPtr pool); 
     329 
     330        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     331        internal IntPtr svn_client_uuid_from_path (string uuid, string path,  
     332                                                   IntPtr adm_access, 
     333                                                   IntPtr ctx, IntPtr pool); 
    198334        #endregion                 
    199335    } 
  • trunk/SubversionSharp/dev/src/SvnClient.cs

    r31 r33  
    2121                                              AprPool pool); 
    2222                                                
    23         public static int SvnClientCheckout(string url, string path,  
    24                                            SvnOptRevision revision,  
    25                                            bool recurse, SvnClientContext ctx, AprPool pool) 
     23        public static int Checkout(string url, string path,  
     24                                   SvnOptRevision revision,  
     25                                   bool recurse, SvnClientContext ctx, AprPool pool) 
    2626        { 
    27             int rev; 
     27            uint rev; 
    2828            Debug.Write(String.Format("svn_client_checkout({0},{1},{2},{3},{4},{5})...",url,path,revision,recurse,ctx,pool)); 
    2929            SvnError err = Svn.svn_client_checkout(out rev, url, path,  
     
    3333                throw new SvnException(err); 
    3434            Debug.WriteLine(String.Format("Done({0})",rev)); 
    35             return(rev); 
     35            return(unchecked((int)rev)); 
    3636        } 
    3737         
    3838         
    39         public static int SvnClientUpdate(string path,  
    40                                         SvnOptRevision revision,  
    41                                         bool recurse, SvnClientContext ctx, AprPool pool) 
     39        public static int Update(string path,  
     40                                SvnOptRevision revision,  
     41                                bool recurse, SvnClientContext ctx, AprPool pool) 
    4242        { 
    43             int rev; 
     43            uint rev; 
    4444            Debug.Write(String.Format("svn_client_update({0},{1},{2},{3},{4})...",path,revision,recurse,ctx,pool)); 
    4545            SvnError err = Svn.svn_client_update(out rev, path,  
     
    4949                throw new SvnException(err); 
    5050            Debug.WriteLine(String.Format("Done({0})",rev)); 
    51             return(rev); 
     51            return(unchecked((int)rev)); 
    5252        } 
    5353         
    54         public static int SvnClientSwitch(string path, string url,  
    55                                         SvnOptRevision revision,  
    56                                         bool recurse, SvnClientContext ctx, AprPool pool) 
     54        public static int Switch(string path, string url,  
     55                                SvnOptRevision revision,  
     56                                bool recurse, SvnClientContext ctx, AprPool pool) 
    5757        { 
    58             int rev; 
     58            uint rev; 
    5959            Debug.Write(String.Format("svn_client_switch({0},{1},{2},{3},{4},{5})...",path,url,revision,recurse,ctx,pool)); 
    6060            SvnError err = Svn.svn_client_switch(out rev, path, url,  
     
    6464                throw new SvnException(err); 
    6565            Debug.WriteLine(String.Format("Done({0})",rev)); 
    66             return(rev); 
     66            return(unchecked((int)rev)); 
    6767        } 
    6868         
    69         public static void SvnClientAdd(string path, 
    70                                        bool recurse,  
    71                                        SvnClientContext ctx, AprPool pool) 
     69        public static void Add(string path, 
     70                               bool recurse,  
     71                               SvnClientContext ctx, AprPool pool) 
    7272        { 
    7373            Debug.WriteLine(String.Format("svn_client_add({0},{1},{2},{3},{4})",path,recurse,ctx,pool)); 
     
    7777                throw new SvnException(err); 
    7878        } 
     79         
     80        public static SvnClientCommitInfo Mkdir(AprArray paths,   
     81                                                SvnClientContext ctx, AprPool pool) 
     82        { 
     83            SvnClientCommitInfo commitInfo; 
     84            Debug.Write(String.Format("svn_client_mkdir({0},{1},{2})...",paths,ctx,pool)); 
     85            SvnError err = Svn.svn_client_mkdir(out commitInfo, paths, ctx, pool); 
     86            if( !err.IsNoError ) 
     87                throw new SvnException(err); 
     88            Debug.WriteLine(String.Format("Done({0})",commitInfo)); 
     89            return(commitInfo); 
     90        } 
     91         
     92        public static SvnClientCommitInfo Delete(AprArray paths, bool force, 
     93                                                 SvnClientContext ctx, AprPool pool) 
     94        { 
     95            SvnClientCommitInfo commitInfo; 
     96            Debug.Write(String.Format("svn_client_delete({0},{1},{2},{3})...",paths,force,ctx,pool)); 
     97            SvnError err = Svn.svn_client_delete(out commitInfo, paths, (force) ? 1 : 0, ctx, pool); 
     98            if( !err.IsNoError ) 
     99                throw new SvnException(err); 
     100            Debug.WriteLine(String.Format("Done({0})",commitInfo)); 
     101            return(commitInfo); 
     102        } 
     103         
     104        public static SvnClientCommitInfo Import(string path, string url, bool nonrecursive,   
     105                                                 SvnClientContext ctx, AprPool pool) 
     106        { 
     107            SvnClientCommitInfo commitInfo; 
     108            Debug.Write(String.Format("svn_client_import({0},{1},{2},{3},{4})...",path,url,nonrecursive,ctx,pool)); 
     109            SvnError err = Svn.svn_client_import(out commitInfo, path, url, (nonrecursive) ? 1 : 0,  
     110                                                 ctx, pool); 
     111            if( !err.IsNoError ) 
     112                throw new SvnException(err); 
     113            Debug.WriteLine(String.Format("Done({0})",commitInfo)); 
     114            return(commitInfo); 
     115        } 
     116         
     117        public static SvnClientCommitInfo Commit(AprArray targets, bool nonrecursive, 
     118                                                 SvnClientContext ctx, AprPool pool) 
     119        { 
     120            SvnClientCommitInfo commitInfo; 
     121            Debug.Write(String.Format("svn_client_commit({0},{1},{2},{3})...",targets,nonrecursive,ctx,pool)); 
     122            SvnError err = Svn.svn_client_commit(out commitInfo, targets, (nonrecursive) ? 1 : 0, 
     123                                                 ctx, pool); 
     124            if( !err.IsNoError ) 
     125                throw new SvnException(err); 
     126            Debug.WriteLine(String.Format("Done({0})",commitInfo)); 
     127            return(commitInfo); 
     128        } 
    79129    } 
    80130} 
  • trunk/SubversionSharp/dev/src/SvnDelegate.cs

    r31 r33  
    107107                Debug.Write(String.Format("[Callback:{0}]SvnClientGetCommitLog({1},{2:X},{3})...",func.Method.Name,new AprArray(commit_items),baton,new AprPool(pool))); 
    108108                err = func(out logMessage, out tmpFile, 
    109                            new AprArray(commit_items), baton, 
     109                           new AprArray(commit_items,typeof(SvnClientCommitItem)), baton, 
    110110                           new AprPool(pool)); 
    111111                Debug.WriteLine(String.Format("Done({0},{1})",logMessage,tmpFile)); 
  • trunk/SubversionSharp/test/src/Main.cs

    r31 r33  
    7171        if (!commitItems.IsNull) 
    7272        { 
    73             foreach (SvnClientCommitItem item in gclea.CommitItems) 
    74             { 
    75                 Console.WriteLine("C{0}: {1} ({2}) r{3}", 
    76                     ++mCommitCounter, 
     73            foreach (SvnClientCommitItem item in commitItems) 
     74            { 
     75                Console.WriteLine("C1: {1} ({2}) r{3}", 
    7776                    item.Path, item.Kind, item.Revision); 
    78                 Console.WriteLine("C{0}: {1} -> {2}", 
    79                     mCommitCounter, 
    80                     item.URL, 
     77                Console.WriteLine("C2: {1} -> {2}", 
     78                    item.Url, 
    8179                    item.CopyFromUrl); 
    8280            }