You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Giovanni Bajo <ra...@develer.com> on 2006/04/05 21:58:32 UTC

Re: [Svnmerge] [PATCH] svnmerge.py: Make sure the head dir (wc) is fromthe same repository

Madan U S <ma...@collab.net> wrote:

> [[[
> Make sure that the current working copy and the working copy
> dir (if PATH) provided by the head parameter belong to the same
> repository.
>
> * contrib/client-side/svnmerge.py
>   (wc_of_same_repos): New function. Given two working copy dirs,
>   read the entries file, and make sure that both of them belong
>   to the same repository.
>   (main): Add check to make sure that the provided head parameter
>   and the branch dir are working copies and belong to the same
>   repository.
> ]]]

+1 on the concept, but I don't like the entries parsing: it would be the first
time svnmerge depends on the working copy format instead of blindly relying on
the "svn" command line client. You can use svn info to find out the repository
UUID that you can then compare. We already have infrastructure in place to run
"svn info" and provide a handy python dictionary from its result.

If you want to pursue this direction, I'd also check when the head is provided
as a URL ("svn info" on the URL will show the repository UUID as well, so you
can probably use exactly the same codepath).

I'd also love if "svnmerge init" could take a repository-relative path for the
head, but that's for another day :)

Many thanks for all your patches!

Giovanni Bajo


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Svnmerge] [PATCH] svnmerge.py: Make sure the head dir (wc) is fromthe same repository

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 06 Apr 2006, Madan S. wrote:
...
> On Thursday 06 Apr 2006 3:28 am, Giovanni Bajo wrote:
...
> > +1 on the concept, but I don't like the entries parsing: it would be the
> > first time svnmerge depends on the working copy format instead of blindly
> > relying on the "svn" command line client.
> 
> Was talking to David James yesternight and he was telling me the same. I 
> understand. But I would like to make an obvious point here: The output format 
> of the svn commandline is more susceptible to change than the working copy 
> data format itself. :)

This "obvious point" is not correct.  The WC format was changed
pre-1.0, and has changed again in 1.4.  Even more significant changes
we being discussed just yesterday on IRC (apparently lundblad has even
prototyped some of them).  The command output is, to an extent, also
part of Subverion's "API" promise (it's meant to be machine-parsable,
and many many programs out there wrap the command-line's output).
-- 

Daniel Rall

RE: [Svnmerge] [PATCH] svnmerge.py: Make sure the head dir (wc) is fromthe same repository

Posted by Madan U S <ma...@collab.net>.
On Thursday 06 Apr 2006 3:28 am, Giovanni Bajo wrote:
> Madan U S <ma...@collab.net> wrote:
> > [[[
> > Make sure that the current working copy and the working copy
> > dir (if PATH) provided by the head parameter belong to the same
> > repository.
> >
> > * contrib/client-side/svnmerge.py
> >   (wc_of_same_repos): New function. Given two working copy dirs,
> >   read the entries file, and make sure that both of them belong
> >   to the same repository.
> >   (main): Add check to make sure that the provided head parameter
> >   and the branch dir are working copies and belong to the same
> >   repository.
> > ]]]
>
> +1 on the concept, but I don't like the entries parsing: it would be the
> first time svnmerge depends on the working copy format instead of blindly
> relying on the "svn" command line client.

Was talking to David James yesternight and he was telling me the same. I 
understand. But I would like to make an obvious point here: The output format 
of the svn commandline is more susceptible to change than the working copy 
data format itself. :)

> You can use svn info to find out 
> the repository UUID that you can then compare. We already have
> infrastructure in place to run "svn info" and provide a handy python
> dictionary from its result.

cool, will check it out.. thx for the pointer.

>
> If you want to pursue this direction, I'd also check when the head is
> provided as a URL ("svn info" on the URL will show the repository UUID as
> well, so you can probably use exactly the same codepath).

sure, let me see if this can be acheived with the same code (or with minor 
tweaks). If so, I will give both in the same patch.

>
> I'd also love if "svnmerge init" could take a repository-relative path for
> the head, but that's for another day :)

Thats a great idea... right now, the PATH variable is simply ambiguous.
Taking either dir or url with rules like... 
- the dir *should* be a working copy
- the dir *should* be a working copy of the same repository
- the url *should* be of the same working copy etc.,

  which is difficult in two ways...

- exhaustive checks are required to ensure the rules
- difficult for the user to learn.

I would like it if ONLY the repository relative/absolute path were allowed. 
Do not permit ad-hoc urls. Permit only paths. But the path entered would be 
appended to the current repos path, and not to the cwd.

>
> Many thanks for all your patches!

My pleasure! :)

Regards,
Madan.