48
48
adjust the case specified by the user so it exactly matches an existing item.
50
50
There are two places this match can be performed against - the file-system
51
and the Bazaar inventory. When looking at the file-system, it is generally
52
impossible to have 2 names that differ only by case, so there is no ambiguity.
53
The inventory doesn't have the same rules, but it is expected that projects
54
which with to work with Windows would, by convention, avoid filenames that
51
and the Bazaar inventory. When looking at a case-insensitive file-system, it
52
is impossible to have 2 names that differ only by case, so there is no
53
ambiguity. The inventory doesn't have the same rules, but it is expected that
54
projects which wish to work with Windows would, by convention, avoid filenames
55
that differ only by case.
57
57
The rules for such fixups turn out to be quite simple:
59
59
* If an argument refers to an existing inventory item, we fixup the argument
60
60
using the inventory. This is, basically, all commands that take a filename
61
or directory argument *other* than 'add'
61
or directory argument *other* than 'add' and in some cases 'mv'
63
63
* If an argument refers to an existing filename for the creation of an
64
64
inventory item (eg, add), then the case of the existing file on the disk
68
68
* If an argument results in the creation of a *new* filename (eg, a move
69
69
destination), the argument will be used as specified. Bzr will create
70
a file and inventory item that exactly matches the case specified.
70
a file and inventory item that exactly matches the case specified (although
71
as above, care must be taken to avoid creating two inventory items that
72
74
Implementation of support for these file-systems
73
75
------------------------------------------------
85
87
Tree.get_file_by_path() etc; returns a name with the case adjusted to match
86
88
existing inventory items.
88
NOTE: It is likely these names will change.
90
* osutils.canonical_relpaths() and Tree.get_canonical_inventory_paths() - like
91
the 'singular' versions above, but accept and return sequences and therefore
92
offer more optimization opportunities when working with multiple names.
90
94
The only complication is the requirement that Bazaar not allow the creation
91
95
of items that differ only by case on such file-systems. For this requirement,