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

Re: TSVN: unexpected behavior creating patch from file with svn:mime-type set to application/javascript

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 01 Apr 2009 17:46:54 +0200

webpost_at_tigris.org wrote:
> Hi TortoiseSVN team,
>
> First of all, congratulations of this great project which eases version control so much! I understand the power of command-line utilities (svn*), but having visual feedback and shell integration is *very* nice, specially for occasional and/or users used to IDE environments. ;-)
>
> TortoiseSVN seems to fail in creating a patch if the MIME type is set (apparently, to application/*). This set of MIME types generally designates binary files, although it's also used for some textual content also.
>
>
> Steps to reproduce:
> 1. Checkout a project containing files with "svn:mime-type" set to "application/javascript" (for example, xmlhttprequest [1]);
> 2. Make local modification(s);
> 3. Use TortoiseSVN context menu "Create patch..." to create a patch containing the modification.
>
>
> Expected result:
> Patch file containing the modifications made.
>
>
> Actual result:
> Patch file containing an error message similar to:
> Cannot display: file marked as a binary type.
> svn:mime-type = application/javascript
>
>
> Workaround:
> 1. Copy the file containing the modification(s);
> 2. Revert local modification(s);
> 3. Create a patch between the file in control version and the copy containing the local changes.
>
> This is probably unfeasible for a set of modified files, and has the caveat of not containing revision information (date is used instead), but may be of use for anyone experiencing similar behavior.
>
>
> Version details:
> TortoiseSVN 1.6.0, Build 15855 - 32 Bit , 2009/03/21 12:36:36
>
>
> Attachment:
> File containing a sample result:
> TortoiseSVN-ErrorWhileGeneratingPatchWithApplicationJavascriptMimeType-Result.patch
>
>
> Additional information:
> There seem to be a few somehow related messages [2] in the mailing list, but I wasn't able to find any tightly related.
>
> By taking a look at a tightly related specification [3], it seems that some particular application/* MIME types should be supported (at least, the ones in the specification, "application/javascript" and "application/ecmascript"). This is specially relevant as the currently used MIME types (text/*) for JavaScript/ECMAScript files are deprecated and should slowly fade out with time. The proposal, if TortoiseSVN does handle application/* MIME types as designating binary files, is to add a list of exceptions to handle as text.

Subversion treats all files which don't have an svn:mime-type property
that's set to 'text/...' as binary files. The patch file is created by
Subversion, so that's why you see files with a mime-type set to
'application/...' not included in the patchfile.

For your javascript files, I suggest you set the svn:mime-type property
to 'text/javascript'.

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=1508210
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2009-04-01 17:47:10 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.