You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/03/24 15:39:56 UTC
svn commit: r1084971 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Author: rhuijben
Date: Thu Mar 24 14:39:55 2011
New Revision: 1084971
URL: http://svn.apache.org/viewvc?rev=1084971&view=rev
Log:
* subversion/libsvn_wc/update_editor.c
(merge_file): Remove an argument which we already receive via the baton.
Don't retrieve the BASE information if we already have it.
(close_file): Update caller.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1084971&r1=1084970&r2=1084971&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Mar 24 14:39:55 2011
@@ -3558,11 +3558,6 @@ change_file_prop(void *file_baton,
* sensitive to eol translation, keyword substitution, and performing
* all actions accumulated the parent directory's work queue.
*
- * If there's a new text base, it must be in the pristine store and
- * NEW_TEXT_BASE_SHA1_CHECKSUM must be its SHA-1 checksum (else NULL).
- * After this function returns, the caller should install it as the new
- * text base for this file.
- *
* Set *CONTENT_STATE to the state of the contents after the
* installation.
*
@@ -3575,7 +3570,6 @@ merge_file(svn_skel_t **work_items,
const char **install_from,
svn_wc_notify_state_t *content_state,
struct file_baton *fb,
- const svn_checksum_t *new_text_base_sha1_checksum,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -3601,7 +3595,7 @@ merge_file(svn_skel_t **work_items,
things are true:
- The new pristine text of F is present in the pristine store
- iff NEW_TEXT_BASE_SHA1_CHECKSUM is not NULL.
+ iff FB->NEW_TEXT_BASE_SHA1_CHECKSUM is not NULL.
- The WC metadata still reflects the old version of F.
(We can still access the old pristine base text of F.)
@@ -3615,10 +3609,10 @@ merge_file(svn_skel_t **work_items,
*install_pristine = FALSE;
*install_from = NULL;
- if (new_text_base_sha1_checksum != NULL)
+ if (fb->new_text_base_sha1_checksum != NULL)
SVN_ERR(svn_wc__db_pristine_get_path(&new_text_base_tmp_abspath,
- eb->db, fb->local_abspath,
- new_text_base_sha1_checksum,
+ eb->db, pb->local_abspath,
+ fb->new_text_base_sha1_checksum,
pool, scratch_pool));
else
new_text_base_tmp_abspath = NULL;
@@ -3670,7 +3664,7 @@ merge_file(svn_skel_t **work_items,
FALSE /* compare_textbases */,
pool));
}
- else if (new_text_base_sha1_checksum && !fb->obstruction_found)
+ else if (fb->new_text_base_sha1_checksum && !fb->obstruction_found)
{
svn_stream_t *pristine_stream;
@@ -3678,7 +3672,7 @@ merge_file(svn_skel_t **work_items,
to this new pristine? */
SVN_ERR(svn_wc__db_pristine_read(&pristine_stream,
eb->db, fb->local_abspath,
- new_text_base_sha1_checksum,
+ fb->new_text_base_sha1_checksum,
pool, pool));
SVN_ERR(svn_wc__internal_versioned_file_modcheck(&is_locally_modified,
eb->db,
@@ -3697,7 +3691,7 @@ merge_file(svn_skel_t **work_items,
is_locally_modified = FALSE;
}
- if (have_base)
+ if (status != svn_wc__db_status_normal && have_base)
{
svn_wc__db_status_t base_status;
@@ -3736,7 +3730,7 @@ merge_file(svn_skel_t **work_items,
So the first thing we do is figure out where we are in the
matrix. */
- if (new_text_base_sha1_checksum)
+ if (fb->new_text_base_sha1_checksum)
{
if (is_replaced)
{
@@ -3825,7 +3819,7 @@ merge_file(svn_skel_t **work_items,
*path_ext ? "." : "",
*path_ext ? path_ext : "");
- if (fb->add_existed && ! is_replaced)
+ if (fb->add_existed)
{
SVN_ERR(get_empty_tmp_file(&merge_left, eb->db,
pb->local_abspath,
@@ -3961,7 +3955,7 @@ merge_file(svn_skel_t **work_items,
if (merge_outcome == svn_wc_merge_conflict)
*content_state = svn_wc_notify_state_conflicted;
- else if (new_text_base_sha1_checksum)
+ else if (fb->new_text_base_sha1_checksum)
{
if (is_locally_modified)
*content_state = svn_wc_notify_state_merged;
@@ -4198,8 +4192,7 @@ close_file(void *file_baton,
/* Merge the text. This will queue some additional work. */
SVN_ERR(merge_file(&all_work_items, &install_pristine, &install_from,
- &content_state, fb, fb->new_text_base_sha1_checksum,
- pool, scratch_pool));
+ &content_state, fb, pool, scratch_pool));
if (install_pristine)
{
@@ -4218,7 +4211,7 @@ close_file(void *file_baton,
install_from,
eb->use_commit_times,
record_fileinfo,
- pool, pool));
+ pool, scratch_pool));
all_work_items = svn_wc__wq_merge(all_work_items, work_item, pool);
}
}
RE: svn commit: r1084971 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Greg Stein [mailto:gstein@gmail.com]
> Sent: donderdag 24 maart 2011 18:37
> To: dev@subversion.apache.org
> Subject: Re: svn commit: r1084971 -
> /subversion/trunk/subversion/libsvn_wc/update_editor.c
>
> On Thu, Mar 24, 2011 at 13:33, Greg Stein <gs...@gmail.com> wrote:
> > On Thu, Mar 24, 2011 at 10:39, <rh...@apache.org> wrote:
> >>...
> >> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Mar 24
> 14:39:55 2011
> >>...
> >> @@ -3615,10 +3609,10 @@ merge_file(svn_skel_t **work_items,
> >> *install_pristine = FALSE;
> >> *install_from = NULL;
> >>
> >> - if (new_text_base_sha1_checksum != NULL)
> >> + if (fb->new_text_base_sha1_checksum != NULL)
> >> SVN_ERR(svn_wc__db_pristine_get_path(&new_text_base_tmp_abs
> path,
> >> - eb->db, fb->local_abspath,
> >> - new_text_base_sha1_checksum,
> >> + eb->db, pb->local_abspath,
> >> +
fb->new_text_base_sha1_checksum,
> >> pool, scratch_pool));
> >
> > Euh... I don't think you meant to replace fb->local_abspath with pb->
> > ... did you? That sounds quite incorrect. IIRC, that would be asking
> > for the pristine path of the containing directory.
>
> Ah... never mind. That is the WRI_ABSPATH. The checksum is the key input.
Yes, this was intended.
And the parent directory is in the wc_db hashtable, while the files aren't.
So this could avoid a disk stat in the current implementation, while it
should still be safe in the future.
Bert
Re: svn commit: r1084971 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Posted by Greg Stein <gs...@gmail.com>.
On Thu, Mar 24, 2011 at 13:33, Greg Stein <gs...@gmail.com> wrote:
> On Thu, Mar 24, 2011 at 10:39, <rh...@apache.org> wrote:
>>...
>> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Mar 24 14:39:55 2011
>>...
>> @@ -3615,10 +3609,10 @@ merge_file(svn_skel_t **work_items,
>> *install_pristine = FALSE;
>> *install_from = NULL;
>>
>> - if (new_text_base_sha1_checksum != NULL)
>> + if (fb->new_text_base_sha1_checksum != NULL)
>> SVN_ERR(svn_wc__db_pristine_get_path(&new_text_base_tmp_abspath,
>> - eb->db, fb->local_abspath,
>> - new_text_base_sha1_checksum,
>> + eb->db, pb->local_abspath,
>> + fb->new_text_base_sha1_checksum,
>> pool, scratch_pool));
>
> Euh... I don't think you meant to replace fb->local_abspath with pb->
> ... did you? That sounds quite incorrect. IIRC, that would be asking
> for the pristine path of the containing directory.
Ah... never mind. That is the WRI_ABSPATH. The checksum is the key input.
Cheers,
-g
Re: svn commit: r1084971 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Posted by Greg Stein <gs...@gmail.com>.
On Thu, Mar 24, 2011 at 10:39, <rh...@apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Mar 24 14:39:55 2011
>...
> @@ -3615,10 +3609,10 @@ merge_file(svn_skel_t **work_items,
> *install_pristine = FALSE;
> *install_from = NULL;
>
> - if (new_text_base_sha1_checksum != NULL)
> + if (fb->new_text_base_sha1_checksum != NULL)
> SVN_ERR(svn_wc__db_pristine_get_path(&new_text_base_tmp_abspath,
> - eb->db, fb->local_abspath,
> - new_text_base_sha1_checksum,
> + eb->db, pb->local_abspath,
> + fb->new_text_base_sha1_checksum,
> pool, scratch_pool));
Euh... I don't think you meant to replace fb->local_abspath with pb->
... did you? That sounds quite incorrect. IIRC, that would be asking
for the pristine path of the containing directory.
And assuming that... why did this not create test failures?
>...
Cheers,
-g