diff mercurial/bookmarks.py @ 14946:28762bf809d8

bookmarks: use getattr instead of hasattr
author Augie Fackler <durin42@gmail.com>
date Mon, 25 Jul 2011 15:07:09 -0500
parents 09c9c120a817
children 774da7121fc9
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Mon Jul 25 20:37:12 2011 -0500
+++ b/mercurial/bookmarks.py	Mon Jul 25 15:07:09 2011 -0500
@@ -151,11 +151,10 @@
 def listbookmarks(repo):
     # We may try to list bookmarks on a repo type that does not
     # support it (e.g., statichttprepository).
-    if not hasattr(repo, '_bookmarks'):
-        return {}
+    marks = getattr(repo, '_bookmarks', {})
 
     d = {}
-    for k, v in repo._bookmarks.iteritems():
+    for k, v in marks.iteritems():
         d[k] = hex(v)
     return d