[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: $Header$ confuses TortoiseMerge

From: Andy Levy <andy.levy_at_gmail.com>
Date: Wed, 8 Sep 2010 11:43:05 -0400

On Wed, Sep 8, 2010 at 09:17, Andy Levy <andy.levy_at_gmail.com> wrote:
> On Wed, Sep 8, 2010 at 08:58, Felix Saphir <felix.saphir_at_kantarmedia.de> wrote:
>> Am 08.09.2010 14:43, schrieb Andy Levy:
>>> On Tue, Sep 7, 2010 at 22:32, NODA, Kai<nodakai_at_gmail.com>  wrote:
>>>>
>>>> When the keyword substitution of $Header$ is enabled,
>>>> "Apply patch" functionality is confused and always results in
>>>> "The patch seems outdated" error, provided that
>>>> the context of a hunk includes $Header$.
>>>>
>>>> How to reproduce:
>>>>   1. Prepare empty repo at C:\tsvnTest\repo
>>>>   2. Checkout it to C:\tsvnTest\wdir
>>>>   3. Create C:\tsvnTest\README.txt whose contents is as follows (three lines):
>>>> ===BEGIN CONTENTS OF README.txt===
>>>> $Header:$
>>>>
>>>> Thank you.
>>>> ===END CONTENTS OF README.txt===
>>>>   4. Add it to the repo and set svn:keywords property to "Header"
>>>>   5. Commit the changeset.
>>>>   6. Edit the third line; substitute "Thank you" with "No thank you"
>>>>   7. "Create patch" yields something like
>>>>
>>>> Index: README.txt
>>>> ===================================================================
>>>> --- README.txt  (revision 1)
>>>> +++ README.txt  (working copy)
>>>> @@ -1,3 +1,3 @@
>>>>   $Header$
>>>>
>>>> -Thank you.
>>>> +No thank you.
>>>>
>>>>   8. Save the patch as C:\wdir\no.patch
>>>>   9. Revert README.txt
>>>>   10. Try to apply no.patch; but you'll encounter "The patch seems outdated" error.
>>>>
>>>> Additional note:
>>>> Using $Id$ $Date$ $Rev$ or $URL$ doesn't cause this annoyance.
>>>>
>>>
>>> $Header$ isn't a Subversion keyword. The list of keywords is Date,
>>> LastChangedDate, Revision, LastChangedRevision, Rev, Author,
>>> LastChangedBy, HeadURL, URL&  Id
>>> http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html
>>> (or if you prefer the TSVN docs,
>>> http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html#tsvn-dug-propertypage-props)
>>>
>>> The fact that $Header$ isn't one of the expanded keywords may or may
>>> not be causing your issue, but you should be aware that it's not going
>>> to work the way you expect.
>>
>> Funny thing is, after step 5 (committing the original file) $Header$
>> *is* expanded to something like:
>>
>> | $Header: file:/[...]/Readme.txt 1 2010-09-08 12:51:37Z felixsaphir $
>>
>> When I try to apply the patch, the error message is:
>>
>> | ---------------------------
>> | TortoiseMerge
>> | ---------------------------
>> | The patch seems outdated! The file line
>> | $Header$
>> | and the patchline
>> | $Header: file:/[...]/Readme.txt 1 2010-09-08 12:51:37Z felixsaphir $
>> | do not match!
>> | ---------------------------
>> | OK
>> | ---------------------------
>>
>> I'm using TortoiseSVN 1.6.9.19725 with svn libs 1.6.12
>
> OK, a little more:
>
> $Header$ is a new keyword as of SVN 1.6. From main.c (svn help propset
> will report the keyword with this help text):
>
> "Similar to Id but includes the full URL"
>
> It's also defined in svn_types.h:
> /** A full combination of the first four keywords.
>  * @since New in 1.6. */
> #define SVN_KEYWORD_HEADER           "Header"
>
> And bash_completion (for shell tab completion)
>
> svn:keywords)
>                    # just a subset?
>                    values="Id Rev URL Date Author Header \' $SVN_BASH_KEYWORDS"
>                    ;;
>
> And here's the actual expansion done in subst.c:
>
> header_val = keyword_printf("%u %r %d %a", rev, url, date, author, pool);
>
> I don't have time right now (maybe this evening, if someone doesn't
> beat me to it) to reproduce with the command-line client to see if a
> bug needs to be reported on the main SVN list. Sounds like both
> manuals (TSVN & Subversion) need to be updated w/ this new keyword too
> - but maybe not until the behavior's buginess is confirmed or refuted.

Replying to myself once again, it turns out that I do have some time.
Using SVN 1.6.6 on the command-line and patch 2.5.9 from
http://gnuwin32.sourceforge.net/packages/patch.htm I followed the OP's
steps and the output I get from patch is:

C:\_Projects\_Local\TestCode\test>patch -p0 < change.patch
patching file README.txt
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

change.patch is the output of svn diff redirected to a file and just
contains this:

Index: README.txt
===================================================================
--- README.txt (revision 616)
+++ README.txt (working copy)
@@ -1,3 +1,3 @@
 $Header$

-Thank you.
\ No newline at end of file
+No thank you
\ No newline at end of file

With TortoiseMerge (32-bit build of the same version the OP is using),
I get the same results as the OP.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2656876

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-09-08 17:43:58 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.