# HG changeset patch # User Yuya Nishihara # Date 1504419950 -32400 # Node ID 8927534cacbc0660b234ebdff24a95035043f0d8 # Parent da9c4b0693c53e0c916865f6dcee7302b9fa0b5e py3: drop use of str() in dagparser.py diff -r da9c4b0693c5 -r 8927534cacbc mercurial/dagparser.py --- a/mercurial/dagparser.py Sun Sep 03 15:22:54 2017 +0900 +++ b/mercurial/dagparser.py Sun Sep 03 15:25:50 2017 +0900 @@ -11,7 +11,10 @@ import string from .i18n import _ -from . import error +from . import ( + error, + util, +) def parsedag(desc): '''parses a DAG from a concise textual description; generates events @@ -314,7 +317,7 @@ if len(ps) == 1 and ps[0] == -1: if needroot: if run: - yield '+' + str(run) + yield '+%d' % run run = 0 if wrapnonlinear: yield '\n' @@ -329,7 +332,7 @@ run += 1 else: if run: - yield '+' + str(run) + yield '+%d' % run run = 0 if wrapnonlinear: yield '\n' @@ -340,11 +343,11 @@ elif p in labels: prefs.append(labels[p]) else: - prefs.append(str(r - p)) + prefs.append('%d' % (r - p)) yield '*' + '/'.join(prefs) else: if run: - yield '+' + str(run) + yield '+%d' % run run = 0 if kind == 'l': rid, name = data @@ -367,10 +370,12 @@ yield '#' + data yield '\n' else: - raise error.Abort(_("invalid event type in dag: %s") - % str((kind, data))) + raise error.Abort(_("invalid event type in dag: " + "('%s', '%s')") + % (util.escapestr(kind), + util.escapestr(data))) if run: - yield '+' + str(run) + yield '+%d' % run line = '' for part in gen():