monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] [patch]--depth for monotone ls


From: Joel Reed
Subject: [Monotone-devel] [patch]--depth for monotone ls
Date: Sun, 15 May 2005 22:31:31 -0400
User-agent: Mutt/1.5.5.1i

I took a look at adding support for limiting monotone's recursive
predilections, which seems to be important option for some. I need
it for better zsh file completion. Anyway I was able to add it in
suprisingly few (to me at least) # of lines. 

I used --depth=X as the option and tested the code by adding it to
"ls known".

X above is used as a mechanism to indicate how many times the restrictions
code in app_state.cc:restriction_includes may do a branch_path to walk up
the directory tree.

Thus for a tree:

./a
./a/b
./a/b/c
./a/b/c/d
./a/b/c/d/file
./a/b/c/file
./a/b/file
./a/file
./file

(%:~/tmp/root) monotone --db=../mt.db --depth=1 ls known .
file

(%:~/tmp/root) monotone --db=../mt.db --depth=2 ls known . 
a/file
file

(%:~/tmp/root) monotone --db=../mt.db --depth=3 ls known . 
a/b/file
a/file
file

and after "cd a/b/"

(%:~/tmp/root/a/b) monotone --db=../../../mt.db --depth=1 ls known . 
a/b/file

(%:~/tmp/root/a/b) monotone --db=../../../mt.db --depth=2 ls known . 
a/b/c/file
a/b/file

and after "cd .."

(%:~/tmp/root/a) monotone --db=../../mt.db --depth=2 ls known b 
a/b/c/file
a/b/file

etc.

This gives me what I need. When no --depth is provided "." works as
before. Giving the whole subtree from that point.

A few questions:

1) functionality look ok?
2) --depth as param name ok?
3) patch look ok (-testcase & Changelog!)
4) I want to add this to "list" obviously, but any other subcommands
         you'd nominate for working with this option? (must be something
         that uses restriction code!)

jr

Attachment: ls.known.depth.patch
Description: Text document


reply via email to

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