eclipse - Subclipse tree conflicts -
i'm trying merge trunk branch, ending lot of tree conflicts, leaving no files merged. resolve conflicts, i'm opening file , copying contents hand defeats purpose of merge operation. right way merge trunk branch (in subclipse) ?
how branch created? created using svn cp
, or files manually copied branch?
let's @ following:
$ svn mkdir trunk $ vi trunk/foo trunk/bar $ svn add trunk/foo trunk/bar $ svn commit -m"added foo , bar trunk"
you have 2 files on trunk.
$ svn mkdir --parents branches/1.0 $ cp trunk/* branches/1.0/ $ svn add branches/1.0/* $ svn commit -m"duplicated files onto branch"
what have done create 2 entirely different foo
, bar
on 1.0 branch. these 2 files, according subversion have absolutely nothing each other. if make change on 1.0 branch, , attempt merge these changes trunk, lot of conflicts messages "local add, incoming add".
what above user should have done this:
$ svn cp --parents trunk branches/1.0 $ svn commit -m"branched trunk , not merely duplicate files"
now, there's relationship subversion understands between files on trunk , on 1.0 branch. merging go smoothly.
here's way break merge:
$ svn delete trunk/foo $ svn commit -"deleted foo" $ svn cat -rprev trunk/foo@prev > foo $ svn add foo $ svn commit -m"added foo in. shouldn't have deleted it.
according subversion, there 2 different files named foo
in trunk. there's file deleted, , there's file added. these 2 files have nothing each other. imagine if branched (the correct way using svn cp
) 1.0 branch, did delete , copy of foo
. merge of 1.0 branch trunk have conflict because foo
on branch has no relationship foo
on trunk.
to restore file, need copy revision deleted (or use svn merge -c
).
$ svn cp -rprev http://svn.repo/svn/trunk/foo@prev . $ svn commit -m"actually old foo has been restored! merges work"
if branched incorrectly, or deleted , re-added files trunk, conflicts. can try using --ignore-ancestory
parameter, , can use --dry-run
test merge before running actual merge.
if manually merge, can use svn merge --record-only
record fact did merge without doing one. might next time merge since you're @ least recoding you've manually done.
Comments
Post a Comment