mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
qimport: report filename in case of IOError
The old behaviour was to say "abort: unable to read" since the patchname variable was always None.
This commit is contained in:
parent
2892a4755b
commit
73f6ec8db1
@ -1494,7 +1494,7 @@ class queue:
|
||||
else:
|
||||
text = file(filename, 'rb').read()
|
||||
except IOError:
|
||||
raise util.Abort(_("unable to read %s") % patchname)
|
||||
raise util.Abort(_("unable to read %s") % filename)
|
||||
if not patchname:
|
||||
patchname = normname(os.path.basename(filename))
|
||||
self.check_reserved_name(patchname)
|
||||
|
@ -21,9 +21,13 @@ echo "mq=" >> $HGRCPATH
|
||||
echo "[diff]" >> $HGRCPATH
|
||||
echo "git=1" >> $HGRCPATH
|
||||
|
||||
echo % build diff with CRLF
|
||||
hg init repo
|
||||
cd repo
|
||||
|
||||
echo % qimport non-existing-file
|
||||
hg qimport non-existing-file
|
||||
|
||||
echo % build diff with CRLF
|
||||
python ../writelines.py b 5 'a\n' 5 'a\r\n'
|
||||
hg ci -Am addb
|
||||
python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
|
||||
|
@ -1,3 +1,5 @@
|
||||
% qimport non-existing-file
|
||||
abort: unable to read non-existing-file
|
||||
% build diff with CRLF
|
||||
adding b
|
||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
|
Loading…
Reference in New Issue
Block a user