I am looking for simple solution for my deployment bash script.
Each run of this script should add tag to the latest revision on production
branch, but of the remote repo.
People running the script might have own production
changesets, not pushed to the remote repo, and my server is getting code directly from the remote repo with read-only access. This is why I need to get latest changeset from remote repo, but commit tag locally.
I tried tricks like:
hg identify -i $(hg paths default)
hg heads production
Hope there is something else that I'm missing and there is a way to get that remote branch head revision id..
Through experimentation, I was able to tweak the answer above and make it one process exec rather than two (i.e, it skips hg paths default
), if that's important to you:
hg identify --id --rev production default
If you want the local revision for a specific branch (rather than current branch), then use:
hg identify --id --rev production
Where production
is the branch you want.
I think what you're looking for is:
hg identify --id $(hg paths default)#production
That's using the #revision
specifier, which is described in hg help urls
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With