[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 09:17:22 -0400

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.

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

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

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.