Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/libsvn_client/diff.c view on Meta::CPAN
apr_pool_t *scratch_pool)
{
/* Do nothing. */
return SVN_NO_ERROR;
}
/* An svn_wc_diff_callbacks4_t function. */
static svn_error_t *
diff_dir_closed(svn_wc_notify_state_t *contentstate,
svn_wc_notify_state_t *propstate,
svn_boolean_t *tree_conflicted,
const char *diff_relpath,
svn_boolean_t dir_was_added,
void *diff_baton,
apr_pool_t *scratch_pool)
{
/* Do nothing. */
return SVN_NO_ERROR;
}
static const svn_wc_diff_callbacks4_t diff_callbacks =
{
diff_file_opened,
diff_file_changed,
diff_file_added,
diff_file_deleted,
diff_dir_deleted,
diff_dir_opened,
diff_dir_added,
diff_dir_props_changed,
diff_dir_closed
};
/*-----------------------------------------------------------------*/
/** The logic behind 'svn diff' and 'svn merge'. */
/* Hi! This is a comment left behind by Karl, and Ben is too afraid
to erase it at this time, because he's not fully confident that all
this knowledge has been grokked yet.
There are five cases:
1. path is not a URL and start_revision != end_revision
2. path is not a URL and start_revision == end_revision
3. path is a URL and start_revision != end_revision
4. path is a URL and start_revision == end_revision
5. path is not a URL and no revisions given
With only one distinct revision the working copy provides the
other. When path is a URL there is no working copy. Thus
1: compare repository versions for URL coresponding to working copy
2: compare working copy against repository version
3: compare repository versions for URL
4: nothing to do.
5: compare working copy against text-base
Case 4 is not as stupid as it looks, for example it may occur if
the user specifies two dates that resolve to the same revision. */
/** Check if paths PATH_OR_URL1 and PATH_OR_URL2 are urls and if the
* revisions REVISION1 and REVISION2 are local. If PEG_REVISION is not
* unspecified, ensure that at least one of the two revisions is not
* BASE or WORKING.
* If PATH_OR_URL1 can only be found in the repository, set *IS_REPOS1
* to TRUE. If PATH_OR_URL2 can only be found in the repository, set
* *IS_REPOS2 to TRUE. */
static svn_error_t *
check_paths(svn_boolean_t *is_repos1,
svn_boolean_t *is_repos2,
const char *path_or_url1,
const char *path_or_url2,
const svn_opt_revision_t *revision1,
const svn_opt_revision_t *revision2,
const svn_opt_revision_t *peg_revision)
{
svn_boolean_t is_local_rev1, is_local_rev2;
/* Verify our revision arguments in light of the paths. */
if ((revision1->kind == svn_opt_revision_unspecified)
|| (revision2->kind == svn_opt_revision_unspecified))
return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
_("Not all required revisions are specified"));
/* Revisions can be said to be local or remote.
* BASE and WORKING are local revisions. */
is_local_rev1 =
((revision1->kind == svn_opt_revision_base)
|| (revision1->kind == svn_opt_revision_working));
is_local_rev2 =
((revision2->kind == svn_opt_revision_base)
|| (revision2->kind == svn_opt_revision_working));
if (peg_revision->kind != svn_opt_revision_unspecified &&
is_local_rev1 && is_local_rev2)
return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
_("At least one revision must be something other "
"than BASE or WORKING when diffing a URL"));
/* Working copy paths with non-local revisions get turned into
URLs. We don't do that here, though. We simply record that it
needs to be done, which is information that helps us choose our
diff helper function. */
*is_repos1 = ! is_local_rev1 || svn_path_is_url(path_or_url1);
*is_repos2 = ! is_local_rev2 || svn_path_is_url(path_or_url2);
return SVN_NO_ERROR;
}
/* Raise an error if the diff target URL does not exist at REVISION.
* If REVISION does not equal OTHER_REVISION, mention both revisions in
* the error message. Use RA_SESSION to contact the repository.
* Use POOL for temporary allocations. */
static svn_error_t *
check_diff_target_exists(const char *url,
svn_revnum_t revision,
svn_revnum_t other_revision,
( run in 0.331 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )