You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Thamm, Russell" <ru...@dsto.defence.gov.au> on 2013/01/29 04:05:42 UTC

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

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. 



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

Posted by "Thamm, Russell" <ru...@dsto.defence.gov.au>.
UNCLASSIFIED

 
In any case, its probably about time to upgrade. (-:

-----Original Message-----
From: Daniel Shahaf [mailto:danielsh@apache.org]
Sent: Thursday, 31 January 2013 6:24 PM
To: Thamm, Russell
Cc: users@subversion.apache.org; Andreas Tscharner
Subject: Re: How do I refactor without confusing
Subversion?[SEC=UNCLASSIFIED]

We're working on better move/rename support for 1.8, but I'm not sure
whether your specific use-case will already be fixed in 1.8 or not.
Maybe one of the other devs can comment on that.

Thamm, Russell wrote on Wed, Jan 30, 2013 at 13:39:38 +1030:
> UNCLASSIFIED
> 
> Thanks Andreas,
> 
> This seems like a significant limitation with subversion.  
> 
> Cheers
> Russell Thamm
> 
> 
> -----Original Message-----
> From: Andreas Tscharner [mailto:Andreas.Tscharner@metromec.ch]
> Sent: Wednesday, 30 January 2013 12:55 AM
> To: Thamm, Russell; users@subversion.apache.org
> Subject: RE: How do I refactor without confusing Subversion?
> [SEC=UNCLASSIFIED]
> 
> 
> [snip]
> > 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
> 
> [snip]
> > Have I done something wrong or is this a limitation with subversion?

> 
> This is a limitation of subversion. Subversion does not track 
> renames/moves for merging.

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.


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

Posted by Daniel Shahaf <da...@apache.org>.
We're working on better move/rename support for 1.8, but I'm not sure
whether your specific use-case will already be fixed in 1.8 or not.
Maybe one of the other devs can comment on that.

Thamm, Russell wrote on Wed, Jan 30, 2013 at 13:39:38 +1030:
> UNCLASSIFIED
> 
> Thanks Andreas,
> 
> This seems like a significant limitation with subversion.  
> 
> Cheers
> Russell Thamm
> 
> 
> -----Original Message-----
> From: Andreas Tscharner [mailto:Andreas.Tscharner@metromec.ch]
> Sent: Wednesday, 30 January 2013 12:55 AM
> To: Thamm, Russell; users@subversion.apache.org
> Subject: RE: How do I refactor without confusing Subversion?
> [SEC=UNCLASSIFIED]
> 
> 
> [snip]
> > 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
> 
> [snip]
> > Have I done something wrong or is this a limitation with subversion? 
> 
> This is a limitation of subversion. Subversion does not track
> renames/moves for merging.

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

Posted by "Thamm, Russell" <ru...@dsto.defence.gov.au>.
UNCLASSIFIED

Thanks Andreas,

This seems like a significant limitation with subversion.  

Cheers
Russell Thamm


-----Original Message-----
From: Andreas Tscharner [mailto:Andreas.Tscharner@metromec.ch]
Sent: Wednesday, 30 January 2013 12:55 AM
To: Thamm, Russell; users@subversion.apache.org
Subject: RE: How do I refactor without confusing Subversion?
[SEC=UNCLASSIFIED]


[snip]
> 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

[snip]
> Have I done something wrong or is this a limitation with subversion? 

This is a limitation of subversion. Subversion does not track
renames/moves for merging.

Best regards / Freundliche Gr?sse
WENZEL Metromec AG
	Andreas Tscharner
--
Andreas Tscharner, Development
WENZEL Metromec AG, Rheinfelsstrasse 1, CH-7007 Chur, Switzerland
phone:          +41 (0)81 257 07 00
fax:            +41 (0)81 257 07 01
e-mail:         mailto:andreas.tscharner@metromec.ch 
www:            http://www.metromec.ch

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.


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

Posted by Andreas Tscharner <An...@metromec.ch>.
[snip]
> 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 

[snip]
> Have I done something wrong or is this a limitation with subversion? 

This is a limitation of subversion. Subversion does not track renames/moves for merging.

Best regards / Freundliche Gr?sse
WENZEL Metromec AG
	Andreas Tscharner
-- 
Andreas Tscharner, Development
WENZEL Metromec AG, Rheinfelsstrasse 1, CH-7007 Chur, Switzerland
phone:          +41 (0)81 257 07 00
fax:            +41 (0)81 257 07 01
e-mail:         mailto:andreas.tscharner@metromec.ch 
www:            http://www.metromec.ch