There is a project in Java where I work.
To have the project in Mercurial I know that I have to make a repository for all the classes.
As there is a lot of classes I think if maybe I can have a copy of a jar made of a copy of the repository plus the modifications I have to do.
So in Mercurial terms there is:
- A main repo with all the classes
- A litle repo with modifications and new classes
I want to do merge from B repo to A repo. And then I want to pull and update only the classes (*.java) that exists in my B repo.
I have tried unsuccessfully this:
- To create B repo I clone A repo and I delete all the files.
- When I have to modify a .java I do a
wget
of the particular file the mercurial server in my local machine. When the file is new I just run hg add. - To do the commits I do
hg commit -I file1 -i file2 ... -i fileN
for all the files existing in the working folder of B repo.
Then the unsuccessful part:
- I can´t do a hg update only of the existing files.
- When the B repo is merged in A repo
it's all ok. But I can't run hg
commit of a merged state with
-I
parameter. Its all or nothing. - When I pull from A repo and I try to update I have the same issue 4.
I am aware of hg pull -f
for start with a unrelated repo for B repo instead of a clone. But it has the same issue of the update. And it looks pretty ugly.
I think that transplant plugin it may help. I also read this http://stackoverflow.com/questions/12843/how-to-combine-two-projects-in-mercurial.
Preserving the history of files in A Repo is a must, even if this history was generated in B Repo.
Do you know the best way to achieve this?
thanks