changeset 44690:44aff45b556d

fastexport: make a diagnostics message more localizable Differential Revision: https://phab.mercurial-scm.org/D8398
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 10 Apr 2020 22:33:14 +0200
parents 6bef9d43cc55
children 48b99af7b4b3
files hgext/fastexport.py tests/test-fastexport.t
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fastexport.py	Fri Apr 10 21:38:08 2020 +0900
+++ b/hgext/fastexport.py	Fri Apr 10 22:33:14 2020 +0200
@@ -42,7 +42,8 @@
         user_person
     ):
         raise error.Abort(
-            _(b"Unable to parse user into person and email for revision " + rev)
+            _(b"Unable to parse user into person and email for revision %s")
+            % rev
         )
     if user_person:
         return b'"' + user_person + b'" <' + user_email + b'>'
--- a/tests/test-fastexport.t	Fri Apr 10 21:38:08 2020 +0900
+++ b/tests/test-fastexport.t	Fri Apr 10 22:33:14 2020 +0200
@@ -853,3 +853,13 @@
   M 644 :5 nf1
   M 644 :6 of
   
+  $ echo foo > of
+  $ hg commit --user '<badname> <bad email>' --date 'Fri Jan 02 00:00:00 1970 +0000' -m 'Testcommit'
+  $ hg fastexport --import-marks fastexport.marks -r tip
+  blob
+  mark :50
+  data 4
+  foo
+  
+  abort: Unable to parse user into person and email for revision 4f71ca786403919cd16669d94ff7cd1c09437a44
+  [255]