Hi folks, in case no one has noticed, sometime during the rosters
rewrite I got going again with restrictions and have updated things to
take advantage of the new rosters code. It was a nice little project to
figure out the rosters code and as I was doing the conversion it became
very apparent to me how much better the new rosters code is at
representing what's going on behind the scenes.
The new restrictions code is on the branch (aptly, if not longly) named
net.venge.monotone.experiment.rosters.restrictions and I think it's
pretty much ready to go. There should be no user visible changes with
the code on this branch. It does fix one XFAIL'ed test but otherwise
passes the existing testsuite.
The basic idea is that a restriction holds a set of node_id's and the
state of each, so given a roster, determining which nodes are included
is quite simple. Unfortunately, for ls unknown and ls ignored there are
no node_id's so there is also a set of split_path's to handle these
cases which introduces a bit of duplication.
It would be great if people could have a look at the new code to see
what they think, suggest improvements, etc. Here's a list of things to
be done:
- add support for the --depth option and handle ignored files
properly to fix two remaining test failures
- the constructors are still a bit awkward and can probably
be improved
- test the performance of restricted operations on big trees. the old
restrictions code fairs poorly on these and I hope the new code will
do much better but I have not done any tests yet.
- decide what to do with the "implicit" inclusion of "required" parent
directories business. this supports things like add a; add a/b; add
a/b/c; followed by a restricted commit of a/b/c which requires the
addition of a and a/b before c can exist. the right thing to do here
is probably to change things a bit so that containing directories must
be explicitly specified.
There is also another branch off of this called
net.venge.monotone.restrictions.wildcard-paths where I've replaced the
--depth argument with optional recursive directories using a dir/...
syntax suggested by njs on the wiki.
http://venge.net/monotone/wiki/RostersTodo
None of the testsuite has been updated to work with this branch yet so
I'm sure there are lots of failures. This syntax may be slightly less
flexible than the current --depth option. Presumably "dir/..." would
match a directory and recursively anything contained within it. Without
the trailing "/..." a directory could match only itsself (--depth=0) or
possibly itsself and all of its immediate children non-recursively
(--depth=1). Both of these seem like useful cases particularly in the
"required parent" directory cases so some feedback on this would be great.
Cheers,
Derek
_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel