[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Difference between merge -c and merge -r

From: Stefan Sperling <stsp_at_apache.org>
Date: Fri, 29 Sep 2017 17:56:37 +0200

On Fri, Sep 29, 2017 at 03:36:27PM +0000, Scott Bloom wrote:
> After reading the docs, I cant for the life of me, figure out what the difference is. Any pointer where I can learn what the difference in the two merge techniques is?
> Scott

Hi Scott,

The -c option is just syntactic sugar.

Before it was invented, merging a single revision, say r100, was
always done like this: svn merge -r99:100
This asks svn to merge the difference between r99 and r100, i.e.
the changeset committed in r100.

With -c, we can write this in a shorter way: svn merge -c100
This is equivalent to svn merge -r99:100

The -r option also supports "reverse" merges, where the differences
of the original changeset are reversed: svn merge -r100:99 effectively
backs out changes from r100. To achieve this effect with -c, prepend
a minus sign to the number: svn merge -c-100

To make copy-pasting revision numbers from the output of 'svn log' easier
the -c option also accepts numbers with 'r' prepended:
  svn merge -cr100
is the same as
  svn merge -c100
  svn merge -c-r100
is the same as
  svn merge -c-100

To an untrained eye the -c-r100 case might look as if the -r option was
used, but that is not the case. It's the -c option with a minus for
a reverse-merge and an 'r' prepended to the revision number.

The -c option also accepts multiple revision numbers separated by commas:
  svn merge -c100,102,105,200
This merges changes from all the listed revisions in the given order.
The -r option can be specified multiple times for the same effect but
this is much more verbose: svn merge -r99:100 -r101:102 -r104:105 -r199:200

I hope this clarifies the situation :)
Received on 2017-09-29 17:56:48 CEST

This is an archived mail posted to the Subversion Users mailing list.