[ANN] EOL conversion support now in bzr.dev
Brian de Alwis
bsd at cs.ubc.ca
Sun Apr 5 01:21:21 BST 2009
On 4-Apr-2009, at 6:06 PM, Brian de Alwis wrote:
> If I explicitly import bzrlib.filters.eol at the end of bzrlib/
> rules.py, then 'bzr -Dfilters cat --filters' does show a message
> about a content-filter found, and the content is suitably filtered.
>
> But revert of the file does not seem to do the right thing.
> Interestingly, 'bzr -Dfilters revert' only reports a content-filter
> on a second revert (with my "==>" removed) and sometimes the third
> revert; regardless, the filter doesn't seem to be applied:
>
> $ /scratch/dev/bzr-1.14/bzr init --1.14 test
> Created a standalone tree (format: 1.14)
>
> $ cd test
>
> $ cat >test.cs
> this
> is
> a
> test
>
> $ cat > ~/.bazaar/rules
> [name *.cs]
> eol = lf-with-crlf-in-repo
>
> $ /scratch/dev/bzr-1.14/bzr add
> adding test.cs
>
> $ /scratch/dev/bzr-1.14/bzr -Dfilters commit -m 'Should be
> transformed'
> Committing to: /private/tmp/test/
> added test.cs
> *** test.cs content-filter: (('eol', u'lf-with-crlf-in-repo'),) =>
> [reader: <function _to_crlf_converter at 0x7b0730>, writer:
> <function _to_lf_converter at 0x7b06f0>]
> Committed revision 1.
Although revert on test.cs doesn't seem to do anything, making a copy
of this branch with 'bzr branch' does do the right thing:
$ cd ..
$ /scratch/dev/bzr-1.14/bzr -Dfilters branch test test2
*** test.cs content-filter: (('eol', u'lf-with-crlf-in-repo'),) =>
[reader: <function _to_crlf_converter at 0x7b0730>, writer: <function
_to_lf_converter at 0x7b06f0>]
*** test.cs content-filter: (('eol', u'lf-with-crlf-in-repo'),) =>
[reader: <function _to_crlf_converter at 0x7b0730>, writer: <function
_to_lf_converter at 0x7b06f0>]
Branched 1 revision(s).
$ hexdump -C test2/test.cs
00000000 74 68 69 73 0a 69 73 0a 61 0a 74 65 73 74 0a |
this.is.a.test.|
0000000f
--
"Amusement to an observing mind is study." - Benjamin Disraeli
More information about the bazaar
mailing list