Mercurial > hg
comparison mercurial/bookmarks.py @ 32738:999aa9cfb4d3
bookmarks: move variable initialization earlier
Since we no longer set '_clean = False' during the initialization loop, we can
move the attribute assignment earlier in the function for clarity.
(no speed improvement expected or measured ;-) )
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 07 Jun 2017 19:32:16 +0100 |
parents | d6924192c0d5 |
children | 47ca96f9cfca |
comparison
equal
deleted
inserted
replaced
32737:d6924192c0d5 | 32738:999aa9cfb4d3 |
---|---|
48 """ | 48 """ |
49 | 49 |
50 def __init__(self, repo): | 50 def __init__(self, repo): |
51 dict.__init__(self) | 51 dict.__init__(self) |
52 self._repo = repo | 52 self._repo = repo |
53 self._clean = True | |
54 self._aclean = True | |
53 nm = repo.changelog.nodemap | 55 nm = repo.changelog.nodemap |
54 tonode = bin # force local lookup | 56 tonode = bin # force local lookup |
55 setitem = dict.__setitem__ | 57 setitem = dict.__setitem__ |
56 try: | 58 try: |
57 bkfile = _getbkfile(repo) | 59 bkfile = _getbkfile(repo) |
72 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n') | 74 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n') |
73 % line) | 75 % line) |
74 except IOError as inst: | 76 except IOError as inst: |
75 if inst.errno != errno.ENOENT: | 77 if inst.errno != errno.ENOENT: |
76 raise | 78 raise |
77 self._clean = True | |
78 self._active = _readactive(repo, self) | 79 self._active = _readactive(repo, self) |
79 self._aclean = True | |
80 | 80 |
81 @property | 81 @property |
82 def active(self): | 82 def active(self): |
83 return self._active | 83 return self._active |
84 | 84 |