unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38216: [PATCH] vc-hg: don't pass empty string to 'update' command
@ 2019-11-15  7:51 Andrii Kolomoiets
  2019-11-15  8:14 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Andrii Kolomoiets @ 2019-11-15  7:51 UTC (permalink / raw)
  To: 38216

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

Hello,

Passing empty string to 'update' command leads to error starting from
mercurial 4.6.

mercurial 4.5.3:
  hg up ""
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved

mercurial 4.6:
  hg up ""
  abort: 00changelog.i@: ambiguous identifier!

Empty revision name is used in vc-retrieve-tag to update to the latest
revision but let's pass nil instead of empty string to 'hg update'.


[-- Attachment #2: 0001-lisp-vc-vc-hg.el-Don-t-pass-empty-string-to-hg-updat.patch --]
[-- Type: application/octet-stream, Size: 874 bytes --]

From 96bf1510c280422f4e3602f2a95980b6e2308eaa Mon Sep 17 00:00:00 2001
From: Andrii Kolomoiets <andreyk.mad@gmail.com>
Date: Fri, 15 Nov 2019 09:34:51 +0200
Subject: [PATCH] lisp/vc/vc-hg.el: Don't pass empty string to hg update

* lisp/vc/vc-hg.el (vc-hg-retrieve-tag): Don't pass empty name to `hg update`.

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 16e5dd6db0..48a7838684 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -578,7 +578,7 @@ vc-hg-create-tag
 (defun vc-hg-retrieve-tag (dir name _update)
   "Retrieve the version tagged by NAME of all registered files at or below DIR."
   (let ((default-directory dir))
-    (vc-hg-command nil 0 nil "update" name)
+    (vc-hg-command nil 0 nil "update" (unless (string-empty-p name) name))
     ;; TODO: update *vc-change-log* buffer so can see @ if --graph
     ))
 
-- 
2.15.1


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

* bug#38216: [PATCH] vc-hg: don't pass empty string to 'update' command
  2019-11-15  7:51 bug#38216: [PATCH] vc-hg: don't pass empty string to 'update' command Andrii Kolomoiets
@ 2019-11-15  8:14 ` Lars Ingebrigtsen
  2019-11-15  8:59   ` martin rudalics
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-15  8:14 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 38216

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> Passing empty string to 'update' command leads to error starting from
> mercurial 4.6.
>
> mercurial 4.5.3:
>   hg up ""
>   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
>
> mercurial 4.6:
>   hg up ""
>   abort: 00changelog.i@: ambiguous identifier!

Thanks; applied the patch to Emacs 27.

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





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

* bug#38216: [PATCH] vc-hg: don't pass empty string to 'update' command
  2019-11-15  8:14 ` Lars Ingebrigtsen
@ 2019-11-15  8:59   ` martin rudalics
  2019-11-15  9:05     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: martin rudalics @ 2019-11-15  8:59 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Andrii Kolomoiets; +Cc: 38216

> Thanks; applied the patch to Emacs 27.

Gets me

../../lisp/vc/vc-hg.el:1467:1:Warning: the function `string-empty-p' is not
     known to be defined.

here.

martin






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

* bug#38216: [PATCH] vc-hg: don't pass empty string to 'update' command
  2019-11-15  8:59   ` martin rudalics
@ 2019-11-15  9:05     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-15  9:05 UTC (permalink / raw)
  To: martin rudalics; +Cc: Andrii Kolomoiets, 38216

martin rudalics <rudalics@gmx.at> writes:

>> Thanks; applied the patch to Emacs 27.
>
> Gets me
>
> ../../lisp/vc/vc-hg.el:1467:1:Warning: the function `string-empty-p' is not
>     known to be defined.
>
> here.

Huh; my patch applying function is supposed to do a byte compilation to
catch bugs like that...  but I must have forgotten to actually look at
it.

I've now changed it to avoid this subr-x function.

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





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

end of thread, other threads:[~2019-11-15  9:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-15  7:51 bug#38216: [PATCH] vc-hg: don't pass empty string to 'update' command Andrii Kolomoiets
2019-11-15  8:14 ` Lars Ingebrigtsen
2019-11-15  8:59   ` martin rudalics
2019-11-15  9:05     ` Lars Ingebrigtsen

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