You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2004/09/20 12:58:13 UTC

Re: svn commit: r11035 - in trunk/subversion: libsvn_wc tests/clients/cmdline

jpieper@tigris.org writes:
> Log:
> Correctly display diffs of scheduled-add symlinks.
> 
> * subversion/libsvn_wc/diff.c
>   (file_diff): Look at the translated version of files when diffing a
>     schedule-add file.
> 
> * subversion/tests/clients/cmdline/special_tests.py
>   (general_symlink): Do a quick diff before committing our first
>     symlink in this test.

It looks like this fixes not only a bug in diffing scheduled-add
symlinks, but a bug in diffing any scheduled-add file that contains
(say) keywords and (say) has the appropriate svn:keywords property
value.

Is that the case?  Or is there some subtle reason why this change only
affects symlink files?

-Karl

> Modified: trunk/subversion/libsvn_wc/diff.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_wc/diff.c?view=diff&rev=11035&p1=trunk/subversion/libsvn_wc/diff.c&r1=11034&p2=trunk/subversion/libsvn_wc/diff.c&r2=11035
> ==============================================================================
> --- trunk/subversion/libsvn_wc/diff.c	(original)
> +++ trunk/subversion/libsvn_wc/diff.c	Fri Sep 17 17:49:09 2004
> @@ -468,6 +468,7 @@
>    svn_boolean_t copied = entry->copied;
>    svn_wc_adm_access_t *adm_access;
>    const char *pristine_mimetype, *working_mimetype;
> +  const char *translated;
>  
>    SVN_ERR (svn_wc_adm_retrieve (&adm_access, dir_baton->edit_baton->anchor,
>                                  dir_baton->path, pool));
> @@ -527,14 +528,19 @@
>                                      adm_access, path, pool));
>  
>        if (! eb->use_text_base)
> -        SVN_ERR (dir_baton->edit_baton->callbacks->file_added
> -                 (NULL, NULL, path,
> -                  empty_file,
> -                  path,
> -                  0, entry->revision,
> -                  NULL,
> -                  working_mimetype,
> -                  dir_baton->edit_baton->callback_baton));
> +        {
> +          SVN_ERR (svn_wc_translated_file (&translated, path, adm_access,
> +                                           TRUE, pool));
> +
> +          SVN_ERR (dir_baton->edit_baton->callbacks->file_added
> +                   (NULL, NULL, path,
> +                    empty_file,
> +                    translated,
> +                    0, entry->revision,
> +                    NULL,
> +                    working_mimetype,
> +                    dir_baton->edit_baton->callback_baton));
> +        }
>  
>        SVN_ERR (svn_wc_props_modified_p (&modified, path, adm_access, pool));
>        if (modified && (! eb->use_text_base))
> @@ -560,7 +566,6 @@
>                                         adm_access, pool));
>        if (modified && (! eb->use_text_base))
>          {
> -          const char *translated;
>            svn_error_t *err, *err2 = SVN_NO_ERROR;
>  
>            pristine_copy = svn_wc__text_base_path (path, FALSE, pool);   
> 
> Modified: trunk/subversion/tests/clients/cmdline/special_tests.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/tests/clients/cmdline/special_tests.py?view=diff&rev=11035&p1=trunk/subversion/tests/clients/cmdline/special_tests.py&r1=11034&p2=trunk/subversion/tests/clients/cmdline/special_tests.py&r2=11035
> ==============================================================================
> --- trunk/subversion/tests/clients/cmdline/special_tests.py	(original)
> +++ trunk/subversion/tests/clients/cmdline/special_tests.py	Fri Sep 17 17:49:09 2004
> @@ -55,6 +55,17 @@
>      'linktarget' : Item(verb='Adding'),
>      })
>  
> +  # Run a diff and verify that we get the correct output
> +  stdout_lines, stderr_lines = svntest.main.run_svn(1, 'diff', wc_dir)
> +  
> +  regex = '^\+link linktarget'
> +  for line in stdout_lines:
> +    if re.match(regex, line):
> +      break
> +  else:
> +    raise svntest.Failure
> +  
> +  # Commit and make sure everything is good
>    expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
>    expected_status.tweak(wc_rev=1)
>    expected_status.add({
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r11035 - in trunk/subversion: libsvn_wc tests/clients/cmdline

Posted by Andy Whitcroft <ap...@shadowen.org>.
On Monday 20 September 2004 18:22, Josh Pieper wrote:

> I believe that is the case, however, it is unlikely that someone would
> add a new file with already expanded keywords, so it was probably
> never noticed before.

I've not looked at the patch, but am wondering if this could explain some odd 
behaviour that I only half noticed when I was recovering from some finger 
trouble with a persistant WC.  Would subversion prior to this patch have not 
correctly fixed kerwords in a file added which already contained expanded 
keywords.  In my case a file which was moved within the repository?

-apw

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r11035 - in trunk/subversion: libsvn_wc tests/clients/cmdline

Posted by Josh Pieper <jj...@pobox.com>.
kfogel@collab.net wrote:
> jpieper@tigris.org writes:
> > Log:
> > Correctly display diffs of scheduled-add symlinks.
> > 
> > * subversion/libsvn_wc/diff.c
> >   (file_diff): Look at the translated version of files when diffing a
> >     schedule-add file.
> > 
> > * subversion/tests/clients/cmdline/special_tests.py
> >   (general_symlink): Do a quick diff before committing our first
> >     symlink in this test.
> 
> It looks like this fixes not only a bug in diffing scheduled-add
> symlinks, but a bug in diffing any scheduled-add file that contains
> (say) keywords and (say) has the appropriate svn:keywords property
> value.
> 
> Is that the case?  Or is there some subtle reason why this change only
> affects symlink files?

I believe that is the case, however, it is unlikely that someone would
add a new file with already expanded keywords, so it was probably
never noticed before.

-Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org