all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension
@ 2019-07-07  4:55 Valentin Gatien-Baron
  2020-11-26 11:56 ` Lars Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Valentin Gatien-Baron @ 2019-07-07  4:55 UTC (permalink / raw)
  To: 36534

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

Sometimes, vc-annotate in a file tracked by mercurial returns an
error like this instead of a proper annotate buffer:

abort: mercurial/merge.py: no such file in rev 9117c6561b0b

Here is a reproduction (requires the evolve extension to
be enabled, for instance as described here:
https://www.mercurial-scm.org/wiki/EvolveExtension):

  rm -rf /tmp/test
  hg init /tmp/test
  cd /tmp/test
  echo b > b
  hg commit -Am0
  echo a > a
  hg commit -Am1
  hg commit --amend -m 2
  if [ $(hg log -r . -T {rev}) = 1 ]; then
      echo "Error: cannot test as evolve is not enabled"
      exit 1
  fi
  emacs -Q a -f 'vc-annotate'


What happens is:
1. vc-annotate calls vc-working-revision
2. vc-hg-working-revision calls hg parent --template {rev} file
3. that command fails saying something like "abort: filtered revision
'3ee3303ecf2621381e5d5ca14aba73f2835facb5'!"
4. vc-hg-working-revision thus returns 0
5. vc-annotate calls `hg annotate -r 0 file`, which correctly errors
out, saying "abort: file: no such file in hex-rev-of-rev-0".

Step 3 is probably an hg bug. However `hg parent` was deprecated in
2014, so people may be reluctant to change it. And it would be simpler
for vc-hg-working-revision to call `hg log -r . -T {rev}` (vc-git does
that, so I assume that it works in general on top of fixing the
current issue). `.` means the current revision, see `hg help revset`.

So something like this:
(defun vc-hg-working-revision (file)
  "Hg-specific version of `vc-working-revision'."
  (ignore-errors
    (with-output-to-string
      (vc-hg-command standard-output 0 nil
    "log" "-r" "." "--template" "{rev}"))))

(another reason to stop using `hg parents` is that during a merge, it
will in most cases print two revisions, so if you annotate a file that
was last changed in revision 123, emacs will likely get 123123 back
and `hg annotate -r 123123` will fail)



In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.23.2)
 of 2018-08-27, modified by Debian built on lgw01-amd64-037
Windowing system distributor 'The X.Org Foundation', version 11.0.12001000
System Description: Ubuntu 18.10

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --build x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3
 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-nDyT48/emacs-25.2+1=.
-fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_MONETARY: fr_FR.UTF-8
  value of $LC_NUMERIC: fr_FR.UTF-8
  value of $LC_TIME: fr_FR.UTF-8
  value of $LANG: fr_FR.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50ocaml-mode.el (source)...done
Loading /etc/emacs/site-start.d/51tuareg-mode.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Annotating...
vc-do-command: Running hg annotate -dq -n -u --follow -r0 merge.py...FAILED
(status 255)
Mark set
Making completion list...

Load-path shadows:
/usr/share/emacs/site-lisp/elpa/rust-mode-0.3.0/rust-mode-pkg hides
/usr/share/emacs/site-lisp/elpa-src/rust-mode-0.3.0/rust-mode-pkg
/usr/share/emacs/site-lisp/elpa/rust-mode-0.3.0/rust-mode hides
/usr/share/emacs/site-lisp/elpa-src/rust-mode-0.3.0/rust-mode
/usr/share/emacs/site-lisp/elpa/rust-mode-0.3.0/rust-mode-autoloads hides
/usr/share/emacs/site-lisp/elpa-src/rust-mode-0.3.0/rust-mode-autoloads

Features:
(shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils vc-annotate vc
vc-dispatcher vc-hg python tramp-sh tramp tramp-compat auth-source
cl-seq eieio eieio-core cl-macs gnus-util mm-util help-fns mail-prsvr
password-cache tramp-loaddefs trampver ucs-normalize shell pcomplete
format-spec advice json map comint ring ansi-color finder-inf info
package epg-config seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 240886 13755)
 (symbols 48 24982 0)
 (miscs 40 282 190)
 (strings 32 32555 6908)
 (string-bytes 1 1068597)
 (vectors 16 40552)
 (vector-slots 8 744800 4343)
 (floats 8 262 215)
 (intervals 56 506 0)
 (buffers 976 20))

