files whose content changed after EOL filtering erroneously marked as modified

Bug #362030 reported by Benoit Pierre
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Ian Clatworthy

Bug Description

Using the latest bzr.dev version (1.15dev) and the script attached (WARNING, this script will change you ~/.bazaar/rules and delete any "test" file/dir in the current working directory), here is what I get:

~/tmp # ./test.sh
+./test.sh:5> rm -rf test
+./test.sh:7> mkdir test
+./test.sh:8> tee /home/bpierre/.bazaar/rules
[name *]
eol = lf
+./test.sh:12> bzr init --format 1.14 test/trunk
Created a standalone tree (format: 1.14)
+./test.sh:13> bzr help > test/trunk/text
+./test.sh:14> file test/trunk/text
test/trunk/text: ASCII text
+./test.sh:15> bzr add test/trunk/text
adding text
+./test.sh:16> bzr commit -m 1 test/trunk
Committing to: /home/bpierre/tmp/test/trunk/
added text
Committed revision 1.
+./test.sh:17> bzr co --lightweight test/trunk test/work
+./test.sh:18> file test/work/text
test/work/text: ASCII text
+./test.sh:19> bzr stat test/work
+./test.sh:20> bzr diff test/work
+./test.sh:21> bzr zap test/work
+./test.sh:22> tee /home/bpierre/.bazaar/rules
[name *]
eol = crlf
+./test.sh:26> bzr co --lightweight test/trunk test/work
+./test.sh:27> file test/work/text
test/work/text: ASCII text, with CRLF line terminators
+./test.sh:28> bzr stat test/work
modified:
  text
+./test.sh:29> bzr diff test/work
=== modified file 'text'

If I remove the 'text' file and then revert it, EOLs get changed to LF. If I use a non-lightweight checkout, and do a 'bzr remove-tree --force' followed by 'bzr checkout', then EOLs get also changed to LF.

Revision history for this message
Benoit Pierre (benoit.pierre) wrote :
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Fritz Jalvingh also reported on 28/May/2009 ...

I'm trying to get the new EOL conversion support to work on my existing
repostories but am running into some trouble.

Initially I could not get the filters to work at all. I created a shared
repository using init-repo --1.14-rich-root, then branched an existing repo
into there. Whatever I did in that repo - no filter action was taking place.

After some debugging I found out that not only the shared repo needs a proper
format but the branched repo needs a higher format too... It used working tree
format 4 while at least 5 was needed... That was not very clear to me (first
time I ever encountered a working tree format) - it might be a good idea to at
least put that in the reference documentation.
It might also be a good idea to at least show a warning when someone tries to
use EOL filtering while the underlying format(s) do not support it - it now
failed without any indication and that was hard to debug; I only found out
about this after lavishly sprinkling print statements thru the bazaar source
code ;-)

OK, now filtering works but I have something unexpected. I'm running on Linux,
and all of my filtered files have been commited using lf eols (in the
repository).

So, as a test, I added eol = crlf to the rules file for all files and branched.
The result was a filtered working tree (files have crlf line endings) but all of
these files show as "modified". bzr status shows all 8000 of them as modified;
doing a bzr diff on a file shows no changes:

jal@pyramides:~/new2/trunk$ bzr diff to.etc.domui/.classpath
=== modified file 'to.etc.domui/.classpath'

I tried commiting; it commits all of these files but after the commit all files
are still changed....

For me this means eol filtering is currently unusable.

I might do something wrong but I have no idea what..

My shared repo shows:

jal@pyramides:~/new2$ bzr info --verbose
Shared repository with trees (format: 1.14-rich-root or 1.9-rich-root)
Location:
  shared repository: .

Format:
       control: Meta directory format 1
    repository: Packs 6 rich-root (uses btree indexes, requires bzr 1.9)

Create working tree for new branches inside the repository.

Repository:
      5788 revisions

The underlying repo (filtered with problems) shows:

jal@pyramides:~/new2/trunk$ bzr info --verbose
Repository tree (format: 1.14-rich-root)
Location:
  shared repository: /home/jal/new2
  repository branch: .

Related branches:
  parent branch: /home/jal/new/trunk

Format:
       control: Meta directory format 1
  working tree: Working tree format 5
        branch: Branch format 7
    repository: Packs 6 rich-root (uses btree indexes, requires bzr 1.9)

In the working tree:
      5319 unchanged
      8679 modified
         0 added
         0 removed
         0 renamed
         0 unknown
         0 ignored
      1513 versioned subdirectories

Branch history:
      1195 revisions
       357 days old
   first revision: Thu 2008-06-05 23:32:54 +0200
  latest revision: Thu 2009-05-28 18:22:41 +0200

Repository:
      5788 revisions

Changed in bzr:
assignee: nobody → Ian Clatworthy (ian-clatworthy)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Here's the email thread re Frits' problem: https://lists.ubuntu.com/archives/bazaar/2009q2/058930.html.

Revision history for this message
John A Meinel (jameinel) wrote :

just targetting 1.16 so we don't forget

Changed in bzr:
milestone: none → 1.16
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

in bzr.dev r4431

Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.