I have got a question regarding suprepositories. Our project is set up like this:
+ projectA
+ some files
+ dependencyA
+ some files
dependencyA
is a subrepository. It was created this way:
- cd projectA
- mkdir dependencyA
- cd dependencyA
- hg init
- hg pull ssh://hg@somerandomiphere/dependencyA
- cd ..
- echo dependencyA = ssh://hg@somerandomiphere/dependencyA > .hgsub
- hg add
- hg commit
- hg push
If I make changes to the suprepository, then commit and push them from main project. Both of them will be pushed to the server since its recursive. Now my colleague wants to pull changes from the server. But since nothing was changed in the main project, it wont work. But if I change something in the main project and push it to server. Upon hg pull
he will get the newest changeset and if he does hg update
then, it will update the subrepository as well. This is expected behaviour.
Now my question would be, if there is a way to pull changes, but only for subrepository without making a new clone of it or what would be the best way to do it.
What was suggested above works like I thought it would. The real problem was my way of creating a subrepository.
Instead of:
It should have been a simple:
As we know
.hgsusbtate
will lock the subrepo on specific revision after commit. This is what happened, but (!) doinghg pull
in subrepository ended with an errorSo this means my subrepo was locked on the revision it was updated after commit and it could not pull changes from its repository due to the error shown above. Why this happened is explained pretty well in this accepted answer.
Solution:
cloning is the way to go