Author: dannas
Date: Thu Jul 29 20:59:08 2010
New Revision: 980569
URL: http://svn.apache.org/viewvc?rev=980569&view=rev
Log:
Show the property name when printing property hunk notifications.
At the same time use '##' in the property hunk headers for already
applied hunks.
The notifications will be on this form:
'## -1,6 +1,7 ## (svn:executable)'
* subversion/svn/notify.c
(notify): Add prop_name to the output for property hunks.
* subversion/include/svn_wc.h
(svn_wc_notify_t): Remove 'is_prop_hunk' field.
* subversion/libsvn_client/patch.c
(send_patch_notification): Set the prop_name for property hunk
notifications.
Suggested by: stsp
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/svn/notify.c
Modified: subversion/trunk/subversion/include/svn_wc.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=980569&r1=980568&r2=980569&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Jul 29 20:59:08 2010
@@ -1266,10 +1266,6 @@ typedef struct svn_wc_notify_t {
* @since New in 1.7 */
int hunk_fuzz;
- /** If @c action relates to hunks, specifies whether the hunk is a
- * property hunk or not. */
- svn_boolean_t is_prop_hunk;
-
/* NOTE: Add new fields at the end to preserve binary compatibility.
Also, if you add fields here, you have to update svn_wc_create_notify
and svn_wc_dup_notify. */
Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=980569&r1=980568&r2=980569&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Thu Jul 29 20:59:08 2010
@@ -1519,8 +1519,7 @@ send_patch_notification(const patch_targ
svn_diff_hunk_get_modified_length(hi->hunk);
notify->hunk_matched_line = hi->matched_line;
notify->hunk_fuzz = hi->fuzz;
- /* ### Should is_prop_hunk be a field in hunk_info_t? */
- notify->is_prop_hunk = FALSE;
+ notify->prop_name = NULL;
(*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
}
@@ -1563,8 +1562,7 @@ send_patch_notification(const patch_targ
svn_diff_hunk_get_modified_length(hi->hunk);
notify->hunk_matched_line = hi->matched_line;
notify->hunk_fuzz = hi->fuzz;
- /* ### Should is_prop_hunk be a field in hunk_info_t? */
- notify->is_prop_hunk = TRUE;
+ notify->prop_name = apr_pstrdup(pool, prop_target->name);
(*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
}
Modified: subversion/trunk/subversion/svn/notify.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=980569&r1=980568&r2=980569&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Thu Jul 29 20:59:08 2010
@@ -310,60 +310,96 @@ notify(void *baton, const svn_wc_notify_
minus = "-";
}
- /* ### APR_INT64_T_FMT isn't translator-friendly */
+ /* ### We're creating the localized strings without
+ * ### APR_INT64_T_FMT since it isn't translator-friendly */
if (n->hunk_fuzz)
{
- if (n->is_prop_hunk)
- s = _("> applied hunk ## -%lu,%lu +%lu,%lu ## "
- "with offset %s");
+
+ if (n->prop_name)
+ {
+ s = _("> applied hunk ## -%lu,%lu +%lu,%lu ## "
+ "with offset %s");
+
+ err = svn_cmdline_printf(pool,
+ apr_pstrcat(pool, s,
+ "%"APR_UINT64_T_FMT
+ " and fuzz %d (%s)\n",
+ NULL),
+ n->hunk_original_start,
+ n->hunk_original_length,
+ n->hunk_modified_start,
+ n->hunk_modified_length,
+ minus, off, n->hunk_fuzz,
+ n->prop_name);
+ }
else
- s = _("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
- "with offset %s");
+ {
+ s = _("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
+ "with offset %s");
+
+ err = svn_cmdline_printf(pool,
+ apr_pstrcat(pool, s,
+ "%"APR_UINT64_T_FMT
+ " and fuzz %d\n",
+ NULL),
+ n->hunk_original_start,
+ n->hunk_original_length,
+ n->hunk_modified_start,
+ n->hunk_modified_length,
+ minus, off, n->hunk_fuzz);
+ }
- if ((err = svn_cmdline_printf(pool,
- apr_pstrcat(pool, s,
- "%"APR_UINT64_T_FMT
- " and fuzz %d\n",
- NULL),
- n->hunk_original_start,
- n->hunk_original_length,
- n->hunk_modified_start,
- n->hunk_modified_length,
- minus, off, n->hunk_fuzz)))
+ if (err)
goto print_error;
}
else
{
- if (n->is_prop_hunk)
- s = _("> applied hunk ## -%lu,%lu +%lu,%lu ## "
- "with offset %s");
- else
- s = _("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
- "with offset %s");
- if ((err = svn_cmdline_printf(pool,
+ if (n->prop_name)
+ {
+ s = _("> applied hunk ## -%lu,%lu +%lu,%lu ## "
+ "with offset %s");
+ err = svn_cmdline_printf(pool,
apr_pstrcat(pool, s,
-
"%"APR_UINT64_T_FMT"\n",
+ "%"APR_UINT64_T_FMT"
(%s)\n",
NULL),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
n->hunk_modified_length,
- minus, off)))
+ minus, off, n->prop_name);
+ }
+ else
+ {
+ s = _("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
+ "with offset %s");
+ err = svn_cmdline_printf(pool,
+ apr_pstrcat(pool, s,
+ "%"APR_UINT64_T_FMT"\n",
+ NULL),
+ n->hunk_original_start,
+ n->hunk_original_length,
+ n->hunk_modified_start,
+ n->hunk_modified_length,
+ minus, off);
+ }
+
+ if (err)
goto print_error;
}
}
else if (n->hunk_fuzz)
{
- if (n->is_prop_hunk)
+ if (n->prop_name)
err = svn_cmdline_printf(pool,
_("> applied hunk ## -%lu,%lu +%lu,%lu ## "
- "with fuzz %d\n"),
+ "with fuzz %d (%s)\n"),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
n->hunk_modified_length,
- n->hunk_fuzz);
+ n->hunk_fuzz,
+ n->prop_name);
else
err = svn_cmdline_printf(pool,
_("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
@@ -382,14 +418,15 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_patch_rejected_hunk:
nb->received_some_change = TRUE;
- if (n->is_prop_hunk)
+ if (n->prop_name)
err = svn_cmdline_printf(pool,
_("> rejected hunk "
- "## -%lu,%lu +%lu,%lu ##\n"),
+ "## -%lu,%lu +%lu,%lu ## (%s)\n"),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
- n->hunk_modified_length);
+ n->hunk_modified_length,
+ n->prop_name);
else
err = svn_cmdline_printf(pool,
_("> rejected hunk "
@@ -404,15 +441,16 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_patch_hunk_already_applied:
nb->received_some_change = TRUE;
- if (n->is_prop_hunk)
+ if (n->prop_name)
err = svn_cmdline_printf(pool,
_("> hunk "
- "@@ -%lu,%lu +%lu,%lu @@ "
- "already applied\n"),
+ "## -%lu,%lu +%lu,%lu ## "
+ "already applied (%s)\n"),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
- n->hunk_modified_length);
+ n->hunk_modified_length,
+ n->prop_name);
else
err = svn_cmdline_printf(pool,
_("> hunk "