You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brian Erickson <er...@BAUERCONTROLS.com> on 2008/01/16 15:17:09 UTC

Merge question

Hi all,
 
We've been debating this a little here and the documentation (at least
to me) is not clear on the subject.
 
Are these two commands equivalent?
 
1) svn merge http://server/trunk@123 http://server/trunk@132 .
2) svn merge -r123:132 http://server/trunk .
 
Brian
 
 

Re: Merge question

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
On Wednesday 16 January 2008, Giulio Troccoli wrote:
> I thought I had grasped the difference between the two commands , but
> then Ulrich's email made me think.
>
> > The difference is the starting point. Using peg revisions (case 1)
> > you are only saying that you are taking the thing referenced via the
> > path and revision as starting point, but taking its current (HEAD)
> > state still: 
> >
> >    svn merge -rHEAD:HEAD http://server/trunk@123 \
> >                          http://server/trunk@132 .
>
> This is not clear at all.
> Recently I had to merge some code from a branch, back into trunk, that
> had been deleted years ago. I had, of course, have to use the peg
> revisions use case. In my case then that branch did not exist in HEAD,
> so it's "current state" is deleted. That is what I don't understand of
> your explanation.

Okay, at one of us is misunderstanding how this works, maybe both. ;)

Let's try with an example:
r1: create fileA and fileB
r2: copy fileA to fileX
r3: modify fileX
r4: delete fileX
r5: copy fileB to fileX
r6: modify fileX
r7: delete fileX

  $ svn diff -r 2:3 URL/fileX
  svn: File not found: revision 7, path '/fileX'

That was expected, the file doesn't exist in HEAD.

  $ svn diff URL/fileX@2 URL/fileX@3
  ...

This displays the differences between the same file at the two revisions, so 
indeed my explanation was wrong, svn also uses the peg revisions as defaults 
for the revisions it is comparing, not only for identifying the files to 
compare.

  $ svn diff URL/fileX@3 URL/fileX@6
  ...

This displays the differences between two unrelated files, both at the same 
location but referenced via different revisions.


Sorry, my explanation and partially understanding was wrong, SVN takes the peg 
revision for both locating and as current version.


Uli

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/

Sator Laser GmbH
Geschäftsführer: Michael Wöhrmann, Amtsgericht Hamburg HR B62 932

**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.

**************************************************************************************


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


RE: RE: RE: Re: Merge question

Posted by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au>.
Hi Andrew,

Just to clarify, if the last revision of trunk was 123 then, would the
following two commands be considered identical.

Normal merge:  svn merge -r 100:123 svn://server/repos/trunk@HEAD
Peg merge:     svn merge -r 100:123 svn://server/repos/trunk@123

Thanks
Lakshman
-----Original Message-----
From: Reedick, Andrew [mailto:jr9445@ATT.COM] 
Sent: Thursday, 17 January 2008 3:56 AM
To: Giulio Troccoli; users@subversion.tigris.org
Subject: RE: RE: Re: Merge question

> -----Original Message-----
> From: Giulio Troccoli [mailto:Giulio.Troccoli@uk.linedata.com]
> Sent: Wednesday, January 16, 2008 10:50 AM
> To: users@subversion.tigris.org
> Subject: RE: Re: Merge question
> 
> 
> This is not clear at all.
> Recently I had to merge some code from a branch, back into trunk, that

> had been deleted years ago. I had, of course, have to use the peg 
> revisions use case. In my case then that branch did not exist in HEAD,

> so it's "current state" is deleted. That is what I don't understand of

> your explanation.


The peg revision affects the repository.  It determines what directories
are visible in the repository.

The -r X:Y refers to the revisions on the visible dir.  It acts on
visible directories.  It doesn't choose which dirs are visible.

Step 1: gather visible dirs. (peg rev)
Step 2: list the revision range of a dir (-r x:y)


Normal merge:  svn merge -r 100:123 svn://server/repos/trunk@HEAD
Peg merge:     svn merge -r 100:123 svn://server/repos/trunk@123

