Mark Replaced
Use Modify|Mark Replaced to mark modified files or a directory as replaced, see Common Primary File States for details.
Marking modified files or a directory as replaced does not affect the contents of the files or directories, but only the meaning of the commit and the history of the directory/files. This can be useful to express that the content of a directory/files is not related to its previous revision. The Log of such a directory/files will not go beyond the replacement revision, meaning that the directory/files has been created at that revision.
Example
For example, we have a Java interface
Person.java
and one implementing classPersonImpl.java
. As the result of a refactoring, we are getting rid of the interfacePerson.java
and rename the classPersonImpl.java
toPerson.java
. This results in a removed filePersonImpl.java
and a modified filePerson.java
.When simply committing these changes, this would mean that the class
PersonImpl.java
has been removed and the interfacePerson.java
has been changed to a classPerson.java
, with no history except of that one of the interface.Taking a closer look at this situation, it would be better to do a commit meaning that the interface
Person.java
has been removed and the classPersonImpl.java
has been renamed toPerson.java
. At least that was the intention of our refactoring and it would also mean to preserve the history ofPersonImpl.java
forPerson.java
.To achieve this, we will use Mark Replaced on
Person.java
and then we will use Move onPerson.java
andPersonImpl.java
, performing a ‘post-move’ between both files (for details refer to Move), yielding a removedPersonImpl.java
and a replacedPerson.java
, which has its history (Copy From) set toPersonImpl.java
.