[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-repository-version not defined when cloned with mercurial

From: Uwe Brauer
Subject: Re: emacs-repository-version not defined when cloned with mercurial
Date: Sat, 10 Aug 2019 15:12:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

   > The prop[osal is to have 

Sorry I am still confused. Do I understand that correctly
   > a script called 'git' which would call hg to
   > return the Git hash of a repository cloned with hg.  

    1. You want a (shell) script called git, although there is an
       executable called git?
   > Then Emacs will
   > get what it wants what it calls "git rev-parse".

    2. I don't see how, as I said 

 git rev-parse HEAD == hg parent  --template '{node}\n'

    so even with the ┬źdefinition┬╗
    alias git "hg parent  --template     '{node}\n'"
    would not work. 

I am sure I misunderstood you, but I would appreciate any clarification 

   > AFAIR, the hash is computed when Emacs is built, and is recorded in
   > the built Emacs.  It cannot be calculated after the build.

That makes a lot of sense. 

It think I know where is my mistake, however I am not sure how to solve

The git command to obtain the hash is as I said 

git rev-parse HEAD

And it is implemented as 

(call-process "git" nil '(t nil) nil "rev-parse" "HEAD")

and when I execute the call in the git repository it gives me the
correct hash.

The mercurial command is a bit more complicated 

hg parents --template '{node}\n'

(And maybe the ' cause some problem.

I used 
(call-process "hg" nil '(t nil) nil "parent" "--template '{node}\n'")

but when I execute (via M-:) then it does not give the correct answer.
It gives 

hg parents [-r REV] [FILE]

show the parents of the working directory or revision (DEPRECATED)


 -r --rev REV           show parents of the specified revision
 -T --template TEMPLATE display with template
    --mq                operate on patch repository

(use 'hg parents -h' to show more help)

Which is clear sign that not all the parameters were passed correctly. 

Could somebody please tell me how the 
hg parents --template '{node}\n'

Is correctly translated to the 



Uwe Brauer 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]