[Svnmerge] Svnmerge documentation

Giovanni Bajo rasky at develer.com
Thu Sep 14 08:36:29 PDT 2006


Johann Moro wrote:

> Where can I find a full documentation for svnmerge?
> I am using the help feature but I could use more information. I tried
> to search around bud didn't find much other than a small WIKI page
> with a simplistic example.

There's no documentation, sorry. The closest thing is the wiki page and
the --help output of each command.
Are you using latest SVN version of svnmerge?

> I am trying to see how I can use svnmerge in our environment and I
> have a problem with the following scenario:
>
> I have a repository called trunk.
> I branch it (using tortoise) and call the branch BranchA
> I branch the same again and call that branch BranchB

Did you branch B off trunk, or off A?

> Now I get 3 working copies (one for each branch).
> For some reason if I run
> svnmerge init
> on them it doesn't work (I have the error: svnmerge: no copyfrom info
> available. Explicit head argument (-S/--head) required.)

This should work on either branch A or branch B out of the box.

> So instead on BranchA and BranchB I run:
> svnmerge init http://trunk
> (assuming that http://trunk is the adress of my trunk)
> Is that what I am supposed to run? Well anyway it seems to work as
> when I commit a change in trunk I can see it and merge it in A and B.

Yes, this is correct, assumig you haven't already committed changes in A or
B. "svnmerge help init" gives you the exact semantic of running "init" with
or without the explicit HEAD command. They are different.

> But what about trunk? I cannot run
> svnmerge init
> as I have the same error.
> But I don't know what adress it came from as it's my first branch?
> What do I do here? As a result I don't see merge candidates in trunk
> when I do a change in BranchA.

You should run both:

svnmerge init http://branchA
svnmerge init http://branchB

Again, this is correct only *before* you start committing in A and B.
Otherwise, you must use the "--revision" argument, and specify the revision
at which the branch happened (or any revision BEFORE the first change in
either branch anyway).

> Also what am I supposed to do to see changes to merge from BranchA to
> BranchB if I which to do so?

If you want to merge between A and B directly, you need to initialize this
way:

[in A]: svnmerge init http://branchB [--revision=BRANCHPOINT]
[in B]: svnmerge init http://branchA [--revision=BRANCHPOINT]

Basically, for each "branch", you need to run svnmerge init once for each
"head" you want to import changes from.
Later, when you run "svnmerge avail" or "svnmerge merge", if your branch has
more than one head, you will be asked to use -S/--head to disambiguate among
the heads you have init'd the branch against (and in this case, any
unambiguous substring will do).

Also, if you merge bidirectionally (A->trunk, and later trunk->A), remember
to always use -b/--bidirectional, which will hide reflected revisions for
you.

> Do I always have to merge back to the trunk and then to the other
> relevant branches?... Although I can't do that now because I haven't
> found a way to merge frin BranchA (or B) to trunk yet.

This is a matter of policy, not tools. svnmerge lets you merge between any
two lines of development, assuming you properly initialize it before, and
disambiguate when needed. It's up to your policy whether you prefer to merge
everything back to trunk each time or cross-merge between branches. If you
want some advice in this respect, we need some information of what the
branches are for, what kind of development will be performed in them, ecc.
-- 
Giovanni Bajo




More information about the Svnmerge mailing list