Patchwork [3,of,7] py3: use '%d' instead of '%s' for integers

login
register
mail settings
Submitter Pulkit Goyal
Date June 17, 2017, 12:45 p.m.
Message ID <8672832a62a28fec052f.1497703521@workspace>
Download mbox | patch
Permalink /patch/21456/
State Accepted
Headers show

Comments

Pulkit Goyal - June 17, 2017, 12:45 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1497691405 -19800
#      Sat Jun 17 14:53:25 2017 +0530
# Node ID 8672832a62a28fec052f23120e6b801da5cb7081
# Parent  24ed9e4abb5584a94614e1e7506c69b2ebced69b
py3: use '%d' instead of '%s' for integers

Python 3 does not let you use '%s' for integers.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1174,11 +1174,11 @@ 
             oldtip = oldlen - 1
 
             if detail and ui.verbose:
-                msg = (_('repository tip rolled back to revision %s'
+                msg = (_('repository tip rolled back to revision %d'
                          ' (undo %s: %s)\n')
                        % (oldtip, desc, detail))
             else:
-                msg = (_('repository tip rolled back to revision %s'
+                msg = (_('repository tip rolled back to revision %d'
                          ' (undo %s)\n')
                        % (oldtip, desc))
         except IOError: