all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-devel@gnu.org
Subject: Re: emacs-repository-version not defined when cloned with mercurial
Date: Sat, 10 Aug 2019 15:12:18 +0200	[thread overview]
Message-ID: <87lfw16u6l.fsf@mat.ucm.es> (raw)
In-Reply-To: 83k1bl8fm2.fsf@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2031 bytes --]



   > 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
it.

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)

options:

 -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 
call 
hg parents --template '{node}\n'

Is correctly translated to the 

call-process 

Thanks

Uwe Brauer 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

  reply	other threads:[~2019-08-10 13:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 15:40 emacs-repository-version not defined when cloned with mercurial Uwe Brauer
2019-08-09 20:24 ` Paul Eggert
2019-08-10  7:52   ` Sven Joachim
2019-08-10  8:35     ` Uwe Brauer
2019-08-10  8:29   ` Uwe Brauer
2019-08-10  9:17     ` Stefan Monnier
2019-08-10  9:54       ` Eli Zaretskii
2019-08-10 10:09         ` Uwe Brauer
2019-08-10 10:44           ` Eli Zaretskii
2019-08-10 13:12             ` Uwe Brauer [this message]
2019-08-10 13:33               ` Eli Zaretskii
2019-08-10 13:58                 ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfw16u6l.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.