Patchwork [V2] crecord: fix statup crash of curses UI

login
register
mail settings
Submitter Laurent Charignon
Date March 18, 2015, 8:04 p.m.
Message ID <3d59a52a29862ca349fa.1426709052@dev919.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8148/
State Not Applicable
Headers show

Comments

Laurent Charignon - March 18, 2015, 8:04 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1426700642 25200
#      Wed Mar 18 10:44:02 2015 -0700
# Node ID 3d59a52a29862ca349fa466f4a09286106041f95
# Parent  365b6d3e8e5046ab0e538686dd8cf25f73efa039
crecord: fix statup crash of curses UI

Introduced by 7d5f935bd705, not caught by the tests as they don't cover the UI
code
Matt Mackall - March 18, 2015, 8:35 p.m.
On Wed, 2015-03-18 at 13:04 -0700, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1426700642 25200
> #      Wed Mar 18 10:44:02 2015 -0700
> # Node ID 3d59a52a29862ca349fa466f4a09286106041f95
> # Parent  365b6d3e8e5046ab0e538686dd8cf25f73efa039
> crecord: fix statup crash of curses UI

I actually fixed this locally after my last message, thanks.

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -872,7 +872,7 @@ 
         width = self.xscreensize
         # turn tabs into spaces
         instr = instr.expandtabs(4)
-        strwidth = encoding.ucolwidth(instr)
+        strwidth = encoding.colwidth(instr)
         numspaces = (width - ((strwidth + xstart) % width) - 1)
         return instr + " " * numspaces + "\n"