[haiku-development] Re: Mercurial version string Was:Re: Re: VOTE: Git or Mercurial (hg) as Haiku's new source control tool

  • From: Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 12 May 2011 13:49:17 +0200

Hi,

2011/5/12 Brecht Machiels <brecht@xxxxxxxxxxx>:
> On Wed, 11 May 2011 23:17:57 +0200, Niels Sascha Reedijk
> <niels.reedijk@xxxxxxxxx> wrote:
>
>> Well, here's my attempt at getting a meaningful revision string (like
>> I put in the other thread). For my tree, with two custom commits, the
>> output would be:
>>
>> custom:64fc2d4b5805~2011-05-11 derived from
>> haiku-central:47b487e35b93~2011-05-07
>>
>> In case of connection troubles, it would be:
>>
>> unverified:64fc2d4b5805~2011-05-11
>
> Git can describe the remote branch without needing a network connection. I'm
> thinking the same data would be available to Hg, no?

Unlike git, hg does not keep track of remotes, so this data is not
available offline. The git-lookalike of this script would be able to
operate offline because of this, but only if the clone is directly
from haiku-central. If not, a (one-time) extra step needs to be taken
where a remote tracking branch has to be set up for Haiku. (I am not a
git expert though, so this might be easier/more difficult than I am
describing it here).

> Does the script also find out what haiku-central changeset the local tree is
> derived from in case it's not directly based on the haiku-central tree (but
> with some forks in between)? That wouldn't be possible without a network
> connection, I suppose.

I am not sure I got your question completely right, but if you are
asking what happens if this line of development is not directly based
on haiku-central, but (for example) a gallium-3d tree, then the answer
is the following. The script runs the following query on line 28:

parents(outgoing('$HAIKU_URL')) and not outgoing('$HAIKU_URL') and
ancestors(tip)

The outgoing('$HAIKU_URL') checks all the changesets that are in this
tree against haiku-central. Thus a custom build does not have to be
checked out from haiku-central, but can be checked out from any
derivative.

The parents() function gets the parents. Say the outgoing changesets
were 101, 102 and 103. The parents would be 100, 101 and 102. Of
course, 101 and 102 are not of interest as they are not in
haiku-central, so we filter those out with _and not outgoing()_.
Finally, you might have more than one head that is outgoing (say you
also have one or more sub-branches), so we verify that we only get the
parents for the changesets that are direct ancestors for the changeset
that we currently build against. This changeset is called 'tip'.

So that's the logic here.

Regards,

N>

Other related posts: