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

Alexander Belchenko bialix at ukr.net
Wed Mar 5 21:15:48 GMT 2008


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:
http://bazaar-vcs.org/BzrWin32Installer#bzr-dependencies

Please, ensure that folder where pyton installed is listed in PATH environment
variable:
http://bazaar-vcs.org/BzrWin32Installer#id24

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

bzr branch bzr.dev 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 simply
copy `bzr` script to `bzr.py` and use latter for debugging.

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

import pdb; pdb.set_trace()

when python encounter this line it will invoke interactive debugging session.

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/woringtree.py and bzrlib/workingtree4.py. You'll need both,
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 real
state of working tree. This file resides in .bzr/checkout/dirstate . The code
to work with dirstate is in bzrlib/dirstate.py. Also you will be interested
in directory walking code that used e.g. in status command to traverse across
filesystem and gather real information about real files. It's in the file
bzrlib/osutils.py 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 variants.

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 aliases.
I tried to write specification draft for case-insensitive support year ago:
http://bazaar-vcs.org/CaseInsensitiveWorkingTreeSupport
May be it needs to polish it up and send to ML for discussion with core developers of bzr.



More information about the bazaar mailing list