views:

193

answers:

2

I'm extracting an interface that I would like to retain the original name. The actual class will get a "Impl" suffix, in accordance with our naming conventions. I want to know how to best reflect that in subversion so that the history "AppPropertiesImpl.java" covers its life as "AppProperties.java". As for the new "AppProperties.java", I'm thinking it could be either a new file or a copy of the old. Any idea how to pull this off?

Here's what I have now:

AppProperties.java

public class AppProperties {
    public static final CONSTANT_ONE = "CONSTANT_ONE";

    private String propertyOne;

    public String getPropertyOne() {
        return propertyOne;
    }

    public String setPropertyOne(String propertyOne) {
        this.propertyOne = propertyOne;
    }
}

And I want to end up with:

AppProperties.java

public interface AppProperties {
    public static final CONSTANT_ONE = "CONSTANT_ONE";
    String getPropertyOne();
    String setPropertyOne(String propertyOne);
}

AppPropertiesImpl.java

public class AppPropertiesImpl implements AppProperties {
    private String propertyOne;

    public String getPropertyOne() {
        return propertyOne;
    }

    public String setPropertyOne(String propertyOne) {
        this.propertyOne;
    }
}
+1  A: 

Rename AppProperties.java to AppPropertiesImpl.java (using svn rename) and commit. Afterwards change your files and add the new AppProperties.java to Subversion. Voilá.

Bombe
I'd prefer to do this in one commit as we have a CI running that'll complain.
sblundy
Then you have to create a branch for that change. `svn rename` (or `svn move`) always create a commit, as far as I know.
Bombe
+1  A: 

If you want to keep the history of the file you want to use svn move

svn move AppProperties.java AppPropertiesImpl.Java
Ken