简体   繁体   中英

Mercurial difference between changesets and revisions

I'm new to Mercurial and trying to understand how things work.

I wonder what is the difference between changesets and revisions ?

Thanks.

None.

From the Understanding Mercurial page:

When you commit, the state of the working directory relative to its parents is recorded as a new changeset (also called a new " revision ")...

and further down the page:

Mercurial groups related changes to multiple files into single atomic changesets , which are revisions of the whole project.

(emphasis mine)

Even if old, someone might stumble on this and I would say that there's a crucial difference. They are related as @Edward pointed out. Still, based on Mercurial's FAQ they are not the same.

A revision number is a simple decimal number that corresponds with the ordering of commits in the local repository.

The important part is local repository and further:

It is important to understand that this ordering can change from machine to machine due to Mercurial's distributed, decentralized architecture. This is where changeset IDs come in. A changeset ID is a 160-bit identifier that uniquely describes a changeset and its position in the change history, regardless of which machine it's on.

You should always use some form of changeset ID rather than the local revision number when discussing revisions with other Mercurial users as they may have different revision numbering on their system.

From experience I can tell, revision numbers do differ sometimes and are not unique.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM