non-recursive status of a directory?

John Arbash Meinel john at arbash-meinel.com
Thu Jun 5 18:20:55 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Hammond wrote:
| Hi John,
|   Thanks for the reply - for some reason it got stuck at my ISP and didn't
arrive until a few minutes ago.
|
|> So, what you actually want is '--partial-recurse' or '--max-depth=1'.
|> Because you want to give a directory, and get the values for all
|> children, but not for their children.
|
| Actually, that isn't what TSVN does and not what I'm after.  IIUC, TSVN does
*not* look at the children of a directory - it only looks at the directory
object itself.  Eg, has it been added?  In the case of TSVN they also check if
properties for the directory have changed (again, not looking at children), and
although that doesn't directly apply here (yet?), the concept seem reasonable.
|
|> If you knew all the entries,
|
| I don't :(  All I know if the name of a directory on the file-system I need
info for.
|

So... how are you going to handle files which have been removed? It is a general
weakness of Tortiose, as you can't pretend that there is a file there. And how
do you indicate to the user that there is something that needs committing?
Specifically, I think you need to modify the overlay on the containing
directory. Even if this isn't fully recursive. Otherwise when a file is
deleted/removed, nothing changes except it is hidden.


|> you could do:
|>
|> tree.iter_changes(specific_files=[names, for, all the files, in the
|> directory], r)
|>
|> That doesn't help you much for missing files, and any directories you
|> supply will be recursively searched.
|
| Yeah, I came to the same conclusion - it leaves me in the position that to get
any status for a directory the entire tree below that directory needs to be
processed.
|
|> It isn't particularly hard to do what you want, we just haven't had a
|> specific use case for it, and thus haven't implemented it.
|
| Just to make sure I understand: Is my requirement the same thing required to
implement the "no recurse" option for the status command?  Given it is commented
as a "todo" for that command, I'd say that is another use case :)
|

Probably. I'm still not sure that you don't want 'recurse 1 level deep'.

|> WT4.iter_changes() in
|> particular is rather crufty in deference to performance. I've certainly
|> considered rewriting it to be more 'obvious', and just create a pyrex/C
|> extension as the optimized form.
|
| That's interesting - thanks.  Any ideas on how I should move forward?  It is
not blocking me (I just ask for the entire sub-tree) but I fear it will never
perform acceptably well if I stick to doing that.
|
| Thanks,
|
| Mark
|
|

For a plain '--no-recurse' I think it would just amount to changing calls like:

osutils.is_inside(root, path)

into

root == path

So you would do something like:

if ((no_recurse and root == path)
~    or (not no_recurse and osutils.is_inside_any()):

As mentioned, though, iter_changes could stand a lot of cleaning up anyway.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhIIHYACgkQJdeBCYSNAAN8swCdFnf4cg9pHJJrH1Bs4T8Fgh4U
r+YAn0AM5BixBWNQHFGDbBAHelpd+NqS
=05nc
-----END PGP SIGNATURE-----



More information about the bazaar mailing list