/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
.. Taken from http://wiki.bazaar.canonical.com/CasePreservingWorkingTreeUseCases
.. FIXME: Probobly needs a bit of restructuring and Rework.
.. FIXME: Remove "we" "he" "she" "they" -> Write more like a scientific paper.

Case Preserving Working Tree Use Cases
======================================

This document attempts to describe the desired semantics for Breezy using the
bzr format on a Windows file system. Most Windows file systems are "case
preserving", in that the original case given for a filename is retained, even
though any case can be used to access the file. This is in contrast to some
file-systems, used on Windows and elsewhere, that are truly case-insensitve. 


This document is intended to be in a "psuedo-doctest" format. Lines beginning
with '``%``' are entered at a command-prompt, while lines beginning with '``>``'
are intended to show that command's output. Where the desired behaviour differs
from the current behaviour is marked with lines starting with '``***``'. 

Before we start you will need a repository to work with:

.. code-block:: none
  
  % [make and change into a temp working directory]
  % bzr init

Windows is a case-preserving file-system. Note that it doesn't matter what case
we use when asking for the file - we always get back the exact case the file was
created with.

.. code-block:: none
  
  % touch Foo
  % dir foo
  > ...
  > 09/10/2008  01:40 PM                 0 Foo
  % dir Foo
  > ...
  > 09/10/2008  01:40 PM                 0 Foo
  % if exist Foo echo Yes
  > Yes
  % if exist foo echo Yes
  > Yes

Bzr should attempt to use the name on the file-system rather than the name
supplied by the user.

.. code-block:: none
  
  % bzr add foo
  *** current behaviour ***
  > added foo
  *** expected behaviour ***
  > added Foo
  
  % bzr status
  *** current behaviour ***
  > unknown:
  >   Foo
  *** expected behaviour ***
  > added:
  >  Foo

Supplying the incorrect case to a file already in the inventory should work
correctly. Let's add a new file to bzr with the correct case:

.. code-block:: none
  
  % touch lower
  % bzr add lower
  > added lower

If Windows lets them see it with a given name:

.. code-block:: none
  
  % dir Lower
  > ...
  > 09/10/2008  01:48 PM                 0 lower

Bzr should too:

.. code-block:: none
  
  % bzr status Lower
  *** current behaviour ***
  > unknown:
  >   Lower
  *** expected behaviour ***
  > added:
  >   lower

All comments which accept a filename need to handle this situation. Eg, rm:

.. code-block:: none
  
  % [make and change into a temp working directory]
  % bzr init
  > ...
  % touch Foo lower
  % bzr add
  > added Foo
  > added lower
  % bzr ci -m "some changes"
  > ...
  
  % bzr rm foo Lower
  *** current behaviour ***
  > bzr: ERROR: Can't safely remove modified or unknown files:
  > unknown:
  >   foo
  >   Lower
  > Use --keep to not delete them, or --force to delete them regardless.
  *** expected behaviour ***
  > deleted lower
  > deleted Foo

If an external program changes the case of the file underneath us, it must not
phase us.

.. code-block:: none
  
  % bzr revert
  > +N  Foo
  > +N  lower
  
  % rm Foo
  % echo hello > foo
  % bzr status
  *** current behaviour ***
  > removed:
  >   Foo
  > unknown:
  >   foo
  *** expected behaviour ***
  > modified:
  >   Foo

And reverting a tree in that state should restore the case of the file:

.. code-block:: none
  
  % bzr revert
  *** current behaviour ***
  >  M  Foo
  > Conflict adding file Foo.  Moved existing file to foo.moved.
  *** expected behaviour ***
  > M Foo

But if the user really wants bzr to see the new name, she just does 'bzr mv' as
normal.