You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Vincent Lefevre <vi...@vinc17.org> on 2007/02/12 14:46:36 UTC

[RFE] Re: rename and diff

On 2007-02-12 13:58:27 +0100, Ulrich Eckhardt wrote:
> On Monday 12 February 2007 06:01, Dave Grundgeiger wrote:
> > Hi. I'm familiar with Subversion but not an expert. I want to
> > rename a file in a working copy and then produce a patch
> > representing the rename. I'm doing the following:
> >
> > svn rename oldname.txt newname.txt
> > svn diff
> >
> > The resulting diff contains the deletion of oldname.txt, but not
> > the addition of newname.txt. Is this the intended behavior?
> 
> diff files can't represent moved/renamed files, the format simply
> doesn't allow it. Same problem applies to directories (only
> implicitly by creating files therein), deleting files (only via
> making them empty) or adding files (only via giving them content).

I don't think you really answer the question. When there is an
addition, svn does show the addition. Now, the rename is just a
copy + a delete. The delete is shown as expected. When there is a
copy, svn shows the diff against the old version; when there are
no diffs (i.e. one just has a copy, not a copy + modifications),
svn doesn't show anything. I wonder if svn shouldn't output:

Index: newname.txt (copied)
===================================================================

like it does for deleted files, or even:

Index: newname.txt (copied from oldname.txt)
===================================================================

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

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

Re: [RFE] Re: rename and diff

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2007-02-12 09:46:14 -0600, Dave Grundgeiger wrote:
> Yes, you're right. If I do this:
> 
> svn add newFile.txt
> svn diff
> 
> I get output, but if I do this:
> 
> svn copy oldFile.txt newFile.txt
> svn diff
> 
> I get no output, even though the status on newFile.txt is "Added."
> 
> Including --notice-ancestry on the diff made no difference.

This is the problem. IMHO, with --notice-ancestry, "svn diff" should
consider ancestry for newFile.txt, i.e. it should notice that it has
been copied from oldFile.txt, and as there hasn't been any change, it
should output nothing (this is the current behavior, which is correct
in this case). But now, if --notice-ancestry is not given, "svn diff"
should compare newFile.txt with the old newFile.txt version, and as
newFile.txt (under that name) is new, it should output the diff like
"svn add"; but it doesn't, and I think this is a bug.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

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

Re: [RFE] Re: rename and diff

Posted by Dave Grundgeiger <da...@codenouveau.com>.
Vincent Lefevre
> When there is an
> addition, svn does show the addition. Now, the rename is just a
> copy + a delete. The delete is shown as expected. When there is a
> copy, svn shows the diff against the old version; when there are
> no diffs (i.e. one just has a copy, not a copy + modifications),
> svn doesn't show anything. I wonder if svn shouldn't output:

Yes, you're right. If I do this:

svn add newFile.txt
svn diff

I get output, but if I do this:

svn copy oldFile.txt newFile.txt
svn diff

I get no output, even though the status on newFile.txt is "Added."

Including --notice-ancestry on the diff made no difference.

Dave

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