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

Re: svn merge question

From: Jack Repenning <jrepenning_at_collab.net>
Date: 2007-10-17 23:12:37 CEST

On Oct 17, 2007, at 5:03 PM, Kamesh Jayachandran wrote:

> I don't think if there was a discussion on this front. We support
> 'merge source' from some other WC target(and hence can be relative
> path), in that case we will derive the url from it. Probably we may
> need *REPOURL*(mapping to current target) or some keywords like
> PREV, HEAD, COMMITTED upon which we can leverage such relative urls.

While I can't recall any discussion of this in the context of the
merge tracking, the fact that "-g" fixes that one case is really kind
of a coincidence -- and not entirely general, since it sometimes
happens that you need to merge "from" several different sources, in
which case this "remember the last one" thing won't save you from
typing the alternate URL.

There has, however, been talk from time to time about relative,
composite local-repository parameters. For example,

        svn merge ./../../../branches/SOMEBRANCH

would mean "find the URL for '.', apply the relative path shown, and
use that as the URL for the merge." There are some ambiguities here
that would have to be worked out, but nothing insurmountable. For
example, how do you know whether that's a mixed-mode source URL, or
actually refers to some file? Some modified syntax would probably
work, say

   svn merge .@@/../../../branches/SOMEBRANCH

Anyway: there has been some such discussion, but there's no great
sense of urgency; if you think this is really important, you should
make your case here, see if someone gets interested.

As simple work-arounds, I've built myself two little helpers. One,
called "root", prints out the repository root for the current working
directory:

        svn info | sed -n '/Repository Root: /s///p'

Another, called "herein", prints out the URL to the current working
directory, but on another branch. So, for example, if I'm in ".../
root/greek/A/B", and type "herein branches/R1", it prints ".../
branches/R1/greek/A/B". This one's a bit too complicated to paste
into email, but if you're interested I'd be glad to toss you a copy
by other means.

Some examples of use:

(1) My Buddy Joe emails me "I fixed that bug in r2249." I think
"hmmm, my wc's at 2319, why is it still broken for me?" I cd to the
directory where I think the bug is and type "svn log -r2249"; svn
says precisely nothing. "Grrr, must be in some other directory," I
grumble. "I wonder where." Oh, never mind, I don't need to guess:

    svn log -vr2249 `root`

(2) I see that, yeah sure, it was fixed in r2249, but on branches/B1,
not in trunk where I want it. OK, so I need to merge that:

   svn merge `herein branches/B1`

-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jrepenning

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 17 23:23:22 2007

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