You identify the repository you push from. When you construct the Repository object.
A Mercurial repository have the notion of saved remote repositories, that have a "nickname", typically you will have a remote repository nicknamed "default", but this is not required.
When you push you have the following options:
* push and do not mention where to, in this case the default remote repository will be used (the one nicknamed "default")
* push and specify the nickname of the remote repository to push to
* push and specify the full URL to the remote repository
Hope this answered your question, if not please elaborate.