[Svnmerge] svnmerge between multiple repositories, same repo path

dustin at zmanda.com dustin at zmanda.com
Mon Apr 9 16:13:49 PDT 2007


On Mon, Apr 09, 2007 at 03:10:26PM -0500, dustin at zmanda.com wrote:
> I'd like to use svnmerge to manage merges between two different
> repositories containing the same projects.  Basically, I'd like to merge
> bidirectionally between:
> 
>   http://server1/svn/project/trunk
>   http://server2/svn/project/trunk
> 
> My expectation was that svnmerge wouldn't be able to merge between
> different repositories, but it seems to support this. To my surprise,
> what it *can't* do is merge between two locations with the same repo
> path (in this case, /project/trunk).  The svnmerge properties make the
> reason clear: only the repo path is used to identify a branch.
> 
> Is there a way around this?

I think I answered my own question:

remove_username_re = re.compile("/[^/]*@")
def target_to_repos_relative_path(target):
    url = target_to_url(target)
    # remove '@xxxx', since that's usually user-specific for e.g., an svn+ssh repo
    url = remove_username_re.sub("/", url)
    return url

This does what I need -- changes the identifiers used in merges to be full
urls, minus the username if one was provided.  It leaves comments, docstrings,
and function names a bit inconsistent, though, because they all still refer to
a repos relative path.

I realize that my path itself isn't something that would get merged (since it
changes operations pretty drastically), but would you be an amenable to a patch
that makes "repos relative path" into an opaque "branch_ident"?  It would
basically be renaming identifiers and rewriting docstrings and comments, and
would make this sort of patch easier for others to write (and probably help the
readability of the code).

Dustin

-- 
        Dustin J. Mitchell
        Storage Software Engineer, Zmanda, Inc.
        http://www.zmanda.com/



More information about the Svnmerge mailing list