[Top][All Lists]

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

[Gnu-arch-users] [BUG] FEATURE PLANS: delete by limit

From: Tom Lord
Subject: [Gnu-arch-users] [BUG] FEATURE PLANS: delete by limit
Date: Mon, 24 May 2004 16:56:56 -0700 (PDT)

A seemingly simple idea that turns out to be slightly tricky in
practice is to find a way to _delete_a_limit_from_a_source_tree_.

For example, let's suppose that I do a partial commit in some
directory using a limit called LIMIT.  I would expect that to have a
specific meaning in terms of "deleting a limit":

   Given ORIG (the revision before my commit)
   and   MOD  (the revision after my selected commit)

   Deleting LIMIT from both ORIG and MOD should leave 
   identical trees (i.e., nothing outside the limit is
   effected by the changes).

An algorithm for deleting things in a LIMIT that seems to give
appropriate results in combination with a particular definition of
selective commit is:

1) Compute the list of inventory items which match the 
   limit at all.

2) Delete all files and symlinks which match the limit in
   any way.

3) That leaves behind only directories.

   Each directory was matched by one or more "most specific" rules ---
   i.e., was matched because of some longest prefix of the directory's

   Let P be the most specific pattern that matched directory D.
   If there exists a rule whose pattern is _more_specific_ than
   P _and_ which can exclude items from the limit, then D 
   is a "left behind directory" and is not deleted.

   Otherwise, D is recursively deleted.

   Note that a property of these rules is that no "left behind
   directory" is ever nested inside of a directory that matched the
   limit but is not a left behind directory.

   An example is that with this rule set:

        (rules (bb "./include"))

   a directory named "./include" would be recursively deleted but
   with this one:

        (rules (bb "./include")
               (xx "./include/X11"))

   the rule that matched "./include" is `(bb "./include")'.   

   The rule `(xx "./include/X11")' is more specific because
   "./include" is a prefix of "./include/X11".

   Since a more specific excluding rule ("xx") is present, "./include"
   is a "left behind directory" --- deleting the limit would delete
   all of the "./include" subtree _except_ for the "./include/X11"
   subtree and "./include" itself.



Like my work on GNU arch, Pika Scheme, and other technical contributions 
to the public sphere?   Show your support!


address@hidden for payments.


        The cause of death is birth.
                        -- George Harrison

reply via email to

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