I maintain Merucrial repository for an Android application / Java based sources with package name com.company.app. As with any Android application I had the following directory structure, at directory called origProj
+--assets
+--res
+--src
+-- com
+-- company
+-- app
Now I have to change the package name to net.company2.app. The name of the java source files does not change (only the package statement in each file changes). I want to continue using the same repository. I do not want to loose the history/information associated with various commits I have made in the past. How do I do this?
I made a copy of the origProj directory (using Windows file explorer) to newProj– and changed the sub-directories to reflect the new package name –
+--assets
+--res
+--src
+-- net
+-- company2
+-- app
It all worked, but when I open the repository to “commit” changes I made, the files listed are messy – I mean there are entries with the older directory structure. It doesn’t surprise me because I realize I did not do it the “Mercurial” way. What is the correct way to do this? I looked into the mercurial Definitive guide – I could not locate the sections relevant to what I am doing- maybe the language/terms are something I could not relate to. Please help.
You want
hg mvof the classes to be refactored, commit, then refactor the classes with the new package name and commit again.purgeis not what you want, it removes the files and directories not under version control.