Mercurial Best Practices
Friday Aug 17, 2007
These are some good practices for those who are not familiar with Mercurial Source Code Management (SCM) tool. Assuming that you are working on many Mercurial based repositories on OpenSolaris.org community, and your local workspaces are inside SWAN.
- understand the differences between Mercurial and Subversion
check my other blog Differences between Subversion and Mercurial for more details - register an account in OpenSolaris.org community,
and upload your ssh pub key in your profile page - subscribe to the mailing list that repository will send commit notifications to,
otherwise the mailing list will reject the notification email for your putbacks - create proper $HOME/.hgrc file
[ui]
username = [your account on OpenSolaris community]
[extensions]
hgext.fetch = - use ssh proxy if you cannot connect to hg.opensolaris.org server directly
vi $HOME/.ssh/configHost *.opensolaris.org
you can get available sock5 proxy list from internal web page
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect -h [socks proxy address] %h %p - clone from SWAN parent to save time
clone from hg.opensolaris.org directly may be very slow some times. if true,
you can clone from SWAN parent, then re-direct the parent to hg.opensolaris.org one.
the parent info is kept in 'default' entry of [WS]/.hg/hgrc file - update local workspace before making local modifications
this will avoid potential multiple heads mess
note: 'hg fetch' will do 'hg pull && hg up && hg merge && hg commit' for you
'hg fetch' cmd only available when you enable hgext.fetch extension
in $HOME/.hgrc (tips #4) - if multiple heads encountered in local workspace
please use 'hg merge && hg commit' to eliminate it locally.
DO NOT use 'hg push -f' to force the putback,
otherwise it will propagate the heads to the parent workspace!
you can also use 'hg rollback' to undo last commitscenario:
you make local modifications, then 'hg commit'.
after that, you also 'hg pull && hg up', then two heads encountered.
solution:
-- 'hg rollback' to undo last commit
-- 'hg pull && hg up' to update workspace
-- 'hg ci' again to commit local modifications
-- 'hg push' to put back your commits
reference:
check 'hg help rollback' for more details












These are some good practices for those who are no...
aboat runescape items
Looking for rare <a href=...
aboat runescape items
Looking for rare <a href=...
[url=
<a href=" <...