2008/4/27 Daniel Shahaf <d.s_at_daniel.shahaf.co.il>:
> I discovered today by accident that trunk svnsync doesn't care if the
> source and destination are the same:
>
> > svnsync init file:///tmp/repos file:///tmp/repos
> Copied properties for revision 0 (svn:sync-* properties skipped).
>
> This patch changes it to notice that:
>
> > svnsync init file:///tmp/repos file:///tmp/repos
> ..\..\..\subversion\svnsync\main.c:632: (apr_err=195012)
> svnsync: Cannot sync a repository to another with the same UUID
I think the real use cases that this prevents are important, and this
would just add another step of hassle.
Perhaps this check might be reasonable if it's actually a check that:
* dest.HEAD == 0 (already done)
* dest.uuid == src.uuid (your patch)
and
* src.HEAD == 0
ie, "you're trying to sync from an empty repository to another empty
repository with the same UUID; are you sure you entered two different
repositories?"
--dave
>
> The run_test() function in svnsync_tests took advantage of this by setting the
> mirror's UUID to the source's UUID as soon as it created the mirror. This
> patch makes it not do so until it finished running svnsync.
>
> This only touches the 'initialize' command, so it doesn't prevent people
> from setting their mirrors' UUID to the mirrored repos's UUID after they
> initialize the mirror.
>
> Passes svnsync_tests.py.
>
> [[[
> In svnsync, do not allow source and destination to be the same repository.
>
> * subversion/svnsync/main.c
> (do_initialize):
> Return an error when FROM_UUID equals TO_UUID.
>
> * subversion/tests/cmdline/svnsync_tests.py
> (uuid): Import.
> (run_test): Defer setting the mirror repository's UUID to the source
> repository's UUID to just before comparing the dumpfiles.
> ]]]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>
--
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-27 22:31:29 CEST