These instructions will work generally for pushing to any remote URL, but the example is specifically for BitBucket. The steps specifically require TortoiseHg, which includes Mercurial Keyring. If not using Tortoise, you would need to install Keyring yourself.
Open Tortoise Hg Workbench, Open File > Settings > Global (or repository) Settings > Extensions
Click OK, Close and restart Workbench as directed.
Open File > Settings > Repository Settings. Click Edit File
In the repository’s .hg\hgrc file, add the following setting. Including the username at the start of the URL eliminates the need for an “admin” setting. Note that the password is not stored here.
# Generated by TortoiseHg settings dialog [paths] BitBucket=https://firstname.lastname@example.org/bladewolf55/eduagent
Save, close Workbench and reopen.
Push the repository. You’ll be prompted for the password. After a successful push, you won’t be prompted again for the password. It has been locally stored encrypted.