Greg Hudson wrote:
> On Tue, 2005-02-22 at 16:39, Branko Čibej wrote:
>
>>So, a while ago there was a discussion on the GCC list and later on
>>#svn-dev about how "svn diff" output should be sorted.
>
> Also see http://svn.haxx.se/dev/archive-2003-10/0569.shtml and
> http://svn.haxx.se/dev/archive-2004-06/0000.shtml and their follow-ups.
Thank you for finding those threads in which I proposed generating all output
in sorted order. I will update my patch to apply to trunk.
At the time, the conclusion was roughly that that would be good, but only if
all cases including mixed WC-and-repository operations are covered. I have not
yet managed to cover all the cases. I think I could argue now that sorting a
significant and cleanly defined subset of operations would be acceptable, with
the hope but not a requirement that the rest should be done later.
>>At the time, I naïvely thought that sorting the entries list and
>>returning a modified hash table that supports in-order traversal would
>>do the trick. Then I went digging into the code, and it turns out that's
>>not enough. Unfortunately, our public APIs return an apr_hash_t. And,
>>this not being C++, there's no way to override that tables traversal order.
>
> We have svn_sort__hash(). It's used in libsvn_subr/hash.c for hash
> dumps, for instance.
Note that svn_sort__hash does not sort a hash in place, because a hash isn't
ordered, so it returns an array generated from that hash. Therefore several
lines of code must change at each point of use. Nevertheless I found that to
be an effective solution, not too cumbersome.
Branko Čibej wrote:
> There is a fairly "simple" way to get sorted output from almost all
> Subversion commands, and that is to teach svn_wc_entries_read,
> svn_io_get_dirents and friends to return a table that's inherenly
> ordered [...]
I found that there were barely enough uses of those functions to make it
worthwhile creating new, sorted versions of them, but I would not object to
doing so.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 22 23:28:28 2005