You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ed L Cashin <ec...@uga.edu> on 2003/07/07 14:26:02 UTC

merge to individual file syntax

Hi.  I wanted to undo the changes in .config that I got on the last
update.  The last update contained other changes that I don't want to
undo.  I can see what needs to be done like this (in my wc):

  svn diff -r HEAD:PREV .config

... but the analogous merge command doesn't work:

  svn merge -r HEAD:PREV .config
  svn: A path under revision control is needed for this operation
  svn: svn_client__get_revision_number: need a version-controlled path to fetch local revision info.


I tried a couple variations:

  svn merge ROOT/.config@HEAD ROOT/.config@PREV .
  svn: A path under revision control is needed for this operation
  svn: svn_client__get_revision_number: need a version-controlled path to fetch local revision info.

... where ROOT was
svn+ssh://jeremy/home/ecashin/svnroot/2.5-macc/trunk.  Finally I
applied the diff with patch, but I am curious what the right
incantation was in this case.

-- 
--Ed L Cashin            |   PGP public key:
  ecashin@uga.edu        |   http://noserose.net/e/pgp/


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

Re: merge to individual file syntax

Posted by Philip Martin <ph...@codematters.co.uk>.
Garrett Rooney <ro...@electricjellyfish.net> writes:

> I'd love to use the source, but I don't have it.  The source is
> converted into a URL before it even gets this far, because
> svn_client_merge takes urls as arguments, not paths.

That's not a reason to use the target instead of the source.  Either
extract PREV earlier, pass a wc path, or accept that PREV is not
supported.

-- 
Philip Martin

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

Re: merge to individual file syntax

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Philip Martin wrote:

> Garrett Rooney <ro...@electricjellyfish.net> writes:
> 
> 
>>So I think we should check to see if merge_b->target refers to an
>>entry with the same url, and if so use that path, otherwise we'd
>>have to find some other way to get a wcpath, or error out, because
>>PREV doesn't make sense if we don't have a wcpath to associate with
>>it.
> 
> 
> No, don't use the target at all, use the source.  PREV only makes sense
> if the merge source is a wc_path, so
> 
>    svn merge -rHEAD:PREV http://....  some/path
> 
> is an error.
> 

I'd love to use the source, but I don't have it.  The source is 
converted into a URL before it even gets this far, because 
svn_client_merge takes urls as arguments, not paths.

-garrett


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

Re: merge to individual file syntax

Posted by Philip Martin <ph...@codematters.co.uk>.
Garrett Rooney <ro...@electricjellyfish.net> writes:

> So I think we should check to see if merge_b->target refers to an
> entry with the same url, and if so use that path, otherwise we'd
> have to find some other way to get a wcpath, or error out, because
> PREV doesn't make sense if we don't have a wcpath to associate with
> it.

No, don't use the target at all, use the source.  PREV only makes sense
if the merge source is a wc_path, so

   svn merge -rHEAD:PREV http://....  some/path

is an error.

-- 
Philip Martin

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

Re: merge to individual file syntax

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Philip Martin wrote:

> Garrett Rooney <ro...@electricjellyfish.net> writes:
> 
> 
>>I've got a fix for this, but I'm not sure it's correct.  If you pass
>>in merge_b->target to svn_client__get_revision_number as the path
>>instead of NULL, it's able to figure out PREV (it needs the working
>>copy path to do it).  I'm not certain this is entirely correct
>>though...  It seems like there are cases where the target of the merge
>>is not the same as the url...
> 
> 
> The merge revisions always refer to the sources, never to the target,
> so you appear to be correct: your fix is wrong.  That would make you
> right and wrong :)

Yeah, it seems like what needs to happen is that if we're trying to get 
PREV, we need to get the wc path of the URL in question.  So I think we 
should check to see if merge_b->target refers to an entry with the same 
url, and if so use that path, otherwise we'd have to find some other way 
to get a wcpath, or error out, because PREV doesn't make sense if we 
don't have a wcpath to associate with it.

-garrett



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

Re: merge to individual file syntax

Posted by Philip Martin <ph...@codematters.co.uk>.
Garrett Rooney <ro...@electricjellyfish.net> writes:

> I've got a fix for this, but I'm not sure it's correct.  If you pass
> in merge_b->target to svn_client__get_revision_number as the path
> instead of NULL, it's able to figure out PREV (it needs the working
> copy path to do it).  I'm not certain this is entirely correct
> though...  It seems like there are cases where the target of the merge
> is not the same as the url...

The merge revisions always refer to the sources, never to the target,
so you appear to be correct: your fix is wrong.  That would make you
right and wrong :)

-- 
Philip Martin

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

Re: merge to individual file syntax

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Ben Collins-Sussman wrote:

> Ed L Cashin <ec...@uga.edu> writes:
> 
> 
>>Hi.  I wanted to undo the changes in .config that I got on the last
>>update.  The last update contained other changes that I don't want to
>>undo.  I can see what needs to be done like this (in my wc):
>>
>>  svn diff -r HEAD:PREV .config
>>
>>... but the analogous merge command doesn't work:
>>
>>  svn merge -r HEAD:PREV .config
>>  svn: A path under revision control is needed for this operation
>>  svn: svn_client__get_revision_number: need a version-controlled path to fetch local revision info.
> 
> 
> This looks like a real bug.  Your use-case matches the 2nd syntax
> described in 'svn help merge'.  Would you file it?

I've got a fix for this, but I'm not sure it's correct.  If you pass in 
merge_b->target to svn_client__get_revision_number as the path instead 
of NULL, it's able to figure out PREV (it needs the working copy path to 
do it).  I'm not certain this is entirely correct though...  It seems 
like there are cases where the target of the merge is not the same as 
the url...

-garrett



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

Re: merge to individual file syntax

Posted by Ben Collins-Sussman <su...@collab.net>.
Ed L Cashin <ec...@uga.edu> writes:

> Hi.  I wanted to undo the changes in .config that I got on the last
> update.  The last update contained other changes that I don't want to
> undo.  I can see what needs to be done like this (in my wc):
> 
>   svn diff -r HEAD:PREV .config
> 
> ... but the analogous merge command doesn't work:
> 
>   svn merge -r HEAD:PREV .config
>   svn: A path under revision control is needed for this operation
>   svn: svn_client__get_revision_number: need a version-controlled path to fetch local revision info.

This looks like a real bug.  Your use-case matches the 2nd syntax
described in 'svn help merge'.  Would you file it?



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