changeset 1058:402279974aea

Use ui.write instead of print in debugwalk.
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 25 Aug 2005 10:11:54 -0700
parents 2fd15d743b3b
children 4eab07ef66e2
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Aug 25 02:00:03 2005 -0700
+++ b/mercurial/commands.py	Thu Aug 25 10:11:54 2005 -0700
@@ -716,12 +716,12 @@
 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 @@
         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