~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/case-insensitive-file-systems.txt

  • Committer: Mark Hammond
  • Date: 2008-12-23 04:20:49 UTC
  • mto: (3932.3.1 cicp-1.11)
  • mto: This revision was merged to the branch mainline in revision 3937.
  • Revision ID: mhammond@skippinet.com.au-20081223042049-4o1m0xrct6opr5n3
doc tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
adjust the case specified by the user so it exactly matches an existing item.
49
49
 
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
55
 
differ only by case.
 
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.
56
56
 
57
57
The rules for such fixups turn out to be quite simple:
58
58
 
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'
62
62
 
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
67
67
 
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
  differ only by case.)
71
73
 
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.
87
89
 
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.
89
93
 
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,