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

[PATCH] Define behavior of svn_wc_get_pristine_content2()

From: Neels J Hofmeyr <neels_at_elego.de>
Date: Sun, 28 Feb 2010 23:49:12 +0100

Hi,

Attached patch rewrites the comment for svn_wc_get_pristine_contents2(),
which didn't say much about *which* pristine this function returns.

I think this new comment describes current behavior (or at least currently
intended behavior). We need to properly define this for when we roll out the
pristine store.

Is anything here not making sense?

(pasting the new comment here as well for easier reading:)

[[[
/** Given a @a path to a wc file, return in @a contents a stream to the
 * contents of the pristine copy of the file, as relevant to the currently
 * set history of the file. That means:
 *
 * With no uncommitted changes on the file, or only text/prop modifications,
 * or when the file is only locally deleted (not replaced), return the last
 * checked-out or updated-/switched-to content of the file.
 *
 * When the file has been locally copied-/moved-here, return the content of
 * the copy/move source (even if the copy-/move-here replaces a locally
 * deleted file).
 *
 * If the file is simply added or replaced (no copy-/move-here involved),
 * return @c NULL.
 *
 * If @local_abspath refers to an unversioned or non-existing path, return
 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a wc_ctx to access the working copy.
 * @a contents may not be @c NULL and must point at a writable svn_stream_t*.
 *
 * This function is needed so clients can do diffs.
 *
 * @since New in 1.7. */
svn_error_t *
svn_wc_get_pristine_contents2(svn_stream_t **contents,
                              svn_wc_context_t *wc_ctx,
                              const char *local_abspath,
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool);
]]]

Thanks,
~Neels

* subversion/include/svn_wc.h (svn_wc_get_pristine_contents2): Comment.
--This line, and those below, will be ignored--
Index: subversion/include/svn_wc.h
===================================================================
--- subversion/include/svn_wc.h (revision 917303)
+++ subversion/include/svn_wc.h (working copy)
@@ -6389,10 +6389,26 @@ svn_wc_merge_prop_diffs(svn_wc_notify_st
                         apr_pool_t *pool);
 
 
-/** Given a @a path to a wc file, return a stream to the @a contents of
- * the pristine copy of the file. Use @a wc_ctx to access the working
- * copy.This is needed so clients can do diffs. If the WC has no
- * text-base, return a @c NULL instead of a stream.
+/** Given a @a path to a wc file, return in @a contents a stream to the
+ * contents of the pristine copy of the file, as relevant to the currently
+ * set history of the file. That means:
+ *
+ * With no uncommitted changes on the file, or only text/prop modifications,
+ * or when the file is only locally deleted (not replaced), return the last
+ * checked-out or updated-/switched-to content of the file.
+ *
+ * When the file has been locally copied-/moved-here, return the content of
+ * the copy/move source (even if the copy-/move-here replaces a locally
+ * deleted file).
+ *
+ * If the file is simply added or replaced (no copy-/move-here involved),
+ * return @c NULL.
+ *
+ * If @local_abspath refers to an unversioned or non-existing path, return
+ * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a wc_ctx to access the working copy.
+ * @a contents may not be @c NULL and must point at a writable svn_stream_t*.
+ *
+ * This function is needed so clients can do diffs.
  *
  * @since New in 1.7. */
 svn_error_t *

Received on 2010-02-28 23:49:55 CET

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.