Git - clone THEN reset or checkout:
( full clone then:
git reset --hard 754bda21cbc5c9044daf7f968fb9b4ffae39e334
)Mercurial - just do it:
(
hg clone -r 34dea6ddb0b927dc223c8cdbab4314a3aac355a7 https://bitbucket.org/wrightsolutions/local-bin
)In the screenshot above, I have cloned as described, and then removed the repo and done a full clone.
By doing this I hoped to illustrate the key difference in changeset counts:
- 'clone at revision' gave 77 changesets with 99 changes to 83 files
- full clone gave 79 changesets with 101 changes to 84 files
Next I give a signature style explanation of the 'clone at revision' command
hg clone -r <sha1> source_repo
Notes and Further Reading:
But, but, but with Git you can just create an empty git and thengit remote add origin https://github.com/jquery/jquery.git
git fetch origin 754bda21cbc5c9044daf7f968fb9b4ffae39e334
Try it and you might just see the Git complaint...
'fatal: reference is not a tree: 754bda21cbc5c9044daf7f968fb9b4ffae39e334'
Another nicety of Mercurial is that you can use shortened references (just the first 7 characters) and in most cases that will get you what you want.
Seven character abbreviation example:
hg clone -r 34dea6d https://bitbucket.org/wrightsolutions/local-bin
( rather than the full 40 character reference used in the example above )
Note: Where you have a huge repository like say sagemath which has 100 active committers, then you might want to use the full 40 character reference to be sure of requesting the right revision
There is an excellent Mercurial Hints and Tips page at OpenOffice.org
See hg.sagemath.org for current Sagemath repository.
Most contributions are currently handled by registered lists I think, but if you have taken the time to really understand the code, then there is place for pull requests also.