0. Install a mercurial on Ubuntu
sudo apt-get install mercurial
1. Create a project and commit
> hg init my_dir
> [ add some files ]
> hg add [new files or directories]
> hg commit -u username
2. Clone a project
hg clone ssh://user@IP//tmp/test
hg update
OR
hg clone https://user@bitbucket.org/dst
hg update
3. Status and Summary
hg status
hg summary
4. Revert and diff
hg diff [ file]
hg revert -r version
hg revert file
5. Push and Pull
hg push ssh://user@IP//tmp/test
hg pull ssh://user@IP//tmp/test
6. Update
hg tip
hg update
hg update version
7. View the log
hg log
hg log -v -r version
hg log -v -p -r version
8. Remove and rollback
hg rm file or dir
hg rollback // Only for once !
9. Export and import
hg export changeset > 1.patch
hg import 1.patch