Revision: 40687
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40687&view=rev
Author:   starseeker
Date:     2010-09-26 15:44:45 +0000 (Sun, 26 Sep 2010)

Log Message:
-----------
Make two working copies, create a file in one of them and svn add it to the 
repository.  Next up, actually commit it and then do an svn update in the 
second checkout.

Modified Paths:
--------------
    rt^3/branches/subversion-cmake/svntest/main.c

Modified: rt^3/branches/subversion-cmake/svntest/main.c
===================================================================
--- rt^3/branches/subversion-cmake/svntest/main.c       2010-09-25 02:38:45 UTC 
(rev 40686)
+++ rt^3/branches/subversion-cmake/svntest/main.c       2010-09-26 15:44:45 UTC 
(rev 40687)
@@ -346,14 +346,18 @@
                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
   }
 
+  /* Next, check out a working copy */
+
   const char *abs_path;
   char full_repository_url[1024];
   svn_path_get_absolute(&abs_path, repo_path, pool);
   sprintf(full_repository_url,"file://localhost:%s", abs_path);
   printf("full_repository_url: %s\n", full_repository_url);
 
-  char *checkout_path = "./test_checkout";
-  const char *full_checkout_path = svn_path_canonicalize(checkout_path, pool);
+  char *checkout_path1 = "./test_checkout1";
+  char *checkout_path2 = "./test_checkout2";
+  const char *full_checkout_path1 = svn_path_canonicalize(checkout_path1, 
pool);
+  const char *full_checkout_path2 = svn_path_canonicalize(checkout_path2, 
pool);
   svn_opt_revision_t revision;
   svn_opt_revision_t peg_revision;
   revision.kind = svn_opt_revision_head;
@@ -362,9 +366,34 @@
   apr_pool_t *subpool;
   subpool = svn_pool_create(pool);
   svn_pool_clear(subpool);
-  printf("svn checkout:  repo: %s, target: %s\n", full_repository_url, 
full_checkout_path);
-  svn_client_checkout3(NULL, full_repository_url, full_checkout_path, 
&peg_revision, &revision, svn_depth_infinity, 0, 0, ctx, subpool);
+  printf("svn checkout:  repo: %s, target: %s\n", full_repository_url, 
full_checkout_path1);
+  svn_client_checkout3(NULL, full_repository_url, full_checkout_path1, 
&peg_revision, &revision, svn_depth_infinity, 0, 0, ctx, subpool);
 
+  svn_pool_clear(subpool);
+  printf("svn checkout:  repo: %s, target: %s\n", full_repository_url, 
full_checkout_path2);
+  svn_client_checkout3(NULL, full_repository_url, full_checkout_path2, 
&peg_revision, &revision, svn_depth_infinity, 0, 0, ctx, subpool);
+
+  /* Add a new file to the first working copy and svn add it to the repository 
*/
+  char file_path[1024];
+  FILE *fp;
+  sprintf(file_path,"%s/test_file", full_checkout_path1);
+  printf("file_path: %s\n", file_path);
+  fp = fopen(file_path,"w");
+  if(fp != NULL){
+     fputs ("subversion test", fp);
+     fclose (fp);
+  } else {
+     printf("augh - no file written: %s\n", file_path);
+  }
+
+  svn_pool_clear(subpool);
+  svn_client_add4(file_path, svn_depth_empty, FALSE, FALSE, FALSE, ctx, 
subpool);
+
+
+  /* Commit the changes */
+
+  /* Perform an update operation on the second repository */
+
   /* Done, now clean up */
   svn_pool_destroy(pool);
   /* Ensure that everything is written to stdout, so the user will


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to