monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] restrictions: disabling recursion


From: Zbigniew Zagórski
Subject: [Monotone-devel] restrictions: disabling recursion
Date: Wed, 20 Feb 2008 00:08:38 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Hi all,

while fighting with my first lua test (for automate get_current_revision) I've found that restrictions are rather surprising when using --depth=0 command. Reference says that

"... For example, n=0 disables recursion ..."

and i think that it's not absolutely true.

Question is what does "disabled recursion" mean.

When I've got following revision(all of them are folders):

  added    yyy
  added    yyy/ttt
  added    yyy/zzz

I want to check changes:

    $ mtn st --depth=0 .
    Current branch: a
    Changes against parent 5c11ada5b46d4ac9c809a29d35f92e9bb89e6222
      added    yyy

I suppose that mtn will restrict me only to "current folder". But does "current folder" includes all files in "current folder" ?
In that case it's very not a problem I'm still not sure.

Maybe next case shows my confusion better. I want to see only things added in yyy/ttt subdir:

    $ mtn st --depth=0 yyy/ttt
mtn: warning: restriction excludes addition of 'yyy' but includes addition of 'yyy/ttt'
    mtn: misuse: invalid restriction

(boom, never mind restrictions disabilities now. Lets add yyy/ to restriction also):

    $ mtn st --depth=0 yyy yyy/ttt
    Current branch: a
    Changes against parent 5c11ada5b46d4ac9c809a29d35f92e9bb89e6222
      added    yyy
      added    yyy/ttt
      added    yyy/zzz

Of course we didn't wanted this yyy/zzz here. It's a surprise. Is that also a feature ?

So, IMHO it would be feasible to change meaning of --depth in all restrictions to following
 0   strictly no recursion, take only explicitly given names
 1   + only direct children of explicitly given folders
 2   + direct of these folders
 ...
 -1  -- infinite recursion

Lets assume that implementation is different story.

Is that feasible idea?

It would follow "the least surprise rule" path (at least for me).

BTW. Does directories support attributes ? Yes they do.
This change t would allow operating on "directory as an entity". Now it's quite impossible without using tedious --exclude.

    $ mtn st yyy --depth=0
    Current branch: a
    Changes against parent 5c11ada5b46d4ac9c809a29d35f92e9bb89e6222
      added    yyy
      added    yyy/ttt
      added    yyy/zzz
      attr on  yyy
        attr   jjj
        value  1

(boom, i don't want ttt & zzz).

Best regards,
--
Zbigniew Zagórski
/ software developer / geek / happy daddy /





reply via email to

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