Mercurial > hg
comparison mercurial/util.py @ 43724:5be128f669d4 stable
util: convert an exception to bytes when passing to Abort()
I happened to notice this searching for how to convert an exception to bytes in
the previous patch. I'm pretty sure I've got a bunch of other instances that
use `pycompat.bytestr()` suppressed locally.
Differential Revision: https://phab.mercurial-scm.org/D7467
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 21 Nov 2019 17:25:24 -0500 |
parents | 8ff1ecfadcd1 |
children | 7eb701e355bd |
comparison
equal
deleted
inserted
replaced
43723:eab0b7383cd3 | 43724:5be128f669d4 |
---|---|
1917 advanced = ( | 1917 advanced = ( |
1918 oldstat.stat[stat.ST_MTIME] + 1 | 1918 oldstat.stat[stat.ST_MTIME] + 1 |
1919 ) & 0x7FFFFFFF | 1919 ) & 0x7FFFFFFF |
1920 os.utime(dest, (advanced, advanced)) | 1920 os.utime(dest, (advanced, advanced)) |
1921 except shutil.Error as inst: | 1921 except shutil.Error as inst: |
1922 raise error.Abort(str(inst)) | 1922 raise error.Abort(stringutil.forcebytestr(inst)) |
1923 | 1923 |
1924 | 1924 |
1925 def copyfiles(src, dst, hardlink=None, progress=None): | 1925 def copyfiles(src, dst, hardlink=None, progress=None): |
1926 """Copy a directory tree using hardlinks if possible.""" | 1926 """Copy a directory tree using hardlinks if possible.""" |
1927 num = 0 | 1927 num = 0 |