changeset 41420:b6673e9bdcf6

dispatch: quote filename in IOError as well It's explicitly added for OSError at 720308f741cb "dispatch: show empty filename in OSError aborts". Let's do the same for IOError.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 Jan 2019 17:51:55 +0900
parents b5169e79c31c
children f83b230b7fb3
files mercurial/scmutil.py tests/test-acl.t tests/test-annotate.t tests/test-fastannotate-hg.t tests/test-histedit-arguments.t tests/test-hook.t tests/test-journal-exists.t tests/test-narrow-widen-no-ellipsis.t tests/test-permissions.t tests/test-repair-strip.t tests/test-ssh-repoerror.t tests/test-template-map.t
diffstat 12 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sat Jan 26 17:44:07 2019 +0900
+++ b/mercurial/scmutil.py	Sat Jan 26 17:51:55 2019 +0900
@@ -248,8 +248,8 @@
               and inst.args and inst.args[0] == errno.EPIPE):
             pass
         elif getattr(inst, "strerror", None): # common IOError
-            if getattr(inst, "filename", None):
-                ui.error(_("abort: %s: %s\n") % (
+            if getattr(inst, "filename", None) is not None:
+                ui.error(_("abort: %s: '%s'\n") % (
                     encoding.strtolocal(inst.strerror),
                     stringutil.forcebytestr(inst.filename)))
             else:
--- a/tests/test-acl.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-acl.t	Sat Jan 26 17:51:55 2019 +0900
@@ -1125,7 +1125,7 @@
   bundle2-input-bundle: 4 parts total
   transaction abort!
   rollback completed
-  abort: $ENOENT$: ../acl.config
+  abort: $ENOENT$: '../acl.config'
   no rollback information available
   0:6675d58eff77
   
--- a/tests/test-annotate.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-annotate.t	Sat Jan 26 17:51:55 2019 +0900
@@ -589,7 +589,7 @@
 
   $ hg annotate -ncr "wdir()" baz
   abort: $TESTTMP\repo\baz: $ENOENT$ (windows !)
-  abort: $ENOENT$: $TESTTMP/repo/baz (no-windows !)
+  abort: $ENOENT$: '$TESTTMP/repo/baz' (no-windows !)
   [255]
 
 annotate removed file
@@ -598,7 +598,7 @@
 
   $ hg annotate -ncr "wdir()" baz
   abort: $TESTTMP\repo\baz: $ENOENT$ (windows !)
-  abort: $ENOENT$: $TESTTMP/repo/baz (no-windows !)
+  abort: $ENOENT$: '$TESTTMP/repo/baz' (no-windows !)
   [255]
 
   $ hg revert --all --no-backup --quiet
--- a/tests/test-fastannotate-hg.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-fastannotate-hg.t	Sat Jan 26 17:51:55 2019 +0900
@@ -593,7 +593,7 @@
   $ rm baz
   $ hg annotate -ncr "wdir()" baz
   abort: $TESTTMP/repo/baz: $ENOENT$ (windows !)
-  abort: $ENOENT$: $TESTTMP/repo/baz (no-windows !)
+  abort: $ENOENT$: '$TESTTMP/repo/baz' (no-windows !)
   [255]
 
 annotate removed file
@@ -601,7 +601,7 @@
   $ hg rm baz
   $ hg annotate -ncr "wdir()" baz
   abort: $TESTTMP/repo/baz: $ENOENT$ (windows !)
-  abort: $ENOENT$: $TESTTMP/repo/baz (no-windows !)
+  abort: $ENOENT$: '$TESTTMP/repo/baz' (no-windows !)
   [255]
 
 Test annotate with whitespace options
--- a/tests/test-histedit-arguments.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-histedit-arguments.t	Sat Jan 26 17:51:55 2019 +0900
@@ -362,7 +362,7 @@
   $ hg histedit --abort
   warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
   abort: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg: $ENOENT$ (glob) (windows !)
-  abort: $ENOENT$: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg (glob) (no-windows !)
+  abort: $ENOENT$: '$TESTTMP/foo/.hg/strip-backup/*-histedit.hg' (glob) (no-windows !)
   [255]
 Histedit state has been exited
   $ hg summary -q
--- a/tests/test-hook.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-hook.t	Sat Jan 26 17:51:55 2019 +0900
@@ -690,7 +690,7 @@
 
   $ hg up null
   loading update.ne hook failed:
-  abort: $ENOENT$: $TESTTMP/d/repo/nonexistent.py
+  abort: $ENOENT$: '$TESTTMP/d/repo/nonexistent.py'
   [255]
 
   $ hg id
--- a/tests/test-journal-exists.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-journal-exists.t	Sat Jan 26 17:51:55 2019 +0900
@@ -29,7 +29,7 @@
 
   $ hg -R foo unbundle repo.hg
   adding changesets
-  abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob)
+  abort: Permission denied: '$TESTTMP/foo/.hg/store/.00changelog.i-*' (glob)
   [255]
 
   $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
--- a/tests/test-narrow-widen-no-ellipsis.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-narrow-widen-no-ellipsis.t	Sat Jan 26 17:51:55 2019 +0900
@@ -406,7 +406,7 @@
    * bookmark                  11:* (glob)
   $ hg unbundle .hg/strip-backup/*-widen.hg
   abort: .hg/strip-backup/*-widen.hg: $ENOTDIR$ (windows !)
-  abort: $ENOENT$: .hg/strip-backup/*-widen.hg (no-windows !)
+  abort: $ENOENT$: '.hg/strip-backup/*-widen.hg' (no-windows !)
   [255]
   $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
   11: local
--- a/tests/test-permissions.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-permissions.t	Sat Jan 26 17:51:55 2019 +0900
@@ -22,7 +22,7 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-  abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i
+  abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
   [255]
 
   $ chmod +r .hg/store/data/a.i
@@ -39,7 +39,7 @@
   $ echo barber > a
   $ hg commit -m "2"
   trouble committing a!
-  abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i
+  abort: Permission denied: '$TESTTMP/t/.hg/store/data/a.i'
   [255]
 
   $ chmod -w .
--- a/tests/test-repair-strip.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-repair-strip.t	Sat Jan 26 17:51:55 2019 +0900
@@ -53,7 +53,7 @@
   rollback failed - please run hg recover
   (failure reason: [Errno 13] Permission denied .hg/store/data/b.i')
   strip failed, backup bundle
-  abort: Permission denied .hg/store/data/b.i
+  abort: Permission denied .hg/store/data/b.i'
   % after update 0, strip 2
   abandoned transaction found - run hg recover
   checking changesets
@@ -85,7 +85,7 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     a
   
-  abort: Permission denied .hg/store/data/b.i
+  abort: Permission denied .hg/store/data/b.i'
   % after update 0, strip 2
   checking changesets
   checking manifests
@@ -107,7 +107,7 @@
   rollback failed - please run hg recover
   (failure reason: [Errno 13] Permission denied .hg/store/00manifest.i')
   strip failed, backup bundle
-  abort: Permission denied .hg/store/00manifest.i
+  abort: Permission denied .hg/store/00manifest.i'
   % after update 0, strip 2
   abandoned transaction found - run hg recover
   checking changesets
--- a/tests/test-ssh-repoerror.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-ssh-repoerror.t	Sat Jan 26 17:51:55 2019 +0900
@@ -34,7 +34,7 @@
   > done
 
   $ hg id ssh://user@dummy/other
-  remote: abort: Permission denied: $TESTTMP/other/.hg/requires
+  remote: abort: Permission denied: '$TESTTMP/other/.hg/requires'
   abort: no suitable response from remote hg!
   [255]
 
--- a/tests/test-template-map.t	Sat Jan 26 17:44:07 2019 +0900
+++ b/tests/test-template-map.t	Sat Jan 26 17:51:55 2019 +0900
@@ -1039,7 +1039,7 @@
   $ touch q
   $ chmod 0 q
   $ hg log --style ./q
-  abort: Permission denied: ./q
+  abort: Permission denied: './q'
   [255]
 #endif