add: accepts aliases due to case insensitivity
Bug #172861 reported by
David Roberts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned | ||
Breezy |
Triaged
|
Medium
|
Unassigned |
Bug Description
The following appears to demonstrate that on Win32
there is a bug in add that will allow filenames which
are aliases due to case-insensitivity to be added.
G:\bzrtempco>bzr --version
Bazaar (bzr) 0.91.0 [...... ]
G:\bzrtempco>mkdir bzr91
G:\bzrtempco>cd bzr91
G:\bzrtempco\
G:\bzrtempco\
G:\bzrtempco\
added Bzr
G:\bzrtempco\
Committing revision 1 to "G:/bzrtempco/
added Bzr
Committed revision 1.
G:\bzrtempco\
G:\bzrtempco\
added bZR
G:\bzrtempco\bzr91>
[Related to #34057, #77744]
description: | updated |
Changed in bzr: | |
status: | Triaged → Confirmed |
tags: | added: check-for-breezy |
tags: |
added: case-sensitivity removed: check-for-breezy |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
To post a comment you must log in.
I think you might be able to trigger this without the 'rename'.
Just doing:
bzr init test
cd test
touch Foo
bzr add Foo
bzr commit -m "Foo"
bzr add foO
bzr commit -m "foO"
At the end I have:
bzr log --short --verbose:
1 John Arbash Meinel 2007-11-29
Foo
added:
Foo
2 John Arbash Meinel 2007-11-29
foO
added:
foO
and
% bzr status
removed:
foO
But
% bzr commit -m 'test'
Committing revision 3 to ".../test/".
bzr: ERROR: no changes to commit. use --unchanged to commit anyhow
This happens because the "bzr status" code hasn't been unified with the "bzr commit" code. (commit iterates through the recorded files, and does a stat to see if they exist on disk, which shows them as present. 'bzr status' iterates through a listdir to see what files exist while it is iterating through the recorded list, so it has already consumed Foo when it sees foO.)
The other problem, is that I don't know of any way to get the real name of a file. You could use "os.listdir( os.path. dirname( path))" and then search through it for possible names, but you don't know if foO is there because of a rename, or if it is actually a different file.
It would be nice if you could do:
st = os.stat('foo')
and have "st" have a st_name or some other property that gives you the exact name on disk.
Does anyone know if that is possible?