You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ron Hunter-Duvar <ro...@oracle.com> on 2009/04/21 21:22:04 UTC
Weird merge problem
Hi all,
I'm doing a merge that I thought would be straightfoward, but it gave me
a huge number of conflicts, and I'm trying to understand why. Here's the
situation: all of the recent work on this project was done on a branch,
and trunk hasn't been touched. Now we want to move the mainline
development back to trunk and go back to the usual use of branches (just
for releases and disruptive changes).
The last commit to trunk was r1003. The branch was made at r7232 (based
on "svn log --stop-on-copy") and worked on up to r12212 (the current
head revision), then frozen. I checked out a clean working copy of trunk
at r12212. From within the clean trunk working copy I did this command:
svn merge -r 7232:12212 $REPOS/branch
Since there were no commits to trunk between r7232 and r12212, there
were no merges in either direction between trunk and branch (since there
were no trunk changes there's nothing to merge to the branch, and if
there were any previous branch to trunk merges they would show up in the
log for trunk). So there should be no conflicts, right?
But I have 75 conflicted files. 15 of these are in a directory that
hasn't been touched since r7232 ("svn diff -r 7232:12212 directory"
gives no output). The files haven't been modified in the trunk or in the
branch, so how can they be conflicted?
When I look at the conflicted files, all of them have a *.merge-left.r0
file that is empty. Why does it say r0 instead of r7232? The merge-right
files all say .r12212, and seem to contain the contents I want. The
*.working files contain the old contents of trunk.
I'm assuming I must have specified the merge command wrong, but I don't
see what's wrong with it. I've been using svn for a number of years, but
I haven't done that many merges. I've double checked all the revision
numbers, made sure my working copies were clean and up to date, and
double checked with "svn diff" that there were no trunk changes. Can
someone point out my mistake?
Thanks,
Ron
--
Ron Hunter-Duvar
All opinions expressed here are mine, and do not necessarily represent
those of my employer.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1849044
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Weird merge problem
Posted by Mike Meyer <mm...@lexmark.com>.
Ron Hunter-Duvar <ro...@oracle.com> wrote on 04/21/2009
06:12:53 PM:
>
>
> Mike Meyer wrote:
>
>
> Ron Hunter-Duvar <ro...@oracle.com> wrote on 04/21/2009
> 05:51:06 PM:
>
> >
> >
> > Bob Archer wrote:
> > The last commit to trunk was r1003. The branch was made at r7232
> >
> > (based
> >
> > on "svn log --stop-on-copy") and worked on up to r12212 (the current
> > head revision), then frozen. I checked out a clean working copy of
> >
> > trunk
> >
> > at r12212. From within the clean trunk working copy I did this
> >
> > command:
> >
> > svn merge -r 7232:12212 $REPOS/branch
> >
> >
> > Don't you need to specify the branch folder???
> >
> > svn merge -r 7232:12212 $REPOS/branch/ThisBranchHere
> >
> > Usually you copy into a folder of branch when you do the branch. Don't
> > you?
> >
> > What if you just try:
> >
> > svn merge $REPOS/branch
> >
> > if you are using svn 1.5 or newer it should figure out what revision
> > range needs to be merged.
> >
> > That said... if you just want to move your branch as is to your trunk
> > you can delete trunk and copy the branch to trunk.
> >
> > BOb
> >
> > When I said $REPOS/branch that was just short hand for the full url,
> > svn://<repository>/branches/<name-of-branch>. I know I got that part
> > right (if I didn't, it would have made a much bigger mess, pulling
> > in a bunch of old branches).
> >
> > I was working around the problem by deleting all the *.working and
> > *.merge-left.r0 files and moving all the *.merge-right.r12212 files
> > to their base names, and some other clean up (seems merge won't
> > delete stuff that's in trunk but was deleted from branch). But I
> > think your delete and copy is a much better solution. I'll do that
> > instead. Thanks.
>
> I don't like that solution - I feel like it mucks up the history of
> the trunk. I'd do the merge with "--accept theirs-full" instead,
> which will do what you did with the merge files - only
> automatically. The end result will be the same, except for the
> history, so it's realy just a matter of which you prefer.
>
> <mike
> Actually, compared to committing several thousand individual
> changes, with no record of where they came from other than the log
> message, a simple delete and copy with clear log messages tells me
> more. Keep in mind that this is an unusual case, in that there is no
> trunk history to muck up. The trunk hasn't been touched in years
> (before I came on the project and kind of by default took over
> control of the version control process), and is so far out of date
> with the current that there's no history of interest there.
>
> I don't have a '--accept-theirs-full' option listed either in the
> red book or in "svn help merge". I got a private suggestion to try
> the "--reintegrate" option, which I also don't have. I neglected to
> mention that we're still on svn 1.4, which may be why I don't have
> those options available.
I do believe you're right, but want to point out that the merge option
should leave a change history if you were using 1.5 or later, as opposed
to having "no record of where they came from". I say should, because -
well, your merge shouldn't have needed the --accept option to behave that
way in the first place, so it shouldn't be a complete surprise if you get
strange results from other operations.
<mike
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1860763
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Weird merge problem
Posted by Ron Hunter-Duvar <ro...@oracle.com>.
Mike Meyer wrote:
>
>
> Ron Hunter-Duvar <ro...@oracle.com> wrote on 04/21/2009
> 05:51:06 PM:
>
> >
> >
> > Bob Archer wrote:
> > The last commit to trunk was r1003. The branch was made at r7232
> >
> > (based
> >
> > on "svn log --stop-on-copy") and worked on up to r12212 (the current
> > head revision), then frozen. I checked out a clean working copy of
> >
> > trunk
> >
> > at r12212. From within the clean trunk working copy I did this
> >
> > command:
> >
> > svn merge -r 7232:12212 $REPOS/branch
> >
> >
> > Don't you need to specify the branch folder???
> >
> > svn merge -r 7232:12212 $REPOS/branch/ThisBranchHere
> >
> > Usually you copy into a folder of branch when you do the branch. Don't
> > you?
> >
> > What if you just try:
> >
> > svn merge $REPOS/branch
> >
> > if you are using svn 1.5 or newer it should figure out what revision
> > range needs to be merged.
> >
> > That said... if you just want to move your branch as is to your trunk
> > you can delete trunk and copy the branch to trunk.
> >
> > BOb
> >
> > When I said $REPOS/branch that was just short hand for the full url,
> > svn://<repository>/branches/<name-of-branch>. I know I got that part
> > right (if I didn't, it would have made a much bigger mess, pulling
> > in a bunch of old branches).
> >
> > I was working around the problem by deleting all the *.working and
> > *.merge-left.r0 files and moving all the *.merge-right.r12212 files
> > to their base names, and some other clean up (seems merge won't
> > delete stuff that's in trunk but was deleted from branch). But I
> > think your delete and copy is a much better solution. I'll do that
> > instead. Thanks.
>
> I don't like that solution - I feel like it mucks up the history of
> the trunk. I'd do the merge with "--accept theirs-full" instead, which
> will do what you did with the merge files - only automatically. The
> end result will be the same, except for the history, so it's realy
> just a matter of which you prefer.
>
> <mike
Actually, compared to committing several thousand individual changes,
with no record of where they came from other than the log message, a
simple delete and copy with clear log messages tells me more. Keep in
mind that this is an unusual case, in that there is no trunk history to
muck up. The trunk hasn't been touched in years (before I came on the
project and kind of by default took over control of the version control
process), and is so far out of date with the current that there's no
history of interest there.
I don't have a '--accept-theirs-full' option listed either in the red
book or in "svn help merge". I got a private suggestion to try the
"--reintegrate" option, which I also don't have. I neglected to mention
that we're still on svn 1.4, which may be why I don't have those options
available.
But thanks for the input.
Ron
--
Ron Hunter-Duvar
All opinions expressed here are mine, and do not necessarily represent
those of my employer.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1849442
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Weird merge problem
Posted by Mike Meyer <mm...@lexmark.com>.
Ron Hunter-Duvar <ro...@oracle.com> wrote on 04/21/2009
05:51:06 PM:
>
>
> Bob Archer wrote:
> The last commit to trunk was r1003. The branch was made at r7232
>
> (based
>
> on "svn log --stop-on-copy") and worked on up to r12212 (the current
> head revision), then frozen. I checked out a clean working copy of
>
> trunk
>
> at r12212. From within the clean trunk working copy I did this
>
> command:
>
> svn merge -r 7232:12212 $REPOS/branch
>
>
> Don't you need to specify the branch folder???
>
> svn merge -r 7232:12212 $REPOS/branch/ThisBranchHere
>
> Usually you copy into a folder of branch when you do the branch. Don't
> you?
>
> What if you just try:
>
> svn merge $REPOS/branch
>
> if you are using svn 1.5 or newer it should figure out what revision
> range needs to be merged.
>
> That said... if you just want to move your branch as is to your trunk
> you can delete trunk and copy the branch to trunk.
>
> BOb
>
> When I said $REPOS/branch that was just short hand for the full url,
> svn://<repository>/branches/<name-of-branch>. I know I got that part
> right (if I didn't, it would have made a much bigger mess, pulling
> in a bunch of old branches).
>
> I was working around the problem by deleting all the *.working and
> *.merge-left.r0 files and moving all the *.merge-right.r12212 files
> to their base names, and some other clean up (seems merge won't
> delete stuff that's in trunk but was deleted from branch). But I
> think your delete and copy is a much better solution. I'll do that
> instead. Thanks.
I don't like that solution - I feel like it mucks up the history of the
trunk. I'd do the merge with "--accept theirs-full" instead, which will do
what you did with the merge files - only automatically. The end result
will be the same, except for the history, so it's realy just a matter of
which you prefer.
<mike
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1849296
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Weird merge problem
Posted by Ron Hunter-Duvar <ro...@oracle.com>.
Bob Archer wrote:
>> The last commit to trunk was r1003. The branch was made at r7232
>>
> (based
>
>> on "svn log --stop-on-copy") and worked on up to r12212 (the current
>> head revision), then frozen. I checked out a clean working copy of
>>
> trunk
>
>> at r12212. From within the clean trunk working copy I did this
>>
> command:
>
>> svn merge -r 7232:12212 $REPOS/branch
>>
>
> Don't you need to specify the branch folder???
>
> svn merge -r 7232:12212 $REPOS/branch/ThisBranchHere
>
> Usually you copy into a folder of branch when you do the branch. Don't
> you?
>
> What if you just try:
>
> svn merge $REPOS/branch
>
> if you are using svn 1.5 or newer it should figure out what revision
> range needs to be merged.
>
> That said... if you just want to move your branch as is to your trunk
> you can delete trunk and copy the branch to trunk.
>
> BOb
>
When I said $REPOS/branch that was just short hand for the full url,
svn://<repository>/branches/<name-of-branch>. I know I got that part
right (if I didn't, it would have made a much bigger mess, pulling in a
bunch of old branches).
I was working around the problem by deleting all the *.working and
*.merge-left.r0 files and moving all the *.merge-right.r12212 files to
their base names, and some other clean up (seems merge won't delete
stuff that's in trunk but was deleted from branch). But I think your
delete and copy is a much better solution. I'll do that instead. Thanks.
I'd still like to know what I did wrong though. Or is this how merge is
supposed to work (I hope not)?
Ron
--
Ron Hunter-Duvar
All opinions expressed here are mine, and do not necessarily represent
those of my employer.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1849222
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Weird merge problem
Posted by Bob Archer <bo...@amsi.com>.
> The last commit to trunk was r1003. The branch was made at r7232
(based
> on "svn log --stop-on-copy") and worked on up to r12212 (the current
> head revision), then frozen. I checked out a clean working copy of
trunk
> at r12212. From within the clean trunk working copy I did this
command:
>
> svn merge -r 7232:12212 $REPOS/branch
Don't you need to specify the branch folder???
svn merge -r 7232:12212 $REPOS/branch/ThisBranchHere
Usually you copy into a folder of branch when you do the branch. Don't
you?
What if you just try:
svn merge $REPOS/branch
if you are using svn 1.5 or newer it should figure out what revision
range needs to be merged.
That said... if you just want to move your branch as is to your trunk
you can delete trunk and copy the branch to trunk.
BOb
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1849165
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].