# HG changeset patch # User Bryan O'Sullivan # Date 2005-08-25 17:11:54 # Node ID 402279974aeaec2b27eeba187f832eea961b9f02 # Parent 2fd15d743b3be74b63d756ddfa51407f025fe011 Use ui.write instead of print in debugwalk. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -716,12 +716,12 @@ def debugindexdot(ui, file_): def debugwalk(ui, repo, *pats, **opts): items = list(walk(repo, pats, opts)) if not items: return - fmt = '%%s %%-%ds %%-%ds %%s' % ( + fmt = '%%s %%-%ds %%-%ds %%s\n' % ( max([len(abs) for (src, abs, rel, exact) in items]), max([len(rel) for (src, abs, rel, exact) in items])) exactly = {True: 'exact', False: ''} for src, abs, rel, exact in items: - print fmt % (src, abs, rel, exactly[exact]) + ui.write(fmt % (src, abs, rel, exactly[exact])) def diff(ui, repo, *pats, **opts): """diff working directory (or selected files)""" @@ -806,6 +806,7 @@ def grep(ui, repo, pattern = None, *pats return fcache[fn] def matchlines(body): + # massively inefficient. rewrite. for match in regexp.finditer(body): start, end = match.span() lnum = body.count('\n', 0, start) + 1