emacs-devel
[Top][All Lists]
Advanced

[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 10:29:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>>> "PE" == Paul Eggert <address@hidden> 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: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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