Odd behaviour when adding directory with wrong case on Windows

Bug #189419 reported by Jeroen Hellingman
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

When adding some directories, I accidentally mistyped a directory (called C) with a lower case letter (to actually add something in a directory below it), instead of the upper case letter it should have been. The upper case letter directory was already present in the repository. When committing, the added directory was not recognized, and only some other things wer committed. After adding with the correct case the directory was added, however, in the status it now reports that the lower case equivalents have been removed. I cannot commit this remove, as nothing has actually been removed.

(Yes I know, that pesky windows case insensitivity, don't ask me how much trouble I had with this in Clearcase...)

The transcript of the commands I issued, as copied from my command window:

L:\eLibrary\Books>bzr status
modified:
  B/Blair and Robertson/PhilippineIslands/In Preparation/PhilippineIslands26.txt

unknown:
  A/Andersen/
  B/Barrows/A History of the Philippines/HistoryPhilippines-p5.xml
  B/Barrows/A History of the Philippines/HistoryPhilippines-words.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.txt
  B/Barrows/A History of the Philippines/HistoryPhilippines.xml
  B/Barrows/A History of the Philippines/images/p024.jpg
  B/Blink/Heerlijk Vaderland 2/HeerlijkVaderland-p5.xml
  C/Couperus/Eline Vere/Gutenberg/images/

L:\eLibrary\Books>bzr add A\Andersen
added A/Andersen
added "A/Andersen/Sproken en Vertellingen"
added "A/Andersen/Sproken en Vertellingen/images"
added "A/Andersen/Sproken en Vertellingen/images/back.jpg"
added "A/Andersen/Sproken en Vertellingen/images/front.jpg"
added "A/Andersen/Sproken en Vertellingen/images/p009.jpg"
added "A/Andersen/Sproken en Vertellingen/images/p014.jpg"
added "A/Andersen/Sproken en Vertellingen/images/spine.jpg"

L:\eLibrary\Books>bzr add "c\Couperus\Eline Vere\Gutenberg\images"
added c
added c/Couperus
added "c/Couperus/Eline Vere"
added "c/Couperus/Eline Vere/Gutenberg"
added "c/Couperus/Eline Vere/Gutenberg/images"
added "c/Couperus/Eline Vere/Gutenberg/images/front.jpg"

L:\eLibrary\Books>bzr commit
Committing to: L:/eLibrary/Books/
added c
added A/Andersen
added A/Andersen/Sproken en Vertellingen
added A/Andersen/Sproken en Vertellingen/images
added A/Andersen/Sproken en Vertellingen/images/back.jpg
added A/Andersen/Sproken en Vertellingen/images/front.jpg
added A/Andersen/Sproken en Vertellingen/images/p009.jpg
added A/Andersen/Sproken en Vertellingen/images/p014.jpg
added A/Andersen/Sproken en Vertellingen/images/spine.jpg
modified B/Blair and Robertson/PhilippineIslands/In Preparation/PhilippineIsland
s26.txt
added c/Couperus
added c/Couperus/Eline Vere
added c/Couperus/Eline Vere/Gutenberg
added c/Couperus/Eline Vere/Gutenberg/images
added c/Couperus/Eline Vere/Gutenberg/images/front.jpg
bzr: ERROR: empty commit message specified

L:\eLibrary\Books>bzr status
added:
  A/Andersen/
  A/Andersen/Sproken en Vertellingen/
  A/Andersen/Sproken en Vertellingen/images/
  A/Andersen/Sproken en Vertellingen/images/back.jpg
  A/Andersen/Sproken en Vertellingen/images/front.jpg
  A/Andersen/Sproken en Vertellingen/images/p009.jpg
  A/Andersen/Sproken en Vertellingen/images/p014.jpg
  A/Andersen/Sproken en Vertellingen/images/spine.jpg
modified:
  B/Blair and Robertson/PhilippineIslands/In Preparation/PhilippineIslands26.txt

unknown:
  B/Barrows/A History of the Philippines/HistoryPhilippines-p5.xml
  B/Barrows/A History of the Philippines/HistoryPhilippines-words.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.txt
  B/Barrows/A History of the Philippines/HistoryPhilippines.xml
  B/Barrows/A History of the Philippines/images/p024.jpg
  B/Blink/Heerlijk Vaderland 2/HeerlijkVaderland-p5.xml
  C/Couperus/Eline Vere/Gutenberg/images/

L:\eLibrary\Books>bzr add "C\Couperus\Eline Vere\Gutenberg\images"
added "C/Couperus/Eline Vere/Gutenberg/images"
added "C/Couperus/Eline Vere/Gutenberg/images/front.jpg"

L:\eLibrary\Books>bzr commit
Committing to: L:/eLibrary/Books/
added c
added A/Andersen
added A/Andersen/Sproken en Vertellingen
added A/Andersen/Sproken en Vertellingen/images
added A/Andersen/Sproken en Vertellingen/images/back.jpg
added A/Andersen/Sproken en Vertellingen/images/front.jpg
added A/Andersen/Sproken en Vertellingen/images/p009.jpg
added A/Andersen/Sproken en Vertellingen/images/p014.jpg
added A/Andersen/Sproken en Vertellingen/images/spine.jpg
modified B/Blair and Robertson/PhilippineIslands/In Preparation/PhilippineIsland
s26.txt
added C/Couperus/Eline Vere/Gutenberg/images
added C/Couperus/Eline Vere/Gutenberg/images/front.jpg
added c/Couperus
added c/Couperus/Eline Vere
added c/Couperus/Eline Vere/Gutenberg
added c/Couperus/Eline Vere/Gutenberg/images
added c/Couperus/Eline Vere/Gutenberg/images/front.jpg
Committed revision 118.

L:\eLibrary\Books>bzr status
removed:
  c/
  c/Couperus/
  c/Couperus/Eline Vere/
  c/Couperus/Eline Vere/Gutenberg/
  c/Couperus/Eline Vere/Gutenberg/images/
  c/Couperus/Eline Vere/Gutenberg/images/front.jpg
unknown:
  B/Barrows/A History of the Philippines/HistoryPhilippines-p5.xml
  B/Barrows/A History of the Philippines/HistoryPhilippines-words.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.txt
  B/Barrows/A History of the Philippines/HistoryPhilippines.xml
  B/Barrows/A History of the Philippines/images/p024.jpg
  B/Blink/Heerlijk Vaderland 2/HeerlijkVaderland-p5.xml

L:\eLibrary\Books>bzr commit
Committing to: L:/eLibrary/Books/
bzr: ERROR: no changes to commit. use --unchanged to commit anyhow

L:\eLibrary\Books>bzr status
removed:
  c/
  c/Couperus/
  c/Couperus/Eline Vere/
  c/Couperus/Eline Vere/Gutenberg/
  c/Couperus/Eline Vere/Gutenberg/images/
  c/Couperus/Eline Vere/Gutenberg/images/front.jpg
unknown:
  B/Barrows/A History of the Philippines/HistoryPhilippines-p5.xml
  B/Barrows/A History of the Philippines/HistoryPhilippines-words.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.txt
  B/Barrows/A History of the Philippines/HistoryPhilippines.xml
  B/Barrows/A History of the Philippines/images/p024.jpg
  B/Blink/Heerlijk Vaderland 2/HeerlijkVaderland-p5.xml

L:\eLibrary\Books>bzr version
Bazaar (bzr) 1.1.0
  Python interpreter: F:\Programs\Bazaar\python25.dll 2.5.1.final.0
  Python standard library: F:\Programs\Bazaar\lib\library.zip
  bzrlib: F:\Programs\Bazaar\lib\library.zip\bzrlib
  Bazaar configuration: C:\Documents and Settings\Jeroen\Application Data\bazaar
\2.0
  Bazaar log file: D:\Jeroen\.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.

L:\eLibrary\Books>

Revision history for this message
Jeroen Hellingman (jhellingman) wrote :

The log file.

Revision history for this message
Jeroen Hellingman (jhellingman) wrote :

Trying to commit with unchanged option doesn't resolve the issue:

L:\eLibrary\Books>bzr commit --unchanged
Committing to: L:/eLibrary/Books/
Committed revision 119.

L:\eLibrary\Books>bzr status
removed:
  c/
  c/Couperus/
  c/Couperus/Eline Vere/
  c/Couperus/Eline Vere/Gutenberg/
  c/Couperus/Eline Vere/Gutenberg/images/
  c/Couperus/Eline Vere/Gutenberg/images/front.jpg
unknown:
  B/Barrows/A History of the Philippines/HistoryPhilippines-p5.xml
  B/Barrows/A History of the Philippines/HistoryPhilippines-words.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.html
  B/Barrows/A History of the Philippines/HistoryPhilippines.txt
  B/Barrows/A History of the Philippines/HistoryPhilippines.xml
  B/Barrows/A History of the Philippines/images/p024.jpg
  B/Blink/Heerlijk Vaderland 2/HeerlijkVaderland-p5.xml

L:\eLibrary\Books>

log:

bzr arguments: [u'commit', u'--unchanged']
looking for plugins in C:/Documents and Settings/Jeroen/Application Data/bazaar/2.0/plugins
looking for plugins in F:/Programs/Bazaar/plugins
looking for plugins in F:\Programs\Bazaar\lib\library.zip\bzrlib\plugins
Looking for plugins in 'F:\\Programs\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
Names in archive: ['__init__.pyc', 'launchpad/__init__.pyc', 'launchpad/account.pyc', 'launchpad/lp_indirect.pyc', 'launchpad/lp_registration.pyc', 'launchpad/test_account.pyc', 'launchpad/test_lp_indirect.pyc', 'launchpad/test_register.pyc', 'multiparent.pyc']
Load plugin launchpad from zip 'F:\\Programs\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
Load plugin multiparent from zip 'F:\\Programs\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
encoding stdout as sys.stdout encoding 'cp437'
opening working tree 'L:/eLibrary/Books'
preparing to commit
[ 2828] 2008-02-05 23:33:02.187 INFO: Committing to: L:/eLibrary/Books/
Selecting files for commit with filter None
check paths: None
added revision_id {<email address hidden>}
[ 2828] 2008-02-05 23:33:28.733 INFO: Committed revision 119.
return code 0

bzr arguments: [u'status']
looking for plugins in C:/Documents and Settings/Jeroen/Application Data/bazaar/2.0/plugins
looking for plugins in F:/Programs/Bazaar/plugins
looking for plugins in F:\Programs\Bazaar\lib\library.zip\bzrlib\plugins
Looking for plugins in 'F:\\Programs\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
Names in archive: ['__init__.pyc', 'launchpad/__init__.pyc', 'launchpad/account.pyc', 'launchpad/lp_indirect.pyc', 'launchpad/lp_registration.pyc', 'launchpad/test_account.pyc', 'launchpad/test_lp_indirect.pyc', 'launchpad/test_register.pyc', 'multiparent.pyc']
Load plugin launchpad from zip 'F:\\Programs\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
Load plugin multiparent from zip 'F:\\Programs\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
encoding stdout as sys.stdout encoding 'cp437'
opening working tree 'L:/eLibrary/Books'
check paths: None
return code 0

Revision history for this message
Alexander Belchenko (bialix) wrote :

Thank you for detailed report. I'm agree -- bzr should normalize file paths on Windows before adding files.
Actually your bug report is duplicate of https://bugs.launchpad.net/bzr/+bug/172861
at least the root of problem is the same.

Revision history for this message
Alexander Belchenko (bialix) wrote :

I think this bug easily reproduced with next sequence of steps:

C:\Temp\1> bzr init
C:\Temp\1> echo > foo
C:\Temp\1> bzr st
unknown:
  foo
C:\Temp\1> bzr add Foo
added:
  Foo
C:\Temp\1> bzr st
unknown:
  foo
C:\Temp\1> bzr ci -m 1
Committing to: C:/Temp/1/
added Foo
Committed revision 1.
C:\Temp\1>bzr st
removed:
  Foo
unknown:
  foo

Is it close to your situation?

Revision history for this message
Alexander Belchenko (bialix) wrote :

bzr add should sanitize its input and using real filenames from filesystem on case-insensitive FS.

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Jeroen Hellingman (jhellingman) wrote :

Yes, this is a similar scenario, except that I tried to add a subdirectory to a directory, and misspelled the name, that is I have Foo in the repository, and wanted to add Foo/Bar, but typed foo/Bar, and thus foo got added next to Foo.

To resolve the confusion that results from this, I had to say bzr mv foo foo.temp, and then remove foo.temp.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: added: case-sensitivity
removed: check-for-breezy
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.