changeset 14848:09c9c120a817

bookmarks: simplify warning code
author Matt Mackall <mpm@selenic.com>
date Wed, 06 Jul 2011 19:25:56 -0500
parents 400ba7cccbae
children cac04f2f475b
files mercurial/bookmarks.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Wed Jul 06 19:25:56 2011 -0500
+++ b/mercurial/bookmarks.py	Wed Jul 06 19:25:56 2011 -0500
@@ -27,10 +27,10 @@
     try:
         for line in repo.opener('bookmarks'):
             line = line.strip()
+            if not line:
+                continue
             if ' ' not in line:
-                if line:
-                    msg = _('malformed line in .hg/bookmarks: %r\n')
-                    repo.ui.warn( msg % line)
+                repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n') % line)
                 continue
             sha, refspec = line.split(' ', 1)
             refspec = encoding.tolocal(refspec)