[svk-devel] better argument handling

Cheng-Lung Sung clsung at tw.freebsd.org
Mon Mar 17 20:57:27 EDT 2008


Applied, Thank you.

On Wed, Feb 13, 2008 at 02:19:35PM -0500, Mark Eichin wrote:
> 
> > + SVKLOGLEVEL=DEBUG
> > + svk smerge --track-rename --log --remoterev --incremental --base file:///dev/shm/svk/test_repos/trunk:6 --check-only //mirror/test_mirror/branches/dev2 //mirror/test_mirror/branches/practice1
> > Auto-merging (///dev/shm/svk/test_repos/trunk, 12) /mirror/test_mirror/branches/dev2 to /mirror/test_mirror/branches/practice1 (base file:///dev/shm/svk/test_repos/trunk).
> > Argument "///dev/shm/svk/test_repos/trunk" isn't numeric in numeric eq (==) at /usr/share/perl5/SVK/Command/Merge.pm line 191.
> > ===> Auto-merging (///dev/shm/svk/test_repos/trunk, 11) /mirror/test_mirror/branches/dev2 to /mirror/test_mirror/branches/practice1 (base file:///dev/shm/svk/test_repos/trunk).
> > Argument "///dev/shm/svk/test_repos/trunk" isn't numeric in addition (+) at /usr/share/perl5/SVK/Merge.pm line 426.
> > TypeError in method 'svn_fs_revision_root', argument 3 of type 'svn_revnum_t'
> 
> The mistake here is that I used the upstream svn url instead of the
> svk one; the code failure is that find_merge_base takes
> 
>   file:///dev/shm/svk/test_repos/trunk:6
> 
> and splits it up
>     my ($merge_base, $merge_baserev) = $self->{merge_base} ? split(/:/, $self->{merge_base}) : ('', undef);
>     ($merge_base, $merge_baserev) = (undef, $merge_base)
>         if $merge_base =~ /^\d+$/;
> 
> so $merge_base is "file" and $merge_baserev is
> "///dev/shm/svk/test_repos/trunk" and the 6 is silently discarded.
> 
> Something as simple as a
> 
>  die "$self->{merge_base} not valid" if $merge_baserev && $merge_baserev !~ /^\d+$/;
> 
> right after the arg splitting lines quoted above would be a good choice...

-- 
Alan Cheng-Lung Sung - clsung@


More information about the svk-devel mailing list