/[meta-cvs]/meta-cvs/F-54B5FF01DC6392F28A104A8A58761CB6
ViewVC logotype

Diff of /meta-cvs/F-54B5FF01DC6392F28A104A8A58761CB6

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by kaz, Tue Jun 25 05:26:03 2002 UTC revision 1.10.6.1 by kaz, Wed Feb 4 07:42:12 2004 UTC
# Line 1  Line 1 
1                    Meta-CVS --- A Directory Structure                         Meta-CVS --- A Directory Structure
2                           Versioning Layer Over                               Versioning Layer Over
3                       The Concurrent Versions System.                          The Concurrent Versions System.
4    
5                                Kaz Kylheku                                    Kaz Kylheku
6                              January 25, 2002                       Originally published January 25, 2002
7                          Edited and Revised February 3, 2004
8    
9    
10         "Directory versioning is a Hard Problem" -- Subversion FAQ             "Directory versioning is a Hard Problem" -- Subversion FAQ
11    
12            "Any problem in computer science can be solved with                "Any problem in computer science can be solved with
13               another layer of indirection" -- David Wheeler                   another layer of indirection" -- David Wheeler
14    
15    
16    Abstract    Abstract
# Line 31  Line 32 
32    
33      1. Introduction  . . . . . . . . . . . . . . . . . . . . . . Line 42      1. Introduction  . . . . . . . . . . . . . . . . . . . . . . Line 42
34      2. Data Representation Overview . . . . . . . . . . . . . . . . . 75      2. Data Representation Overview . . . . . . . . . . . . . . . . . 75
35          2.1 File Mapping Example . . . . . . . . . . . . . . . . . . 120          2.1 File Mapping Example . . . . . . . . . . . . . . . . . . 120
36          2.2 Synchronization . . . . . . . . . . . . . . . . . . . .  210          2.2 Symbolic links  . . . . . . . . . . . . . . . . . . . .  210
37            2.3 Synchronization  . . . . . . . . . . . . . . . . . . . . 210
38            2.4 Partial Sandboxes . . . . . . . . . . . . . . . . . . .  210
39      3. Surprising Advantages . . . . . . . . . . . . . . . . . . . . 247      3. Surprising Advantages . . . . . . . . . . . . . . . . . . . . 247
40          3.1 File Adding conflicts . . . . . . . . . . . . . . . . .  260          3.1 File Adding conflicts . . . . . . . . . . . . . . . . .  260
41          3.2 File Removal conflicts . . . . . . . . . . . . . . . . . 286          3.2 File Removal conflicts . . . . . . . . . . . . . . . . . 286
42          3.3 Diffing and Patching  . . . . . . . . . . . . . . . . .  320          3.3 Diffing and Patching  . . . . . . . . . . . . . . . . .  320
43    
44    
45    1. Introduction    1. Introduction
# Line 120  Line 123 
123    
124        Suppose that some project 'foo' consists of these files:        Suppose that some project 'foo' consists of these files:
125    
126          foo/README          foo/README
127          foo/inc/foo.h          foo/inc/foo.h
128          foo/src/Makefile          foo/src/Makefile
129          foo/src/foo.c          foo/src/foo.c
130    
131        what does a Meta-CVS representation look like? This is best        what does a Meta-CVS representation look like? This is best
132        understood in terms of the working copy checked out from CVS via        understood in terms of the working copy checked out from CVS via
133        Meta-CVS, which contains these things:        Meta-CVS, which contains these things:
134    
135          foo/MCVS/CVS/Entries          foo/MCVS/CVS/Entries
136          foo/MCVS/CVS/... other CVS metadata ...          foo/MCVS/CVS/... other CVS metadata ...
137    
138          foo/MCVS/F-123D61C8FE942733281D2B08C15CD438          foo/MCVS/F-123D61C8FE942733281D2B08C15CD438
139          foo/MCVS/F-156CAB88D4EEE703E8C4B4146B5094E2.h          foo/MCVS/F-156CAB88D4EEE703E8C4B4146B5094E2.h
140          foo/MCVS/F-15EA9689ACF749C314CE6FC5255DC4B0          foo/MCVS/F-15EA9689ACF749C314CE6FC5255DC4B0
141          foo/MCVS/F-1C43C940D8745CAA78752C1206316B55.c          foo/MCVS/F-1C43C940D8745CAA78752C1206316B55.c
142          foo/MCVS/MAP          foo/MCVS/MAP
143          foo/MCVS/MAP-LOCAL          foo/MCVS/MAP-LOCAL
144    
145          foo/README          foo/README
146          foo/inc/foo.h          foo/inc/foo.h
147          foo/src/Makefile          foo/src/Makefile
148          foo/src/foo.c          foo/src/foo.c
149    
150        There is a subdirectory called MCVS, which contains a CVS        There is a subdirectory called MCVS, which contains a CVS
151        subdirectory. This MCVS subdirectory is in fact the CVS        subdirectory. This MCVS subdirectory is in fact the CVS
# Line 164  Line 167 
167    
168        What establishes the relationship between the F- names and the        What establishes the relationship between the F- names and the
169        human readable paths is the association list in the MAP file,        human readable paths is the association list in the MAP file,
170        which looks something like this:        which, in the early versions of Meta-CVS looked like this:
171    
172          (("MCVS/F-123D61C8FE942733281D2B08C15CD438"          (("MCVS/F-123D61C8FE942733281D2B08C15CD438"
173            "README")            "README")
174           ("MCVS/F-156CAB88D4EEE703E8C4B4146B5094E2.h"           ("MCVS/F-156CAB88D4EEE703E8C4B4146B5094E2.h"
175           "inc/foo.h")           "inc/foo.h")
176           ("MCVS/F-15EA9689ACF749C314CE6FC5255DC4B0"           ("MCVS/F-15EA9689ACF749C314CE6FC5255DC4B0"
177            "src/Makefile")            "src/Makefile")
178           ("MCVS/F-1C43C940D8745CAA78752C1206316B55.c"           ("MCVS/F-1C43C940D8745CAA78752C1206316B55.c"
179            "src/foo.c"))            "src/foo.c"))
180    
181        The MAP-LOCAL file, upon checkout, is simply an exact copy of MAP.        The MAP-LOCAL file, upon checkout, is simply an exact copy of MAP.
182        The purpose of MAP-LOCAL is to keep track of the actual mapping        The purpose of MAP-LOCAL is to keep track of the actual mapping
# Line 206  Line 209 
209        running CVS also ensures that the F- files are properly        running CVS also ensures that the F- files are properly
210        synchronized with their unfolded counterparts.        synchronized with their unfolded counterparts.
211    
212    2.2 Synchronization  
213      2.2 Symbolic Links
214    
215          In August 2002, support for symbolic links was added to Meta-CVS,
216          and the format of the mapping became more complicated to reflect
217          that. The syntax was extended to allow for different kinds of
218          entries, as well as future extensibility. Each entry now has
219          a Lisp keyword symbol in its first position which identifies
220          its type. The rest of the list specifies the type-specific properties.
221          Currently, there are two types of entries :FILE and :SYMLINK.
222    
223          Right around that time, support for versioned property lists was
224          also added.
225    
226          The previous section's example now looks like this:
227    
228            ((:FILE
229              "MCVS/F-123D61C8FE942733281D2B08C15CD438"
230              "README")
231             (:FILE
232              "MCVS/F-156CAB88D4EEE703E8C4B4146B5094E2.h"
233              "inc/foo.h")
234             (:FILE
235              "MCVS/F-15EA9689ACF749C314CE6FC5255DC4B0"
236              "src/Makefile")
237             (:FILE
238              "MCVS/F-1C43C940D8745CAA78752C1206316B55.c"
239              "src/foo.c"))
240    
241           Executable files have additional material after the path name.
242           Symbolic links look like this:
243    
244             (:SYMLINK
245              "S-DF03GA1200347CF1935509371F8C1765"
246              "src/foo.c"
247              "../foo.c")
248    
249           which asserts the existence of a symbolic link called src/foo.c
250           whose target is ../foo.c.
251    
252           Both currently supported map entries have an ID string in the second
253           position, and an object path in the third position. The syntax
254           varies after that.
255    
256           Incidentally, Meta-CVS continues to recognize and parse the old
257           format. Once the mapping object is read from the MAP file, the
258           abstract syntax tree is examined to determine whether it conforms
259           to the old syntax or new. Nobody uses the old syntax; only old
260           versions stored in the repository of Meta-CVS itself.
261    
262    
263      2.3 Synchronization
264    
265        The next problem to tackle is how to establish the correspondence        The next problem to tackle is how to establish the correspondence
266        between the F- files and the working files. Meta-CVS does this in a        between the F- files and the working files. Meta-CVS does this in a
# Line 242  Line 296 
296        local changes; then after the CVS update to make sure that any        local changes; then after the CVS update to make sure that any
297        newly incorporated changes propagate back to the working copy.        newly incorporated changes propagate back to the working copy.
298    
299          The current behavior of Meta-CVS is more subtle than the above
300          description implies. The synchronization does not process the
301          entire MAP for commands that operate only on a subtree; instead,
302          entries corresponding to that subtree are filtered out of the
303          mapping. Secondly, the synchronization is direction-sensitive.
304          For instance, before a CVS commit, it makes sense to synchronize
305          from the tree to the CVS sandbox, not in the opposite direction.
306          Immediately after a commit, it makes sense to push in the opposite
307          direction, in case CVS modified the commited files (for instance
308          by altering keyword expansions).
309    
310      2.4 Partial Sandboxes
311    
312          Sometimes it is desirable to pull out just a subtree of a larger
313          project from a repository. How can this be done in a version
314          control system that represents the whole tree as a versioned object?
315          Wanting to check out part of the tree seems roughly equivalent to wanting
316          to check out half of a file.
317    
318          Meta-CVS solves this problem by supporting the concept of a partial
319          sandbox. This is a checkout that has the full mapping in the CVS
320          sandbox. A local file called DISPLACED is written which contains
321          the relative pathname of the root of the subtree that is checked out.
322          For example if the testcases/optimization subdirectory of
323          the x-compiler project is checked out, then the DISPLACED file
324          contains the path testcases/optimization.
325    
326          All of the algorithms in Meta-CVS are aware of the DISPLACED path,
327          and properly translate between the /abstract/ paths contained in
328          the mapping and the shorter, /real/ paths in the sandbox tree.
329          This translation is a no-op when there is no DISPLACED file---that
330          is, when the sandbox is a full one.
331    
332          Partial sandboxes behave robustly with respect to mapping changes
333          arriving from the repository. If another user commits a change
334          that moves a file from some currently invisible part of the tree
335          into the visible subtree, this works properly. The opposite direction
336          likewise.
337    
338          Partial sandboxes are used by the grab command to store a new
339          external drop into just a subtree of the project on a particular
340          branch or the trunk. To do this, the grab command's already
341          contorted algorithm had to be infused with translations between
342          abstract and real paths.
343    
344    
345    3. Surprising Advantages    3. Surprising Advantages
346    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.10.6.1

  ViewVC Help
Powered by ViewVC 1.1.5