comparison mercurial/changelog.py @ 36266:ddeb7653b31c

py3: use pycompat.bytestr to convert str to bytes Differential Revision: https://phab.mercurial-scm.org/D2261
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 14 Feb 2018 16:37:46 +0530
parents 9ba1d0c724e2
children c6061cadb400
comparison
equal deleted inserted replaced
36265:69080ee1fb0e 36266:ddeb7653b31c
18 ) 18 )
19 19
20 from . import ( 20 from . import (
21 encoding, 21 encoding,
22 error, 22 error,
23 pycompat,
23 revlog, 24 revlog,
24 util, 25 util,
25 ) 26 )
26 27
27 _defaultextra = {'branch': 'default'} 28 _defaultextra = {'branch': 'default'}
515 # revision text contain two "\n\n" sequences -> corrupt 516 # revision text contain two "\n\n" sequences -> corrupt
516 # repository since read cannot unpack the revision. 517 # repository since read cannot unpack the revision.
517 if not user: 518 if not user:
518 raise error.RevlogError(_("empty username")) 519 raise error.RevlogError(_("empty username"))
519 if "\n" in user: 520 if "\n" in user:
520 raise error.RevlogError(_("username %s contains a newline") 521 raise error.RevlogError(_("username %r contains a newline")
521 % repr(user)) 522 % pycompat.bytestr(user))
522 523
523 desc = stripdesc(desc) 524 desc = stripdesc(desc)
524 525
525 if date: 526 if date:
526 parseddate = "%d %d" % util.parsedate(date) 527 parseddate = "%d %d" % util.parsedate(date)