The two will give you very different results if trunk was deleted and
replaced with a different trunk in rev 125.
	svn rm trunk  (commit as rev 124)
	svn copy beta.1.5 trunk  (commit as rev 125)


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

================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email. 

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure 
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================

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


RE: RE: Re: Merge question

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: Giulio Troccoli [mailto:Giulio.Troccoli@uk.linedata.com]
> Sent: Wednesday, January 16, 2008 10:50 AM
> To: users@subversion.tigris.org
> Subject: RE: Re: Merge question
> 
> 
> This is not clear at all.
> Recently I had to merge some code from a branch, back into trunk, that
> had been deleted years ago. I had, of course, have to use the peg
> revisions use case. In my case then that branch did not exist in HEAD,
> so it's "current state" is deleted. That is what I don't understand of
> your explanation.


The peg revision affects the repository.  It determines what directories
are visible in the repository.

The -r X:Y refers to the revisions on the visible dir.  It acts on
visible directories.  It doesn't choose which dirs are visible.

Step 1: gather visible dirs. (peg rev)
Step 2: list the revision range of a dir (-r x:y)


Normal merge:  svn merge -r 100:123 svn://server/repos/trunk@HEAD
Peg merge:     svn merge -r 100:123 svn://server/repos/trunk@123

The two will give you very different results if trunk was deleted and
replaced with a different trunk in rev 125.
	svn rm trunk  (commit as rev 124)
	svn copy beta.1.5 trunk  (commit as rev 125)


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


RE: Re: Merge question

Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
I thought I had grasped the difference between the two commands , but
then Ulrich's email made me think.

> The difference is the starting point. Using peg revisions (case 1) you
are
> only saying that you are taking the thing referenced via the path and
> revision as starting point, but taking its current (HEAD) state still:
> 
>    svn merge -rHEAD:HEAD http://server/trunk@123
http://server/trunk@132 .

This is not clear at all.
Recently I had to merge some code from a branch, back into trunk, that
had been deleted years ago. I had, of course, have to use the peg
revisions use case. In my case then that branch did not exist in HEAD,
so it's "current state" is deleted. That is what I don't understand of
your explanation.
 
 
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851     VAT Reg No 778499447

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

Re: Merge question

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
On Wednesday 16 January 2008, Brian Erickson wrote:
> We've been debating this a little here and the documentation (at least
> to me) is not clear on the subject.
>
> Are these two commands equivalent?
>
> 1) svn merge http://server/trunk@123 http://server/trunk@132 .
> 2) svn merge -r123:132 http://server/trunk .

No and you could try this using e.g. diff!

The difference is the starting point. Using peg revisions (case 1) you are 
only saying that you are taking the thing referenced via the path and 
revision as starting point, but taking its current (HEAD) state still:

   svn merge -rHEAD:HEAD http://server/trunk@123 http://server/trunk@132 .

The second version uses the thing referenced via the path and the HEAD 
revision as starting point, but then using different revisions of it:

   svn merge -r123:132 http://server/trunk@HEAD .

(I think those commands I gave are equivalent, but I'm not 100% sure)

Note that if trunk@123 has been moved somewhere else in later revisions, you 
will still be able to follow it with a peg revision without having to specify 
its current path which might not exist at all. This is what peg revisions are 
all about.


Uli

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/

Sator Laser GmbH
Geschäftsführer: Michael Wöhrmann, Amtsgericht Hamburg HR B62 932

**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.

**************************************************************************************


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


Re: Merge question

Posted by marc gonzalez-carnicer <ca...@gmail.com>.
to me, it looks like they are. i always use the 2nd format.


2008/1/16, Brian Erickson <er...@bauercontrols.com>:
>
> Are these two commands equivalent?
>
> 1) svn merge http://server/trunk@123 http://server/trunk@132 .
> 2) svn merge -r123:132 http://server/trunk .

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