Seems like the right answer is:
* compare URLs
* if that fails, get the zero, one, or two UUIDs from the WC
* fetch any missing UUIDs from the server
* shove the UUIDs back into the WC if a write-lock exists
* compare the two UUIDs
I would suggest a general utility function in libsvn_wc.
Cheers,
-g
On Fri, Jan 30, 2009 at 13:20, Bert Huijben <rhuijben_at_sharpsvn.net> wrote:
>> -----Original Message-----
>> From: Senthil Kumaran S [mailto:senthil_at_collab.net]
>> Sent: vrijdag 30 januari 2009 12:51
>> To: svn_at_subversion.tigris.org
>> Subject: svn commit: r35578 - trunk/subversion/libsvn_client
>>
>> Author: stylesen
>> Date: Fri Jan 30 03:51:17 2009
>> New Revision: 35578
>>
>> Log:
>> Partially fix issue #3361.
>>
>> * subversion/libsvn_client/merge.c
>> (merge_cousins_and_supplement_mergeinfo, svn_client_merge3,
>> svn_client_merge_peg3): Determine same repositories by comparing
>> UUIDs
>> of the repositories instead of doing a URL match.
>>
>> Found by: Miles Crawford <mcrawfor_at_u.washington.edu>
>>
>> Modified:
>> trunk/subversion/libsvn_client/merge.c
>>
>> Modified: trunk/subversion/libsvn_client/merge.c
>> URL:
>> http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/merge.c
>> ?pathrev=35578&r1=35577&r2=35578
>> =======================================================================
>> =======
>> --- trunk/subversion/libsvn_client/merge.c Fri Jan 30 01:55:04 2009
>> (r35577)
>> +++ trunk/subversion/libsvn_client/merge.c Fri Jan 30 03:51:17 2009
>> (r35578)
>> @@ -6688,8 +6688,16 @@ merge_cousins_and_supplement_mergeinfo(c
>> apr_array_header_t *remove_sources, *add_sources, *ranges;
>> svn_opt_revision_t peg_revision;
>> const char *old_url;
>> + const char *source_repos_uuid;
>> + const char *wc_repos_uuid;
>> +
>> + SVN_ERR(svn_client_uuid_from_url(&source_repos_uuid,
>> source_repos_root,
>> + ctx, pool));
>> + SVN_ERR(svn_client_uuid_from_url(&wc_repos_uuid, wc_repos_root,
>> + ctx, pool));
>> +
>> svn_boolean_t same_repos =
>> - (strcmp(wc_repos_root, source_repos_root) == 0) ? TRUE : FALSE;
>> + (strcmp(wc_repos_uuid, source_repos_uuid) == 0) ? TRUE : FALSE;
>
> Could you do this only when the repository root doesn't match?
>
> This creates two RA sessions just to get their UUIDs. (And for at least one
> of them we should have this value in our working copy and probably the other
> could be cached in its ra session).
>
> So only this change makes just merging a revision in the subversion
> repository for us Europeans at least a few seconds slower than it currently
> is. (Just opening a HTTPv1 ra session including authentication takes about 2
> seconds)
>
>
>>
>> peg_revision.kind = svn_opt_revision_number;
>> SVN_ERR(svn_ra_get_session_url(ra_session, &old_url, pool));
>> @@ -6802,6 +6810,8 @@ svn_client_merge3(const char *source1,
>> svn_revnum_t yc_rev = SVN_INVALID_REVNUM;
>> apr_pool_t *sesspool;
>> svn_boolean_t same_repos;
>> + const char *source_repos_uuid;
>> + const char *wc_repos_uuid;
>>
>> /* Sanity check our input -- we require specified revisions. */
>> if ((revision1->kind == svn_opt_revision_unspecified)
>> @@ -6868,7 +6878,12 @@ svn_client_merge3(const char *source1,
>> SVN_ERR(svn_ra_get_repos_root2(ra_session1, &source_repos_root,
>> sesspool));
>>
>> /* Do our working copy and sources come from the same repository? */
>> - same_repos = (strcmp(source_repos_root, wc_repos_root) == 0) ? TRUE
>> : FALSE;
>> + SVN_ERR(svn_client_uuid_from_url(&source_repos_uuid,
>> source_repos_root,
>> + ctx, pool));
>> + SVN_ERR(svn_client_uuid_from_url(&wc_repos_uuid, wc_repos_root,
>> + ctx, pool));
>> +
>> + same_repos = (strcmp(source_repos_uuid, wc_repos_uuid) == 0) ? TRUE
>> : FALSE;
>
> Same here
>
>>
>> /* Unless we're ignoring ancestry, see if the two sources are
>> related. */
>> if (! ignore_ancestry)
>> @@ -7897,6 +7912,8 @@ svn_client_merge_peg3(const char *source
>> apr_pool_t *sesspool;
>> svn_boolean_t use_sleep;
>> svn_error_t *err;
>> + const char *source_repos_uuid;
>> + const char *wc_repos_uuid;
>>
>> /* No ranges to merge? No problem. */
>> if (ranges_to_merge->nelts == 0)
>> @@ -7940,9 +7957,14 @@ svn_client_merge_peg3(const char *source
>>
>> /* Do the real merge! (We say with confidence that our merge
>> sources are both ancestral and related.) */
>> + SVN_ERR(svn_client_uuid_from_url(&source_repos_uuid,
>> source_repos_root,
>> + ctx, pool));
>> + SVN_ERR(svn_client_uuid_from_url(&wc_repos_uuid, wc_repos_root,
>> + ctx, pool));
>> +
>
> And here again.
>
>> err = do_merge(merge_sources, target_wcpath, entry, adm_access,
>> TRUE, TRUE,
>> - (strcmp(wc_repos_root, source_repos_root) == 0),
>> + (strcmp(wc_repos_uuid, source_repos_uuid) == 0),
>> ignore_ancestry, force, dry_run, record_only, depth,
>> merge_options, &use_sleep, ctx, pool);
>>
>> ------------------------------------------------------
>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageI
>> d=1073898
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1074181
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1074251
Received on 2009-01-30 13:39:40 CET