[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Keywords as Hash 3 - libsvn_client

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-09-21 17:43:36 CEST

[[[

Update libsvn_client to use the new hash-based keywords functionality.
No changes as far as consumers of that library go (i.e. no tests fail
and no new tests required).

* subversion/libsvn_client/export.c
   (copy_one_versioned_file, close_file):
   subversion/libsvn_client/cat.c
   (cat_local_file, svn_client_cat2):
   subversion/libsvn_client/commit.c
   (send_file_contents):
     Change variables from svn_subst_keywords_t to apr_hash_t.
     Replace calls to svn_subst_build_keywords() with
     svn_subst_build_keywords2().
     Replace calls to svn_subst_copy_and_translate2() with
     svn_subst_copy_and_translate3()

]]]

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

=== subversion/libsvn_client/export.c
==================================================================
--- subversion/libsvn_client/export.c (/local/kwhash2) (revision 15749)
+++ subversion/libsvn_client/export.c (/local/kwhash3) (revision 15749)
@@ -99,7 +99,7 @@
                          apr_pool_t *pool)
 {
   const svn_wc_entry_t *entry;
- svn_subst_keywords_t kw = { 0 };
+ apr_hash_t *kw;
   svn_subst_eol_style_t style;
   apr_hash_t *props;
   const char *base;
@@ -188,14 +188,14 @@
           author = entry->cmt_author;
         }
       
- SVN_ERR (svn_subst_build_keywords
+ SVN_ERR (svn_subst_build_keywords2
                (&kw, keywords->data,
                 apr_psprintf (pool, fmt, entry->cmt_rev),
                 entry->url, tm, author, pool));
     }
 
