bugmonotone - Bugs: bug #12070, directory semantics currently...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12070: directory semantics currently problematic

Submitter:  Nathaniel Smith <njs>
Submitted:  Mon 21 Feb 2005 08:35:37 AM UTC
   
 
Category:  None Severity:  6 - Security
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
mtn version --full: 


Mon 16 Jan 2006 01:40:33 AM UTC, comment #2: 

Rosters fix this.

Nathaniel Smith <njs>
Group Member
Sat 05 Mar 2005 11:11:51 AM UTC, comment #1: 

graydon points out the following case:
  delete_file foo/bar
concatenated with
  add_file foo/baz
the question is, are these the same "foo" directory, or two different "foo" directories.  (this is important for merging with delete_dir, rename_dir.)  in the solution I prefer above, this question cannot be answered without recourse to manifests.  this makes me seriously question whether I actually prefer that solution...

(of course, perhaps there are other ways to handle this case?  none that preserve our current mode of handling, where changesets are always concatenated one to another, but perhaps something where when we want changeset(rev1, rev2) we build a path_analysis for rev1, repeatedly concatenate on changesets until reaching rev2, and then extract that path_analysis as a changeset?  this is a radically different model, though, and I do not know if it makes any sense.)

Nathaniel Smith <njs>
Group Member
Mon 21 Feb 2005 08:35:37 AM UTC, original submission:  

Currently, it is not legal to concatenate the changesets 'delete_file "foo/bar"' and 'add_file "foo"', because the former implies the existence of a directory "foo", which conflicts with the existence of a file "foo".

Thus, the implicit semantics of monotone are currently: a directory D exists in revision A if some file in A has the form D/something, or if in some arbitrarily deep ancestor of A, there was such a file, and no "delete_dir D" appears on the changeset path between that ancestor and A.

This is pretty broken -- in particular, it makes the validity of history a decidedly non-local problem.  (It's already a little bit non-local, because of the requirement that two arbitrarily long paths between the same two revisions must create the same changeset when concatenated along, but this is much worse.)  We can never tell whether adding a file is valid without scanning the entire history.

I see two options (perhaps there are more):
  -- decide that monotone supports empty directories.  Add directories to manifests.
  -- decide that monotone really means that emptying a directory implicitly deletes it, and somehow make concatenate("delete_file foo/bar", "add_file foo") work (without allowing any other badness that really is bad at the same time).

I kind of prefer the latter, as being the semantics I'm used to, and simpler to transition to; but I am cautious about how we can make that case legal without making truly broken cases legal as well.

Nathaniel Smith <njs>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-01-16 njs StatusNone Fixed
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code