How do I resolve this case-sensitivity problem on Windows.

Doug Lee dgl at
Wed Mar 5 21:21:33 GMT 2008

I started trying to get familiar with Python itself and even tried to
solve a line-ending problem in the cvsps_import plugin, but I didn't
get it done before I had to move on to other things.  To date, the
most useful thing I've done for the Bazaar community (other than going
on and on in other places on how nice I think it is) is to submit a
small rash of typo-type corrections to various plugin maintainers
while reviewing Python code.  Hopefully I'll get farther into this at
some point...

On Wed, Mar 05, 2008 at 11:15:48PM +0200, Alexander Belchenko wrote:
Talden ?????:
>I should also say that I'm trying to get familiar with the code-base
>(and Python).  References to explanations of the working copy
>book-keeping and a component model for the project might help speed
>that up.

I'll trying to help you in this as much as I can.

I'm personally found that the best way to learn some codebase is to
debug it. It works for me when I just started to fix win32-related bugs.

In the past I've used PythonWin debugger (it's the part of pywin32 package).
Now I prefer to use standard console python debugger pdb.
I'm also hear many good words about WinPdb debugger.

You need to install at least Python interpreter, pywin32 package.
The full stack of dependencies listed here:

Please, ensure that folder where pyton installed is listed in PATH 

Then you need to get copy of branch. This will be your mirror
of main bzr trunk. Then you need to create your own development branch,

bzr branch devel

To run bzr from sources you need to use command:

python bzr <args>

in the root of your devel branch.

Some notes about debuggers.
PythonWin does not support python scripts without .py extension, so just 
copy `bzr` script to `` and use latter for debugging.

If you decide to use pdb then you could create "breakpoint" in any place 
inserting in python source following line:

import pdb; pdb.set_trace()

when python encounter this line it will invoke interactive debugging 

Bird view of bzrlib internals related to working copy:

Working copy called working tree in bzr. The main classes to work with 
working tree
resides in bzrlib/ and bzrlib/ You'll need 
but more attention put on workingtree4. It's the current format. This format
use special object called dirstate to keep info about last committed and 
state of working tree. This file resides in .bzr/checkout/dirstate . The 
to work with dirstate is in bzrlib/ Also you will be interested
in directory walking code that used e.g. in status command to traverse 
filesystem and gather real information about real files. It's in the file
bzrlib/ function _walkdirs_unicode_to_utf8

Case-insensitive filesystem support problem:

There is several commands that accept filenames as parameters.
But some of these commands work with files on disk and working tree.
And some work with historical (committed) data.

add, remove, revert, mv, rename, commit -- always works with working tree 
and real files.

status, diff, ls -- could work with working tree or with history (snapshots 
of working tree in repository). So bzr should differentiate between 2 

cat, annotate -- always works with history so we need to be careful here.

I think to solve your problem `status`, `diff` and `commit` should treat 
change of case of file
as auto-rename operation. May be this mode should be enabled in the config 
or via global
command-line option.

Currently to compare last committed tree and current working tree used 
compare with dirstate data.
But this data keep exact filenames and don't provide support for name 
I tried to write specification draft for case-insensitive support year ago:
May be it needs to polish it up and send to ML for discussion with core 
developers of bzr.

Doug Lee                 dgl at        
SSB BART Group           doug.lee at
"I forgot, because I wanted to forget, except I don't remember
forgetting."  --Sarah Alawami

More information about the bazaar mailing list