monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] some basic notes on object versioning


From: Derek Scherger
Subject: [Monotone-devel] some basic notes on object versioning
Date: Sun, 5 Jun 2005 22:11:32 -0600 (MDT)

discalimer: this may not be of any particular interest to anyone! it may also be
incorrect and does not necessarily represent how monotone does or will version
things. it's pretty basic and may be old news.

I simply jotted down these notes the other day while thinking about things like
explicit directory support and the lifetime of versioned objects.

I thought that I'd post it in case someone actually finds it useful or that it
might provoke some interesting discussion of how things are done currently, and
how they might be done in the future.

Cheers,
Derek

versioned objects

- objects are files or directories

- objects have contents
        - files contain data and may be empty
        - directories contain other objects, by name, 
          and may also be empty

- objects have attributes
        - eg. rwx permissions, binary type, etc.

- objects have versions
        - computed as the sha1 hash over their contents
        - a directory's contents may simply be represented
          by the names of the objects it contains 
          (newline separated)

- objects have names
        - their name within their containing directory, i.e. basename(1)
        - names may change (i.e. rename)

- objects have locations
        - their full path name with / separators exclusive of their name,
          i.e. dirname(1)
        - locations may change (i.e. move)

- objects have lifetimes
        - an object's lifetime begins when it is added to its 
          containing directory (birth)
        - an object's lifetime ends when the object is dropped 
          from its containing directory (death)
        - an object's lifetime continues when it has name, location or 
          content changes
        - the root directory exists implicitly and cannot be added, 
          renamed, moved or dropped
        - the root directory only supports content changes

- objects may be changed during their lifetime
        - name change (rename)
        - location change (move)
        - content change (file's data or directory's contained objects)
        - the root directory only allows content changes (it always 
          exists and cannot be renamed or moved)
        - additions/deletions/renames change the directory that contains
          the affected objects (i.e. directory content change)

revisions

- any single object can undergo either a lifetime change *or* a 
  name/location/content change in a single revision. i.e. changes 
  after an add change what gets added, changes before a drop are 
  essentially ignored

- objects are *not* simply added or dropped, rather they are added *to* 
  or dropped *from* some containing directory. these actions change the
  lifetime of the added or dropped object *and* change the *contents*
  of the containing directory.

questions

- should "add some/path/to/some/file" automatically add the intervening 
  directories? (this seems like would probably be useful, to support 
  recursive add in particular)

- should "drop some/path/to/some/file" automatically drop the intervening 
  directories? if they're empty? (this seems like it would probably be 
  somewhat less useful!)

- treating move and rename as different is somewhat questionable, 
  although move seems like a somewhat better representation than 
  rename if only one is used

     





reply via email to

[Prev in Thread] Current Thread [Next in Thread]