unofficial mirror of emacs-devel@gnu.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 10:29:21 +0200	[thread overview]
Message-ID: <878ss1a0f2.fsf@mat.ucm.es> (raw)
In-Reply-To: cd28ec92-f709-98f2-6064-ab41d4b5a02b@cs.ucla.edu

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

>>> "PE" == Paul Eggert <eggert@cs.ucla.edu> writes:

> On 8/9/19 8:40 AM, Uwe Brauer wrote:
>> Any change to tell emacs to use the mercurial hash tag?

> Sorry, it's not clear what you're asking for here. If you'd like to
> write and debug the feature it sounds like it'd be a good thing to add
> to Emacs, though I wouldn't expect it to appear unless a
> Mercurial-using developer takes the initiative to develop it since it
> should be needed only by developers of Emacs.

I know mercurial reasonably well (but I am not a mercurial developer). I
am compiling and running the GNU emacs from the git repository.
As I said I cloned it to mercurial using the git plugin.
This plugin translate the git and the mercurial hash with out problem.

I looked now in the relevant code in version.el

It goes as follows:
#+begin_src elisp :noexport

(defun emacs-repository-version-git (dir)
  "Ask git itself for the version information for directory DIR."
  (message "Waiting for git...")
  (with-temp-buffer
    (let ((default-directory (file-name-as-directory dir)))
      (and (eq 0
	       (with-demoted-errors "Error running git rev-parse: %S"
		 (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
	   (progn (goto-char (point-min))
		  (looking-at "[0-9a-fA-F]\\{40\\}"))
	   (match-string 0)))))


(defun emacs-repository-get-version (&optional dir external)
  "Try to return as a string the repository revision of the Emacs sources.
The format of the returned string is dependent on the VCS in use.
Value is nil if the sources do not seem to be under version
control, or if we could not determine the revision.  Note that
this reports on the current state of the sources, which may not
correspond to the running Emacs.

Optional argument DIR is a directory to use instead of `source-directory'.
Optional argument EXTERNAL is ignored."
  (emacs-repository-version-git (or dir source-directory)))
#+end_src

The git command 

git rev-parse HEAD

corresponds to the mercurial command 

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

I will try to implement the relevant 
emacs-repository-version-hg 

Command. Not sure what to do with emacs-repository-get-version though.
Maybe I should define a new variable

 emacs-use-hg 

Which per default is nil.

Not sure 


Uwe Brauer 

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

  parent reply	other threads:[~2019-08-10  8:29 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=878ss1a0f2.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).