[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [help] Merging tag and trunk in a SVN repository.



Am Mittwoch, den 01.08.2007, 12:49 +0900 schrieb Charles Plessy:
> Le Tue, Jul 31, 2007 at 11:08:59PM +0200, Daniel Leidert a écrit :
> > 
> > The standard way is, that you make a copy: svn copy ....
> > In your case, the trunk branch was copied to tags/. So find out, which
> > revision (I will use the term 'copyrev' for this revision number) this
> > was and make sure, that trunk is in the state it was, when the copy was
> > made. From your description I read, the the changes in trunk were *not*
> > copied (svn-ignore) and you moved to the copy in tags/ to make the
> > changes "again" (or copy your changes). So trunk should not conatin any
> > changes. Then simply merge everything with:
> > 
> > svn merge -r copyrev:HEAD merge tags/5.0.0-2/ trunk/
> 
> Dear Daniel,
> 
> I start to understand better, but I only manage to replace one file by
> another.
> 
> Let's take the changelog as an example:
> 
> In the trunk, it mentions work on the manpages, and on moving files to
> lib- packages.
> http://svn.debian.org/wsvn/pkg-emboss/emboss/trunk/debian/changelog?op=file&rev=0&sc=0
> 
> In the tags/5.0.0-2, it mentions the work on the manpages, incorporation
> of upstream fixes, and fixes related to Debian packaging.
> http://svn.debian.org/wsvn/pkg-emboss/emboss/tags/5.0.0-2/debian/changelog?op=file&rev=0&sc=0
> 
> (I have made a few commits since you answered, so let us just take this
> as a starting point without thinking about the past mistakes unless
> necessary)
> 
> Now if I run the following command, nothing happens:
> svn merge -r HEAD:HEAD tags/5.0.0-2/ trunk/

Of course, there is no difference between HEAD and HEAD. It's both the
same revision number :) I'm not sure, why you tried this. But it's not
HEAD in tags/... and HEAD in trunk/. HEAD is the latest revision number
of the whole repository (svn doesn't count separately for trunk,
branches and tags - every change increases the revision number)

> But with this other one, trunk's changelog is just replaced by the tags
> one:
> svn merge -r 87:HEAD tags/5.0.0-2/ trunk/

Of course it's just replaced. What Merge does here is nothing lese than
getting the diff between revisions 87 and HEAD in tags/... and apply
this diff to trunk/.... And when I take a quick view over

svn diff -r87:HEAD tags/5.0.0-2/debian/changelog

it shows me, that entries from the changelog file were removed, that are
part of the changelog file in trunk. So these entries will removed, when
you apply the diff.

> I did not manage to figure out how to simply merge the files, with
> conflicts to resolve by hand if necessary, in order to have everything
> in the changelog...

It can only apply changes between revisions to a file. Simply merging
the entries and check for entries, that can be find in both files, is
not a feature of svn merge (at least I don't know it). There you
probably need some other kind of tool.

See http://svnbook.red-bean.com/en/1.0/ch04s04.html and
http://svnbook.red-bean.com/en/1.0/ch04s03.html#svn-ch-4-sect-3.2.

Regards, Daniel



Reply to: