MacHg icon

MacHg Repository Identities

MacHg uses repository identities to determine which repositories are "compatible" to other repositories. What we desire is some basic unique ID or hash which is the same for repositories that start off from the same root. Ie, if two repositories had some common point in the past where they where the same, then these repositories should share the same "identity", and if they where never the same at any time in the past then they should have different "identities". Repositories with the same "identity" are said to be compatible.

Happily, in MacHg we can use the changeset hash of the very first commit to a Mercurial repository as the identity of the repository. To obtain the changeset hash of the very first commit one can issue the Mercurial command:

hg identify --rev 0 repository

The answer returned will be the short form hash (12 hexdigit) of the very first commit to the repository. Eg for the MacHg repository itself the identity is 2f65baedb090. This identify command works on local repositories as well as on repositories stored on servers.

Unfortunately one problem is that repositories resident on google code servers or subversion servers accessed through the hgsubversion extension don't respond correctly to this identify command. To work around this you can clone the repository on the server to a local repository and then simply issue the identify command locally to determine the repositories identity, and then enter this identity in the advanced options of the server configuration.


Related Topics

About Repository Lists

Adding Server Repository

Manage an existing Repository

Clone a Repository

Pull changes from other Repositories into your Repository

Push changes in your Repository to other Repositories