##// END OF EJS Templates
bmstore: add basic clean-state tracking...
Augie Fackler -
r27187:d9dcc5c0 default
parent child Browse files
Show More
@@ -78,6 +78,15 b' class bmstore(dict):'
78 except IOError as inst:
78 except IOError as inst:
79 if inst.errno != errno.ENOENT:
79 if inst.errno != errno.ENOENT:
80 raise
80 raise
81 self._clean = True
82
83 def __setitem__(self, *args, **kwargs):
84 self._clean = False
85 return dict.__setitem__(self, *args, **kwargs)
86
87 def __delitem__(self, key):
88 self._clean = False
89 return dict.__delitem__(self, key)
81
90
82 def recordchange(self, tr):
91 def recordchange(self, tr):
83 """record that bookmarks have been changed in a transaction
92 """record that bookmarks have been changed in a transaction
@@ -96,6 +105,8 b' class bmstore(dict):'
96 We also store a backup of the previous state in undo.bookmarks that
105 We also store a backup of the previous state in undo.bookmarks that
97 can be copied back on rollback.
106 can be copied back on rollback.
98 '''
107 '''
108 if self._clean:
109 return
99 repo = self._repo
110 repo = self._repo
100 if (repo.ui.configbool('devel', 'all-warnings')
111 if (repo.ui.configbool('devel', 'all-warnings')
101 or repo.ui.configbool('devel', 'check-locks')):
112 or repo.ui.configbool('devel', 'check-locks')):
@@ -131,6 +142,7 b' class bmstore(dict):'
131 def _write(self, fp):
142 def _write(self, fp):
132 for name, node in self.iteritems():
143 for name, node in self.iteritems():
133 fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
144 fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
145 self._clean = True
134
146
135 def readactive(repo):
147 def readactive(repo):
136 """
148 """
General Comments 0
You need to be logged in to leave comments. Login now