[-- Attachment #2: Type: text/html, Size: 7605 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension
  2019-07-07  4:55 bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension Valentin Gatien-Baron
@ 2020-11-26 11:56 ` Lars Ingebrigtsen
  2020-11-28 18:17   ` Dmitry Gutov
  2020-12-10  0:39 ` Dmitry Gutov
       [not found] ` <handler.36534.D36534.160756079129946.notifdone@debbugs.gnu.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-26 11:56 UTC (permalink / raw)
  To: Valentin Gatien-Baron; +Cc: 36534, Dmitry Gutov

Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> writes:

> Sometimes, vc-annotate in a file tracked by mercurial returns an
> error like this instead of a proper annotate buffer:

[...]

> Step 3 is probably an hg bug. However `hg parent` was deprecated in
> 2014, so people may be reluctant to change it. And it would be simpler
> for vc-hg-working-revision to call `hg log -r . -T {rev}` (vc-git does
> that, so I assume that it works in general on top of fixing the
> current issue). `.` means the current revision, see `hg help revset`.
>
> So something like this:
> (defun vc-hg-working-revision (file)
>   "Hg-specific version of `vc-working-revision'."
>   (ignore-errors
>     (with-output-to-string
>       (vc-hg-command standard-output 0 nil
>     "log" "-r" "." "--template" "{rev}"))))

(This bug report unfortunately got no response at the time.)

I'm pretty unfamiliar with Mercurial, but perhaps Dmitry has some
comments here (added to the Cc's).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension
  2020-11-26 11:56 ` Lars Ingebrigtsen
@ 2020-11-28 18:17   ` Dmitry Gutov
  2020-12-02 11:17     ` Andrii Kolomoiets
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Gutov @ 2020-11-28 18:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Valentin Gatien-Baron; +Cc: 36534, Andrii Kolomoiets

On 26.11.2020 13:56, Lars Ingebrigtsen wrote:
> Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> writes:
> 
>> Sometimes, vc-annotate in a file tracked by mercurial returns an
>> error like this instead of a proper annotate buffer:
> 
> [...]
> 
>> Step 3 is probably an hg bug. However `hg parent` was deprecated in
>> 2014, so people may be reluctant to change it. And it would be simpler
>> for vc-hg-working-revision to call `hg log -r . -T {rev}` (vc-git does
>> that, so I assume that it works in general on top of fixing the
>> current issue). `.` means the current revision, see `hg help revset`.
>>
>> So something like this:
>> (defun vc-hg-working-revision (file)
>>    "Hg-specific version of `vc-working-revision'."
>>    (ignore-errors
>>      (with-output-to-string
>>        (vc-hg-command standard-output 0 nil
>>      "log" "-r" "." "--template" "{rev}"))))
> 
> (This bug report unfortunately got no response at the time.)
> 
> I'm pretty unfamiliar with Mercurial, but perhaps Dmitry has some
> comments here (added to the Cc's).

I have very little experience with Mercurial myself.

Perhaps Daniel or Andrii can comment.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension
  2020-11-28 18:17   ` Dmitry Gutov
@ 2020-12-02 11:17     ` Andrii Kolomoiets
  2020-12-10  0:26       ` Dmitry Gutov
  0 siblings, 1 reply; 8+ messages in thread
From: Andrii Kolomoiets @ 2020-12-02 11:17 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Valentin Gatien-Baron, 36534, Lars Ingebrigtsen

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 26.11.2020 13:56, Lars Ingebrigtsen wrote:
>> Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> writes:
>> 
>>> Sometimes, vc-annotate in a file tracked by mercurial returns an
>>> error like this instead of a proper annotate buffer:
>> [...]
>> 
>>> Step 3 is probably an hg bug. However `hg parent` was deprecated in
>>> 2014, so people may be reluctant to change it. And it would be simpler
>>> for vc-hg-working-revision to call `hg log -r . -T {rev}` (vc-git does
>>> that, so I assume that it works in general on top of fixing the
>>> current issue). `.` means the current revision, see `hg help revset`.
>>>
>>> So something like this:
>>> (defun vc-hg-working-revision (file)
>>>    "Hg-specific version of `vc-working-revision'."
>>>    (ignore-errors
>>>      (with-output-to-string
>>>        (vc-hg-command standard-output 0 nil
>>>      "log" "-r" "." "--template" "{rev}"))))
>> (This bug report unfortunately got no response at the time.)
>> I'm pretty unfamiliar with Mercurial, but perhaps Dmitry has some
>> comments here (added to the Cc's).
>
> I have very little experience with Mercurial myself.
>
> Perhaps Daniel or Andrii can comment.

Valentin did a pretty good investigation here.

But proposed change make the `vc-hg-working-revision` function ignore
the FILE arg, so the result will differ.

1. mkdir working-revision
2. cd working-revision
3. hg init
4. echo a > a
5. hg commit -Am0
6. echo b > b
7. hg commit -Am1
8. hg parent --template {rev} a
   => 0
   This is the old behavior of the `vc-hg-working-revision`
9. hg log -r . --template {rev}
   => 1
   And this is the new one.

Not sure what it may leads to.  Indeed the `vc-git-working-revision`
function ignores FILE as well.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension
  2020-12-02 11:17     ` Andrii Kolomoiets
@ 2020-12-10  0:26       ` Dmitry Gutov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Gutov @ 2020-12-10  0:26 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 36534, Lars Ingebrigtsen, Valentin Gatien-Baron

Thanks Andrii,

On 02.12.2020 13:17, Andrii Kolomoiets wrote:
> Not sure what it may leads to.  Indeed the `vc-git-working-revision`
> function ignores FILE as well.

Sounds like it will indeed bring its behavior closer to vc-git's, which 
is generally better tested. Seems like a good thing.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension
  2019-07-07  4:55 bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension Valentin Gatien-Baron
  2020-11-26 11:56 ` Lars Ingebrigtsen
@ 2020-12-10  0:39 ` Dmitry Gutov
       [not found] ` <handler.36534.D36534.160756079129946.notifdone@debbugs.gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Dmitry Gutov @ 2020-12-10  0:39 UTC (permalink / raw)
  To: Valentin Gatien-Baron, 36534-done
  Cc: Lars Magne Ingebrigtsen, Andrii Kolomoiets

Version: 28.1

Hi Valentin,

Sorry we're only doing this now.

On 07.07.2019 07:55, Valentin Gatien-Baron wrote:

> Step 3 is probably an hg bug. However `hg parent` was deprecated in
> 2014, so people may be reluctant to change it. And it would be simpler
> for vc-hg-working-revision to call `hg log -r . -T {rev}` (vc-git does
> that, so I assume that it works in general on top of fixing the
> current issue). `.` means the current revision, see `hg help revset`.
> 
> So something like this:
> (defun vc-hg-working-revision (file)
>    "Hg-specific version of `vc-working-revision'."
>    (ignore-errors
>      (with-output-to-string
>        (vc-hg-command standard-output 0 nil
>      "log" "-r" "." "--template" "{rev}"))))
> 
> (another reason to stop using `hg parents` is that during a merge, it
> will in most cases print two revisions, so if you annotate a file that
> was last changed in revision 123, emacs will likely get 123123 back
> and `hg annotate -r 123123` will fail)

Thanks for the thorough explanation. I have installed the patch in 
revision 4f352ad6f1 on master. Kinda messed up the attribution, but 
alas, not something I can fix now.

Aside from improved compatibility, the new implementation seems 
considerably faster, too. Like 100ms vs 600ms on mozilla-central, which 
is a huge repo.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: closed (Re: bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension)
       [not found] ` <handler.36534.D36534.160756079129946.notifdone@debbugs.gnu.org>
@ 2020-12-12 18:54   ` Glenn Morris
  2020-12-13  1:57     ` Dmitry Gutov
  0 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2020-12-12 18:54 UTC (permalink / raw)
  To: 36534; +Cc: Valentin Gatien-Baron, dgutov


Hi, this change causes a test failure.

Ref eg https://hydra.nixos.org/build/132497145





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#36534: closed (Re: bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension)
  2020-12-12 18:54   ` bug#36534: closed (Re: bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension) Glenn Morris
@ 2020-12-13  1:57     ` Dmitry Gutov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Gutov @ 2020-12-13  1:57 UTC (permalink / raw)
  To: Glenn Morris, 36534; +Cc: Valentin Gatien-Baron

Hi Glenn,

Thanks.

On 12.12.2020 20:54, Glenn Morris wrote:
> 
> Hi, this change causes a test failure.
> 
> Ref eg https://hydra.nixos.org/build/132497145

Apparently Hg shows revision "-1" for a file in a repository with no 
commits at all (which is confirmed by 
https://stackoverflow.com/a/28831490/615245).

I can't reproduce it locally, though. My Hg is 5.3.1, Hydra's is 4.7. 
Apparently that behavior changed at some point, but I can't find the 
exact version and change log entry.

The exact values are not very important for that test, so I'll just add 
another possible one.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-13  1:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-07  4:55 bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension Valentin Gatien-Baron
2020-11-26 11:56 ` Lars Ingebrigtsen
2020-11-28 18:17   ` Dmitry Gutov
2020-12-02 11:17     ` Andrii Kolomoiets
2020-12-10  0:26       ` Dmitry Gutov
2020-12-10  0:39 ` Dmitry Gutov
     [not found] ` <handler.36534.D36534.160756079129946.notifdone@debbugs.gnu.org>
2020-12-12 18:54   ` bug#36534: closed (Re: bug#36534: 25.2; mercurial vc-annotate sometimes fails when using the evolve mercurial extension) Glenn Morris
2020-12-13  1:57     ` Dmitry Gutov

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.