Changing case of directory in windows confuses bzr

Bug #271464 reported by John Carlyle-Clarke
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Medium
Unassigned

Bug Description

I looked at similar bugs but I'm not expert enough to know if this is a duplicate or a new case, so I'll leave that up to you, dear developers, to decide. I realise the below is a strange thing to do, but through a combination of chance and inexperience I did exactly this in my project. This is with bzr 1.7rc1. This is present in version 1.5 also. If you do the below with a directory name that differs by more than just case, the problem does not occur. Similarly, this behaves as expected under Linux. In those cases, when doing the second commit, you will see a message "deleting old/" or whatever the first directory name was.

This simple case shows the problem:-

C:\Documents and Settings\johncc\My Documents>mkdir Test
C:\Documents and Settings\johncc\My Documents>cd Test
C:\Documents and Settings\johncc\My Documents\Test>bzr init
Standalone tree (format: pack-0.92)
Location:
  branch root: .

C:\Documents and Settings\johncc\My Documents\Test>mkdir old
C:\Documents and Settings\johncc\My Documents\Test>notepad old\Test1.txt
C:\Documents and Settings\johncc\My Documents\Test>bzr add old
added old
added old/Test1.txt

C:\Documents and Settings\johncc\My Documents\Test>bzr commit -m First
Committing to: C:/Documents and Settings/johncc/My Documents/Test/
added old
added old/Test1.txt
Committed revision 1.

C:\Documents and Settings\johncc\My Documents\Test>move old tmp
        1 file(s) moved.

C:\Documents and Settings\johncc\My Documents\Test>move tmp Old
        1 file(s) moved.

C:\Documents and Settings\johncc\My Documents\Test>bzr st
removed:
  old/
  old/Test1.txt
unknown:
  Old/

C:\Documents and Settings\johncc\My Documents\Test>bzr add --no-recurse Old
added Old

C:\Documents and Settings\johncc\My Documents\Test>bzr mv --after old\Test1.txt Old\Test1.txt
old/Test1.txt => Old/Test1.txt

C:\Documents and Settings\johncc\My Documents\Test>bzr commit -m Second
Committing to: C:/Documents and Settings/johncc/My Documents/Test/
added Old
renamed old/Test1.txt => Old/Test1.txt
Committed revision 2.

C:\Documents and Settings\johncc\My Documents\Test>bzr st
removed:
  old/

C:\Documents and Settings\johncc\My Documents\Test>bzr commit -m Third
Committing to: C:/Documents and Settings/johncc/My Documents/Test/
bzr: ERROR: no changes to commit. use --unchanged to commit anyhow

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

It would be good to try again with bzr 2.0+ I think around the 1.16 cycle or so, we had a round of case-sensitivity improvements.

Changed in bzr:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
David Roberts (smartgpx) wrote :

Retested using bzr2.1.0b4 on WinXP

Behaviour is different, but still (dangerously?) confusing.

F:\BZRBUG~1>bzr version
Bazaar (bzr) 2.1.0b4
  Python interpreter: C:\localapp\Program Files\Bazaar\python25.dll 2.5.4
  Python standard library: C:\localapp\Program Files\Bazaar\lib\library.zip
  Platform: Windows-XP-5.1.2600-SP2

F:\BZRBUG~1>mkdir Test

F:\BZRBUG~1>cd Test

F:\BZRBUG~1\Test>bzr init
Created a standalone tree (format: 2a)

F:\BZRBUG~1\Test>mkdir old

F:\BZRBUG~1\Test>edit old\Test1.txt

F:\BZRBUG~1\Test>bzr add old
adding old
adding old/Test1.txt

F:\BZRBUG~1\Test>bzr commit -m First
Committing to: F:/BZRBUG~1/Test/
added old
added old/Test1.txt
Committed revision 1.

F:\BZRBUG~1\Test>move old tmp
        1 file(s) moved.

F:\BZRBUG~1\Test>move tmp Old
        1 file(s) moved.

F:\BZRBUG~1\Test>bzr st
removed:
  old/
  old/Test1.txt
unknown:
  Old/

F:\BZRBUG~1\Test>bzr add --no-recurse Old
                                                                 [[DJR: note 'bzr add' has silently failed to add explicit argument]]
F:\BZRBUG~1\Test>bzr st
removed:
  old/
  old/Test1.txt
