Hi All,
Find the attached patch and log.
With regards
Kamesh Jayachandran
[[[
Patch by: Kamesh Jayachandran <kamesh@collab.net>
Comparing 'range->start' and 'range->end' on two different URLs is
meaningless.
* subversion/libsvn_client/diff.c
(grok_range_info_from_opt_revisions):
Accepts URL1 and URL2 to make a meaningful comparison of
range->start and range->end.
(do_merge): Calls new 'grok_range_info_from_opt_revisions'.
(do_single_file_merge): Calls new 'grok_range_info_from_opt_revisions'.
]]]
Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c (revision 21563)
+++ subversion/libsvn_client/diff.c (working copy)
@@ -2109,22 +2109,24 @@
merge_type_no_op /* no change */
};
-/* Resolve requested revisions for PATH1@REVISION1 and PATH1@REVISION2
+/* Resolve requested revisions for PATH1@REVISION1 and PATH2@REVISION2
(using RA_SESSION1 and RA_SESSION2), convert them into a merge
range, determine whether that range represents a
- merge/revert/no-op, and store that knowledge in *RANGE and
- *MERGE_TYPE (respectively). If the resulting revisions would
- result in the merge being a no-op, RANGE->START and RANGE->END are
- set to SVN_INVALID_REVNUM. */
+ merge/revert/no-op only if both URL1 and URL2 are same, and store that
+ knowledge in *RANGE and *MERGE_TYPE (respectively).
+ If the resulting revisions would result in the merge being a no-op,
+ RANGE->START and RANGE->END are set to SVN_INVALID_REVNUM. */
static svn_error_t *
grok_range_info_from_opt_revisions(svn_merge_range_t *range,
enum merge_type *merge_type,
svn_ra_session_t *ra_session1,
const char *path1,
svn_opt_revision_t *revision1,
+ const char *URL1,
svn_ra_session_t *ra_session2,
const char *path2,
svn_opt_revision_t *revision2,
+ const char *URL2,
apr_pool_t *pool)
{
/* Resolve the revision numbers. */
@@ -2133,24 +2135,28 @@
SVN_ERR(svn_client__get_revision_number
(&range->end, ra_session2, revision2, path2, pool));
- /* Handle the fact that a svn_merge_range_t's "start" and "end" are
- inclusive. */
- if (range->start < range->end)
+ if (strcmp(URL1, URL2))
+ *merge_type = merge_type_merge;
+ else
{
- *merge_type = merge_type_merge;
- range->start += 1;
+ /* Handle the fact that a svn_merge_range_t's "start" and "end" are
+ * inclusive. */
+ if (range->start < range->end)
+ {
+ *merge_type = merge_type_merge;
+ range->start += 1;
+ }
+ else if (range->start > range->end)
+ {
+ *merge_type = merge_type_revert;
+ range->end += 1;
+ }
+ else /* No revisions to merge. */
+ {
+ *merge_type = merge_type_no_op;
+ range->start = range->end = SVN_INVALID_REVNUM;
+ }
}
- else if (range->start > range->end)
- {
- *merge_type = merge_type_revert;
- range->end += 1;
- }
- else /* No revisions to merge. */
- {
- *merge_type = merge_type_no_op;
- range->start = range->end = SVN_INVALID_REVNUM;
- }
-
return SVN_NO_ERROR;
}
@@ -2238,8 +2244,8 @@
ctx, pool));
SVN_ERR(grok_range_info_from_opt_revisions(&range, &merge_type,
- ra_session, path1, revision1,
- ra_session, path2, revision2,
+ ra_session, path1, revision1, URL1,
+ ra_session, path2, revision2, URL2,
pool));
if (merge_type == merge_type_no_op)
return SVN_NO_ERROR;
@@ -2457,8 +2463,10 @@
ctx, pool));
SVN_ERR(grok_range_info_from_opt_revisions(&range, &merge_type,
- ra_session1, path1, revision1,
- ra_session2, path2, revision2,
+ ra_session1, path1,
+ revision1, URL1,
+ ra_session2, path2,
+ revision2, URL2,
pool));
if (merge_type == merge_type_no_op)
return SVN_NO_ERROR;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 20 16:23:12 2006