You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Marcus Rueckert <da...@web.de> on 2005/11/01 16:58:00 UTC

svn diff and keywords

hi,


[[[
$ export R="svn://anonsvn.kde.org/home/kde"
$ svn diff \
    --old $R/tags/KDE/3.4.92/kdelibs/kio/kio/kservicegroup.cpp \
    --new $R/branches/KDE/3.5/kdelibs/kio/kio/kservicegroup.cpp \
    > 3_5_BRANCH.diff
]]]

the resulting chunk will look like that:

[[[
Index: kservicegroup.cpp
===================================================================
--- kservicegroup.cpp   (.../tags/KDE/3.4.92/kdelibs/kio/kio/kservicegroup.cpp) (revision 476607)
+++ kservicegroup.cpp   (.../branches/KDE/3.5/kdelibs/kio/kio/kservicegroup.cpp)        (revision 476607)
@@ -16,8 +16,6 @@
  *  Boston, MA 02110-1301, USA.
  **/

-// $Id$
-
 #include <kiconloader.h>
 #include <kglobal.h>
 #include <kstandarddirs.h>
]]]

Stephan Kulow from the kde team asked if it possible to get diffs with expanded
keywords.  This patch doesnt apply cleanly against tarballs. This time it is
just one hunk, which needs to be fixed.

Would it be ok to add an option that tells diff to expand the keywords? Is it
possible at all?

with kind regards

    darix

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

Re: svn diff and keywords

Posted by Julian Foad <ju...@btopenworld.com>.
Marcus Rueckert wrote:
> $ export R="svn://anonsvn.kde.org/home/kde"
> $ svn diff \
>     --old $R/tags/KDE/3.4.92/kdelibs/kio/kio/kservicegroup.cpp \
>     --new $R/branches/KDE/3.5/kdelibs/kio/kio/kservicegroup.cpp \
>     > 3_5_BRANCH.diff
[...]
> Would it be ok to add an option that tells diff to expand the keywords? Is it
> possible at all?

In this case, where you want the diff between two exported files or trees, I 
think you should export them and then use a regular (non-Subversion) "diff" 
program:

   svn export $R/tags/KDE/3.4.92/kdelibs/kio/kio/kservicegroup.cpp d1/
   svn export $R/branches/KDE/3.5/kdelibs/kio/kio/kservicegroup.cpp d2/
   diff d1/ d2/ > 3_5_BRANCH.diff

This seems to be an obvious and simple solution, so I don't think we should 
enhance "svn diff" to do this, though it is certainly possible to do so.

- Julian

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

Re: svn diff and keywords

Posted by Joshua Varner <jl...@gmail.com>.
On 11/1/05, Marcus Rueckert <da...@web.de> wrote:
> On 2005-11-01 11:08:43 -0600, Joshua Varner wrote:
> >  http://subversion.tigris.org/issues/show_bug.cgi?id=2164
>
> i dont think thats 100% the same. the expanded version of the tag is in
> the tarball (svn export). the repos had the already changes for the file
> after the conversion from CVS.
>
Different symptom - same problem. The following recipe shows the
same kind of behavior you are talking about. It all comes from the fact
that we output the normalized line from the diff rather than the original.

Josh

In the www dir of subversion repos

$ sed -e "s/\$Date/hi \$Date/;" < subversion-linus.html >subversion-linus2.html

# I had to use -b b/c of cygwin line ending stuff
$ diff -b subversion-linus.html subversion-linus2.html
83c83
< <p>$Date: 2005-04-22 04:45:33 -0500 (Fri, 22 Apr 2005) $</p>
---
> <p>hi $Date: 2005-04-22 04:45:33 -0500 (Fri, 22 Apr 2005) $</p>

$ mv subversion-linus2.html subversion-linus.html

$ svn diff subversion-linus.html
Index: subversion-linus.html
===================================================================
--- subversion-linus.html       (revision 16345)
+++ subversion-linus.html       (working copy)
@@ -80,7 +80,7 @@

 <p><b>-The Subversion Development Team</b></p>

-<p>$Date$</p>
+<p>hi $Date$</p>
 </div>
 </body>
 </html>

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


Re: svn diff and keywords

Posted by Marcus Rueckert <da...@web.de>.
On 2005-11-01 11:08:43 -0600, Joshua Varner wrote:
>  http://subversion.tigris.org/issues/show_bug.cgi?id=2164

i dont think thats 100% the same. the expanded version of the tag is in
the tarball (svn export). the repos had the already changes for the file
after the conversion from CVS.

darix

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

Re: svn diff and keywords

Posted by Joshua Varner <jl...@gmail.com>.
On 11/1/05, Marcus Rueckert <da...@web.de> wrote:
> hi,
>
>
> [[[
> $ export R="svn://anonsvn.kde.org/home/kde"
> $ svn diff \
>     --old $R/tags/KDE/3.4.92/kdelibs/kio/kio/kservicegroup.cpp \
>     --new $R/branches/KDE/3.5/kdelibs/kio/kio/kservicegroup.cpp \
>     > 3_5_BRANCH.diff
> ]]]
>
> the resulting chunk will look like that:
>
> [[[
> Index: kservicegroup.cpp
> ===================================================================
> --- kservicegroup.cpp   (.../tags/KDE/3.4.92/kdelibs/kio/kio/kservicegroup.cpp) (revision 476607)
> +++ kservicegroup.cpp   (.../branches/KDE/3.5/kdelibs/kio/kio/kservicegroup.cpp)        (revision 476607)
> @@ -16,8 +16,6 @@
>   *  Boston, MA 02110-1301, USA.
>   **/
>
> -// $Id$
> -
>  #include <kiconloader.h>
>  #include <kglobal.h>
>  #include <kstandarddirs.h>
> ]]]
>
> Stephan Kulow from the kde team asked if it possible to get diffs with expanded
> keywords.  This patch doesnt apply cleanly against tarballs. This time it is
> just one hunk, which needs to be fixed.
>
> Would it be ok to add an option that tells diff to expand the keywords? Is it
> possible at all?
>
 http://subversion.tigris.org/issues/show_bug.cgi?id=2164

Known problem - no solution yet.

Josh

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