unknown:
  Old/

F:\BZRBUG~1\Test>bzr mv --after old\Test1.txt Old\Test1.txt
bzr: ERROR: Could not move Test1.txt => Test1.txt: old/Test1.txt is already versioned.
                                                               [[DJR: note 'bzr st' reports folder and content is removed]]

F:\BZRBUG~1\Test>bzr st
removed:
  old/
  old/Test1.txt
unknown:
  Old/

F:\BZRBUG~1\Test>bzr commit -m Second
Committing to: F:/BZRBUG~1/Test/
missing old
modified old
missing old/Test1.txt
modified old/Test1.txt
Committed revision 2.

F:\BZRBUG~1\Test>dir
 Volume in drive F is Elements
 Volume Serial Number is 6AD5-E040

 Directory of F:\BZRBUG~1\Test

20/01/2010 15:14 <DIR> .
20/01/2010 15:14 <DIR> ..
20/01/2010 15:15 <DIR> Old
               0 File(s) 0 bytes
               3 Dir(s) 125,342,941,184 bytes free

F:\BZRBUG~1\Test>bzr st
unknown:
  Old/

[[DJR: so perhaps everything is still intact under 'old'? Not so!]]

F:\BZRBUG~1\Test>bzr log -v
------------------------------------------------------------
revno: 2
committer: David Roberts <email address hidden>
branch nick: Test
timestamp: Wed 2010-01-20 15:18:11 +0000
message:
  Second
removed:
  old/
  old/Test1.txt
------------------------------------------------------------
revno: 1
committer: David Roberts <email address hidden>
branch nick: Test
timestamp: Wed 2010-01-20 15:15:52 +0000
message:
  First
added:
  old/
  old/Test1.txt

F:\BZRBUG~1\Test>bzr inventory -v
                                                      [[DJR: empty]]
F:\BZRBUG~1\Test>bzr inventory -r-1
                                                      [[DJR: empty]]

Martin Pool (mbp)
tags: added: case-sensitivity
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 271464] [NEW] Changing case of directory in windows confuses bzr

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 9/17/2008 2:39 PM, John Carlyle-Clarke wrote:
> Public bug reported:
>
> I looked at similar bugs but I'm not expert enough to know if this is a
> duplicate or a new case, so I'll leave that up to you, dear developers,
> to decide. I realise the below is a strange thing to do, but through a
> combination of chance and inexperience I did exactly this in my project.
> This is with bzr 1.7rc1. This is present in version 1.5 also. If you
> do the below with a directory name that differs by more than just case,
> the problem does not occur. Similarly, this behaves as expected under
> Linux. In those cases, when doing the second commit, you will see a
> message "deleting old/" or whatever the first directory name was.
>
> This simple case shows the problem:-

You should probably upgrade to a newer version of bzr. 1.5 and 1.7 are
2.5 and 2yrs old, respectively.

We've done a bit more to handle case insensitivity since then.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyA8c4ACgkQJdeBCYSNAANfRACfZnrudNq6xs8fJuWiDFVKkMkq
2PcAoNIWdtrYbnhnDPOxBEv8dzhiIUGI
=kYIA
-----END PGP SIGNATURE-----

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

John, the comment https://bugs.launchpad.net/bzr/+bug/271464/comments/2 illustrates the problem with bzr 2.1. I don't think there is anything fixed in 2.2.

Changed in bzr:
status: Incomplete → Confirmed
importance: Low → Medium
tags: added: win32
Revision history for this message
Alexander Belchenko (bialix) wrote :

C:\Temp>bzr init 5
Created a standalone tree (format: 1.9)

C:\Temp\5>bzr mkdir old
added old

C:\Temp\5>bzr ci -m1
Committing to: C:/Temp/5/
added old
Committed revision 1.

C:\Temp\5>ren old Old

C:\Temp\5>dir /b
Old

C:\Temp\5>bzr st
removed:
  old/
unknown:
  Old/

C:\Temp\5>bzr ci -m2
Committing to: C:/Temp/5/
missing old
modified old
Committed revision 2.

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

C:\Temp\5>bzr st
removed:
  old/
unknown:
  Old/

C:\Temp\5>bzr mv --auto

C:\Temp\5>bzr st
removed:
  old/
unknown:
  Old/

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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