Size: 1771
Comment: minor wording fix and say dangerous more loudly
|
← Revision 6 as of 2012-11-12 15:43:46 ⇥
Size: 1688
Comment: add note about UTF-8 with BOM
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
Download site: http://bitbucket.org/yuja/hgext-textful/ | Repository: http://bitbucket.org/yuja/hgext-textful/ |
Line 11: | Line 11: |
This ''experimental'' extension tries to convert unreadable binary content to plain text when displaying, | This extension tries to convert unreadable binary content to plain text when displaying, |
Line 17: | Line 17: |
* `textful.msexcel`: Microsoft Excel (*.xls), requires pyExcelerator | * `textful.msexcel`: Microsoft Excel (*.xls), requires xlrd or pyExcelerator |
Line 19: | Line 19: |
'''This extension is dangerous''' because it mangles fctx.data. Though it tries not to execute destructive function with the wrapped fctx.data, it may lead the repository to inconsistent state. |
|
Line 45: | Line 41: |
# specify 'utf-8-sig' for UTF-8 with BOM, which is commonly used in Microsoft applications | |
Line 65: | Line 62: |
pipe.doc = catdoc -w $< | pipe.doc = antiword -w0 $< # or # pipe.doc = catdoc -w $< |
Textful Extension
This extension is not distributed with Mercurial.
Author: Yuya Nishihara
Repository: http://bitbucket.org/yuja/hgext-textful/
Overview
This extension tries to convert unreadable binary content to plain text when displaying, so that you can see decent diff of binary files.
Currently supports the following conversions:
textful.encoding: convert character encoding
textful.msexcel: Microsoft Excel (*.xls), requires xlrd or pyExcelerator
textful.pipe: filter by external command, e.g. catdoc for Microsoft Word (*.doc)
Configuration
Configure your .hgrc to enable the extension by adding following lines:
[extensions] textful = /path/to/hgext/textful #textful.encoding = /path/to/hgext/textful/encoding.py #textful.msexcel = /path/to/hgext/textful/msexcel.py #textful.pipe = /path/to/hgext/textful/pipe.py
To enable conversion of character encoding for Japanese:
[extensions] textful = /path/to/hgext/textful textful.encoding = /path/to/hgext/textful/encoding.py [textful] encoding = utf-8, euc-jp, cp932, iso-2022-jp # specify 'utf-8-sig' for UTF-8 with BOM, which is commonly used in Microsoft applications
To add textful cat command without breaking original cat:
[alias] scat = cat [textful] attend = annotate, diff, glog, log, qdiff, scat
To textize Microsoft Word document (*.doc):
[extensions] textful = /path/to/hgext/textful textful.pipe = /path/to/hgext/textful/pipe.py [textful] pipe.doc = antiword -w0 $< # or # pipe.doc = catdoc -w $<