win32 bzr is confused by filename case changes

Bug #77744 reported by Paul Pelzl on 2007-01-02
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Bazaar
High
Unassigned
Declined for 1.7 by Robert Collins
Declined for 1.8 by Robert Collins
Declined for Trunk by Robert Collins
Breezy
High
Jelmer Vernooij

Bug Description

bzr 0.14.0dev0 has some problems handling filename case changes on win32:

    C:\branchname>bzr inventory
    test.txt

    C:\branchname>ren test.txt TEST.TXT
    C:\branchname>bzr st
    unknown:
      TEST.TXT

At this point I would have expected to see:
    removed:
      test.txt
    unknown:
      TEST.TXT
(bzr 0.13 appears to get this part right.)

I could try to resolve things in a naive fashion:
    C:\branchname>bzr add TEST.TXT
    added TEST.TXT
    C:\branchname>bzr st
    added:
      TEST.TXT
    C:\branchname>bzr inventory
    TEST.TXT
    test.txt
If the tree gets committed in this state, then a subsequent "bzr branch branchname" will fail with a "File exists" error.
(bzr-0.13 will also let you screw up the inventory in this fashion, even though "bzr st" suggests that "test.txt"
is removed.)

A workaround is to explicitly "bzr remove" the original filename.

Alexander Belchenko (bialix) wrote :

this bug related to #77740: bzr lacks case insensitive filesystem support.

Changed in bzr:
importance: Undecided → Low
status: Unconfirmed → Confirmed
John A Meinel (jameinel) wrote :

This might actually be better with dirstate, because we use "os.listdir()" to give us the list of files, rather than relying on os.lstat(fname) to tell us if the file does or doesn't exist.

But it probably doesn't help bug #77740

Alexander Belchenko (bialix) wrote :

in some situation bzr tends to do wrong thing. for proper win32 support bzr should understand case-insensitive filesystem well.

Changed in bzr:
importance: Low → High
CodyC (cody-casterline) wrote :

Still exists with 1.5. See below:

C:\sample>bzr init .

C:\sample>bzr add .
added test.txt

C:\sample>bzr commit . -m "initial commit"
Committing to: C:/sample/
added test.txt
Committed revision 1.

C:\sample>bzr add TEST.TXT
added TEST.TXT

C:\sample>bzr ls -v
V test.txt

C:\sample>bzr commit . -m "huh?"
Committing to: C:/sample/
added TEST.TXT
Committed revision 2.

C:\sample>bzr ls -v
V test.txt

C:\sample>bzr log -v
------------------------------------------------------------
revno: 2
committer: Administrator <Administrator@CODY-9B4550D6D7>
branch nick: sample
timestamp: Thu 2008-07-03 01:25:17 +0100
message:
  huh?
added:
  TEST.TXT
------------------------------------------------------------
revno: 1
committer: Administrator <Administrator@CODY-9B4550D6D7>
branch nick: sample
timestamp: Thu 2008-07-03 01:24:37 +0100
message:
  initial commit
added:
  test.txt

C:\sample>bzr rm test.txt
deleted test.txt

C:\sample>bzr commit
Committing to: C:/sample/
missing TEST.TXT
deleted TEST.TXT
deleted test.txt
Committed revision 3.

C:\sample>bzr ls -v

C:\sample>bzr version
Bazaar (bzr) 1.5
  Python interpreter: C:\Program Files\Bazaar\python25.dll 2.5.2
  Python standard library: C:\Program Files\Bazaar\lib\library.zip
  bzrlib: C:\Program Files\Bazaar\lib\library.zip\bzrlib
  Bazaar configuration: C:\Documents and Settings\Administrator\Application Data
\bazaar\2.0
  Bazaar log file: C:\Documents and Settings\Administrator\My Documents\.bzr.log

Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

C:\sample>

displayname (displayname) wrote :

Sorry to post this twice, but I think it really belongs here. This is another facet of the same problem:

c:\temp\BzrBug>mkdir Branch1
c:\temp\BzrBug>mkdir Branch2
c:\temp\BzrBug>cd Branch1
c:\temp\BzrBug\Branch1>bzr init
c:\temp\BzrBug\Branch1>mkdir TEST
c:\temp\BzrBug\Branch1>cd TEST
c:\temp\BzrBug\Branch1\TEST>echo foo > foo
c:\temp\BzrBug\Branch1\TEST>bzr add foo
added TEST
added TEST/foo

c:\temp\BzrBug\Branch1\TEST>echo bar > bar
c:\temp\BzrBug\Branch1\TEST>cd..
c:\temp\BzrBug\Branch1>bzr add test\bar
added test
added test/bar