- SVN_ERR (svn_subst_copy_and_translate2 (base, to, eol, FALSE,
- &kw, TRUE,
+ SVN_ERR (svn_subst_copy_and_translate3 (base, to, eol, FALSE,
+ kw, TRUE,
                                           special ? TRUE : FALSE,
                                           pool));
   if (executable)
@@ -697,22 +697,22 @@
     {
       svn_subst_eol_style_t style;
       const char *eol;
- svn_subst_keywords_t final_kw = {0};
+ apr_hash_t *final_kw;
 
       if (fb->eol_style_val)
         SVN_ERR (get_eol_style (&style, &eol, fb->eol_style_val->data,
                                 eb->native_eol));
 
       if (fb->keywords_val)
- SVN_ERR (svn_subst_build_keywords (&final_kw, fb->keywords_val->data,
- fb->revision, fb->url, fb->date,
- fb->author, pool));
+ SVN_ERR (svn_subst_build_keywords2 (&final_kw, fb->keywords_val->data,
+ fb->revision, fb->url, fb->date,
+ fb->author, pool));
 
- SVN_ERR (svn_subst_copy_and_translate2
+ SVN_ERR (svn_subst_copy_and_translate3
                (fb->tmppath, fb->path,
                 fb->eol_style_val ? eol : NULL,
                 fb->eol_style_val ? TRUE : FALSE, /* repair */
- fb->keywords_val ? &final_kw : NULL,
+ fb->keywords_val ? final_kw : NULL,
                 TRUE, /* expand */
                 fb->special,
                 pool));
=== subversion/libsvn_client/cat.c
==================================================================
--- subversion/libsvn_client/cat.c (/local/kwhash2) (revision 15749)
+++ subversion/libsvn_client/cat.c (/local/kwhash3) (revision 15749)
@@ -50,7 +50,7 @@
                 apr_pool_t *pool)
 {
   const svn_wc_entry_t *entry;
- svn_subst_keywords_t kw = { 0 };
+ apr_hash_t *kw;
   svn_subst_eol_style_t style;
   apr_hash_t *props;
   const char *base;
@@ -136,7 +136,7 @@
           author = entry->cmt_author;
         }
       
- SVN_ERR (svn_subst_build_keywords
+ SVN_ERR (svn_subst_build_keywords2
                (&kw, keywords->data,
                 apr_psprintf (pool, fmt, entry->cmt_rev),
                 entry->url, tm, author, pool));
@@ -146,8 +146,11 @@
                              APR_READ, APR_OS_DEFAULT, pool));
   input = svn_stream_from_aprfile (input_file, pool);
 
- SVN_ERR (svn_subst_translate_stream2 (input, output, eol, FALSE, &kw, TRUE,
- pool));
+ if ( eol || kw )
+ SVN_ERR (svn_subst_translate_stream3 (input, output, eol, FALSE, kw,
+ TRUE, pool));
+ else
+ SVN_ERR (svn_stream_copy (input, output, pool));
 
   SVN_ERR (svn_stream_close (input));
   SVN_ERR (svn_io_file_close (input_file, pool));
@@ -218,7 +221,7 @@
     }
   else
     {
- svn_subst_keywords_t kw = { 0 };
+ apr_hash_t *kw;
       svn_subst_eol_style_t style;
       const char *temp_dir;
       const char *tmp_filename;
@@ -262,7 +265,7 @@
           if (cmt_date)
             SVN_ERR (svn_time_from_cstring (&when, cmt_date->data, pool));
 
- SVN_ERR (svn_subst_build_keywords
+ SVN_ERR (svn_subst_build_keywords2
                    (&kw, keywords->data,
                     cmt_rev->data,
                     url,
@@ -271,7 +274,7 @@
                     pool));
         }
 
- SVN_ERR (svn_subst_translate_stream2 (tmp_stream, out, eol, FALSE, &kw,
+ SVN_ERR (svn_subst_translate_stream3 (tmp_stream, out, eol, FALSE, kw,
                                             TRUE, pool));
 
       SVN_ERR (svn_stream_close (tmp_stream));
=== subversion/libsvn_client/commit.c
==================================================================
--- subversion/libsvn_client/commit.c (/local/kwhash2) (revision 15749)
+++ subversion/libsvn_client/commit.c (/local/kwhash3) (revision 15749)
@@ -110,7 +110,7 @@
      Keywords get unexpanded. */
   if (eol_style_val || keywords_val || special)
     {
- svn_subst_keywords_t keywords = {0};
+ apr_hash_t *keywords;
       const char *temp_dir;
       apr_file_t *tmp_f;
 
@@ -124,14 +124,14 @@
 
       /* Generate a keyword structure. */
       if (keywords_val)
- SVN_ERR (svn_subst_build_keywords (&keywords, keywords_val->data,
- APR_STRINGIFY(SVN_INVALID_REVNUM),
- "", 0, "", pool));
+ SVN_ERR (svn_subst_build_keywords2 (&keywords, keywords_val->data,
+ APR_STRINGIFY(SVN_INVALID_REVNUM),
+ "", 0, "", pool));
       
- if ((err = svn_subst_copy_and_translate2 (path, tmpfile_path,
+ if ((err = svn_subst_copy_and_translate3 (path, tmpfile_path,
                                                 eol_style_val ? "\n" : NULL,
                                                 FALSE,
- keywords_val ? &keywords : NULL,
+ keywords_val ? keywords : NULL,
                                                 FALSE,
                                                 special,
                                                 pool)))

Property changes on:
___________________________________________________________________
Name: svk:merge
  40bec6f9-eef0-0310-8400-9b45a50af7ca:/local/trunk:90
  422c9f7f-73e9-0310-916f-f579f4d99a6a:/local/pool-cleanup:1951
 +65fbbcb0-2eec-0310-814e-ef69edb84eb1:/local/kwhash2:15745
  ae6c956b-9dc6-0310-97b2-e73af4192982:/svn/local:8265
  c9b7866f-f5e4-0310-b3ee-a2e1643c603f:/svn/local/new-auto-merge:10428

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 21 17:44:21 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.