Mq - ui.warn or write or note

Mads Kiilerich mads at kiilerich.com
Fri Jul 24 10:37:45 CDT 2009


I was tricked by mq behaviour and wanted to improve things.

I wanted to propose

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1590,6 +1590,7 @@
                  patch.export(repo, [n], fp=patchf, opts=self.diffopts())
                  patchf.close()

+                self.ui.write(_("adding %s to series file\n") % patchname)
                  se = statusentry(hex(n), patchname)
                  self.applied.insert(0, se)

But then it would be obvious to also make this change

@@ -1629,7 +1630,7 @@
                  index = self.full_series_end() + i
                  self.full_series[index:index] = [patchname]
              self.parse_series()
-            self.ui.warn(_("adding %s to series file\n") % patchname)
+            self.ui.write(_("adding %s to series file\n") % patchname)
              i += 1
              added.append(patchname)
              patchname = None

And next comes the many other places where ui.warn is used for something 
which IMHO should be write or note.

So it seems to me like mq doesn't need small fixes like this but is more 
in need of a review by someone familiar with it. Anyone?

/Mads



More information about the Mercurial-devel mailing list