c:\temp\BzrBug\Branch1>bzr status
added:
  TEST/
  TEST/foo
unknown:
  TEST/bar

#### Above is the first sign that something is wrong.

c:\temp\BzrBug\Branch1>bzr commit
Committing to: C:/temp/BzrBug/Branch1/
added TEST
added test
added TEST/foo
added test/bar
Committed revision 1.

#### Notice that both TEST/foo and test/bar are added. However the real problem happens when you try to pull:

c:\temp\BzrBug\Branch1>cd..
c:\temp\BzrBug>cd Branch2

c:\temp\BzrBug\Branch2>bzr init
c:\temp\BzrBug\Branch2>bzr pull ..\Branch1
+N TEST/
+N TEST/foo
+N test.moved/
+N test.moved/bar
Conflict adding file TEST. Moved existing file to test.moved.
1 conflicts encountered.
Now on revision 1.

#### Changes from Branch1 cannot be properly pulled to Branch2 because bzr renames the directory during the pull.

This is a problem for me right now since I added many files with the wrong case a few days ago and now cannot pull my changes from my desktop to my laptop. A fix (or even just a workaround) would be greatly appreciated.

Thanks!

Gordon Tyler (doxxx) wrote :

Comment #5 appears to be fixed in Bazaar 2.0.0:

<<<
C:\Temp\bzr>bzr init .
Created a standalone tree (format: 2a)

C:\Temp\bzr>mkdir TEST

C:\Temp\bzr>cd TEST

C:\Temp\bzr\TEST>echo foo > foo

C:\Temp\bzr\TEST>bzr add foo
adding TEST
adding TEST/foo

C:\Temp\bzr\TEST>echo bar > bar

C:\Temp\bzr\TEST>cd ..

C:\Temp\bzr>bzr add test\bar
adding TEST/bar

C:\Temp\bzr>bzr st
added:
  TEST/
  TEST/bar
  TEST/foo
>>>

Although the original bug still seems to exist in a slightly different form:

<<<
C:\Temp\bzr>bzr init .
Created a standalone tree (format: 2a)

C:\Temp\bzr>echo foo > foo

C:\Temp\bzr>bzr add
adding foo

C:\Temp\bzr>bzr commit -m 1
Committing to: C:/Temp/bzr/
added foo
Committed revision 1.

C:\Temp\bzr>ren foo FOO

C:\Temp\bzr>bzr st
removed:
  foo
unknown:
  FOO

C:\Temp\bzr>bzr add FOO

C:\Temp\bzr>bzr st
removed:
  foo
unknown:
  FOO
>>>

Attempting to remove 'foo' and add 'FOO' results in the following:

<<<
C:\Temp\bzr>bzr remove foo
bzr: ERROR: Can't safely remove modified or unknown files:
unknown:
  FOO
Use --keep to not delete them, or --force to delete them regardless.

C:\Temp\bzr>bzr remove foo --force
deleted FOO

C:\Temp\bzr>bzr add FOO
bzr: ERROR: No such file: u'C:/Temp/bzr/FOO'
>>>

However, after reverting to revision 1, the following works:

<<<
C:\Temp\bzr>bzr revert
 N foo

C:\Temp\bzr>ren foo FOO

C:\Temp\bzr>bzr st
removed:
  foo
unknown:
  FOO

C:\Temp\bzr>bzr mv foo FOO
foo => FOO

C:\Temp\bzr>bzr st
renamed:
  foo => FOO

C:\Temp\bzr>
>>>

Changed in bzr:
assignee: nobody → Adriana Miyazaki de Moura (miya)
assignee: Adriana Miyazaki de Moura (miya) → nobody
Aleksandr Smyshliaev (a1s) wrote :

This bug also affects "bzr diff" command.

I have attached a patch against current sources that fixes the issue.

Changed in bzr:
status: Confirmed → Incomplete
Jelmer Vernooij (jelmer) on 2017-11-08
Changed in bzr:
status: Incomplete → Confirmed
Jelmer Vernooij (jelmer) on 2017-11-08
tags: added: check-for-breezy
Jelmer Vernooij (jelmer) on 2017-11-08
tags: removed: check-for-breezy
tags: added: check-for-breezy
Jelmer Vernooij (jelmer) on 2017-11-11
tags: removed: check-for-breezy
Changed in brz:
status: New → Triaged
importance: Undecided → High
Jelmer Vernooij (jelmer) on 2018-09-23
Changed in brz:
assignee: nobody → Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → New
assignee: nobody → Stewart J Solomon (highaboveus2)
Colin Watson (cjwatson) on 2020-12-27
Changed in bzr:
status: New → Confirmed
assignee: Stewart J Solomon (highaboveus2) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers