2009年4月28日 星期二

GoogleCode 加檔案的時候使用瀏覽器看subversion檔案時有些property要設定,不然不會正常動作

googlecode 使用瀏覽器(至少firefox)看subversion檔案時有些property要設定,不然瀏覽器可能不會正常動作,如html/xml直接當text檔dump內容給你、或者是處理上可能會導致誤動作,如給gpx檔以為是text就不分析了 之類的鳥事...

gpx 要加 property- svn:mime-type = text/xml
htm/html 要加 property- svn:mime-type = text/html

http://svnbook.red-bean.com/en/1.1/ch07s02.html

svn:mime-type

The svn:mime-type property serves many purposes in Subversion. Besides being a general-purpose storage location for a file's Multipurpose Internet Mail Extensions (MIME) classification, the value of this property determines some behavioral characteristics of Subversion itself.

For example, if a file's svn:mime-type property is set to a non-text MIME type (generally, something that doesn't begin with text/, though there are exceptions), Subversion will assume that the file contains binary—that is, not human-readable—data. One of the benefits that Subversion typically provides is contextual, line-based merging of changes received from the server during an update into your working file. But for files believed to contain binary data, there is no concept of a “line”. So, for those files, Subversion does not attempt to perform contextual merges during updates. Instead, any time you have locally modified a binary working copy file that is also being updated, your file is renamed with a .orig extension, and then Subversion stores a new working copy file that contains the changes received during the update, but not your own local modifications, at the original filename. This behavior is really for the protection of the user against failed attempts at performing contextual merges on files that simply cannot be contextually merged.

Also, if the svn:mime-type property is set, then the Subversion Apache module will use its value to populate the Content-type: HTTP header when responding to GET requests. This gives a crucial clue about how to display a file when perusing your repository with a web browser.

沒有留言: