You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2003/09/30 01:01:12 UTC
Bugs in "svn log multiple-local-targets"
I have found some bugs in "svn log" with multiple targets, when using a local revision specifier such as the default "BASE:1". For each target T, it was trying to print the merged log of all targets but using T to resolve the revision number.
1. It should resolve the revision number separately for each target (relatively simple bug fix).
2a. It should only print the logs for that target (relatively simple), or ...
2b. it should merge the logs from all targets together (relatively hard).
I have tried for hours to fix this, but it is very difficult in the current implementation. I have a suggestion which doesn't in itself fix these bugs, but makes the interface more rational:
Regarding this broken part of subversion/libsvn_client/log.c (svn_client_log):
if (start_is_local || end_is_local)
{
/* ### FIXME: At least one revision is locally dynamic, that
* is, we're in a case similar to one of these:
*
* $ svn log -rCOMMITTED foo.txt bar.c
* $ svn log -rCOMMITTED:42 foo.txt bar.c
*
* We'll iterate over each target in turn, getting the logs
* for the named range. This means that certain revisions may
* be printed out more than once. I think that's okay
* behavior, since the sense of the command is that one wants
* a particular range of logs for *this* file, then another
* range for *that* file, and so on. But we should
* probably put some sort of separator header between the log
* groups. Of course, libsvn_client can't just print stuff
* out -- it has to take a callback from the client to do
* that. So we need to define that callback interface, then
Either we should implement this properly, merging the results from multiple targets,
or we should escalate this logic to the caller, and we should not accept multiple targets with a local revision specifier. That gives the caller the responsibility of printing or merging duplicates, and allows it to print the separator lines.
Either of these changes will make the defined behaviour of this function self-consistent.
[Merging: merging could be done streamily if we can open several concurrent log-retrievals from the same repository. This requires an asynchronous, polled retrieval rather than a "get the whole stream content for me now" call. Or threads, of course. Anyway, since each stream is sorted, merging the streams would be simple.]
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Bugs in "svn log multiple-local-targets"
Posted by Julian Foad <ju...@btopenworld.com>.
kfogel@collab.net wrote:
> Julian Foad <ju...@btopenworld.com> writes:
>
>>1. It should resolve the revision number separately for each target (relatively simple bug fix).
>>2a. It should only print the logs for that target (relatively simple), or ...
>>2b. it should merge the logs from all targets together (relatively hard).
>
> I think 2b is best, obviously... but it's also hardest.
>
> I remember discussing this bug with Ben and Mike more than once; have
> you checked to see if there's an issue on it?
I have now. There is no such issue with "log" in the summary line.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Bugs in "svn log multiple-local-targets"
Posted by kf...@collab.net.
Julian Foad <ju...@btopenworld.com> writes:
> 1. It should resolve the revision number separately for each target (relatively simple bug fix).
> 2a. It should only print the logs for that target (relatively simple), or ...
> 2b. it should merge the logs from all targets together (relatively hard).
I think 2b is best, obviously... but it's also hardest.
I remember discussing this bug with Ben and Mike more than once; have
you checked to see if there's an issue on it?
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Bugs in "svn log multiple-local-targets"
Posted by Julian Foad <ju...@btopenworld.com>.
Julian Foad wrote:
> I have found some bugs in "svn log" with multiple targets, when using a
> local revision specifier such as the default "BASE:1". For each target
> T, it was trying to print the merged log of all targets but using T to
> resolve the revision number.
>
> 1. It should resolve the revision number separately for each target
> (relatively simple bug fix).
> 2a. It should only print the logs for that target (relatively simple),
> or ...
> 2b. it should merge the logs from all targets together (relatively hard).
I haven't filed an issue or written regression tests yet, but the script below demonstrates the problems.
- Julian
[[[
#!/bin/bash
# Show bugs in "svn log"
set -x -e
TEST_DIR=svn-log-test
mkdir $TEST_DIR
cd $TEST_DIR
svnadmin create repos
REPOS=file://`pwd`/repos
svn co $REPOS wc
cd wc
# Now we have a repository and a WC, start playing in the WC.
echo "File a." > a
echo "File b." > b
echo "File c." > c
svn add a b c
svn ci -m "One line in a." a
svn ci -m "One line in b." b
svn ci -m "Unrelated file c." c
echo "a: line 2" >> a
echo "b: line 2" >> b
svn ci -m "Second line in each."
LOG='svn log -q'
$LOG a b ### should merge the logs. Should show only relevant entries.
$LOG . a
svn up -r1 a
$LOG a b ### should not abort
]]]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org