[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

How do I refactor without confusing Subversion? [SEC=UNCLASSIFIED]

From: Thamm, Russell <russell.thamm_at_dsto.defence.gov.au>
Date: Tue, 29 Jan 2013 13:35:42 +1030

UNCLASSIFIED

Howdy,

I am running subversion 1.5.1 and TortoiseSvn 1.5.2.

I recently refactored my Java code in a branch ie moved java source
files to different directories.

Although Subversion is aware that the unmoved files in the trunk are the
same as the moved files in the branch (according to the revision
graphs), when it comes to merging, subversion seems to lose the plot.

When I attempt to merge the trunk into the branch, I get a whole bunch
of "Skipped missing target" errors. I only get these errors on moved
files. It seems that subversion is trying to merge
trunk/old-path/javafile.java with branch/old-path/javafile.java instead
of branch/new-path/javafile.java. Following is the revision history for
one such file:

1296 File added to subversion.
1340 Branch created
1355 Branch version modified
1369 Branch version modified
1382 Trunk version modified
1454 Moved in branch
1462 Branch version modified (refactoring code changes included)

Have I done something wrong or is this a limitation with subversion?

Perhaps I should have merged the trunk changes into the branch before
doing any moving, but it seems to me that subversion shouldn't require
that.

I can manually merge the files in question but what happens when I merge
my branch back into the trunk?

How I merged
--------------------

I did a "Merge a range of revisions" with TortoiseSvn, specifying a
range from 1340-HEAD where 1340 is the revision where I created the
branch.

Everything appears good apart from the aforementioned errors. I haven't
committed the merge yet.

How I refactored
-----------------------

I had two working copies of the branch, in one I did the moves using
Eclipse refactoring (causes code changes) and in the other I did the
same moves using TortoiseSvn. I checked-in all moves from the second wc.
I then copied the code changes from the first to the second (WinMerge),
checked-in the second wc again and then updated the first wc.

I can't use the Eclipse subversion plugins as none support linked
resources. This double-handling was such a pain that I have decided to
again refactor my code so that I don't have to use linked resources in
Eclipse - but that requires more of the same moving that apparently
confuses Subversion so much.

Cheers
Russell Thamm

IMPORTANT: This email remains the property of the Department of Defence
and is subject to the jurisdiction of section 70 of the Crimes Act 1914.
If you have received this email in error, you are requested to contact
the sender and delete the email.
Received on 2013-01-29 13:34:25 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.