##// END OF EJS Templates
bookmark: deprecate direct set of a bookmark value...
Boris Feld -
r33517:08bf0ebc default
parent child Browse files
Show More
@@ -102,8 +102,14 b' class bmstore(dict):'
102 self._aclean = False
102 self._aclean = False
103
103
104 def __setitem__(self, *args, **kwargs):
104 def __setitem__(self, *args, **kwargs):
105 msg = ("'bookmarks[name] = node' is deprecated, "
106 "use 'bookmarks.applychanges'")
107 self._repo.ui.deprecwarn(msg, '4.3')
108 self._set(*args, **kwargs)
109
110 def _set(self, key, value):
105 self._clean = False
111 self._clean = False
106 return dict.__setitem__(self, *args, **kwargs)
112 return dict.__setitem__(self, key, value)
107
113
108 def __delitem__(self, key):
114 def __delitem__(self, key):
109 self._clean = False
115 self._clean = False
@@ -118,7 +124,7 b' class bmstore(dict):'
118 if node is None:
124 if node is None:
119 del self[name]
125 del self[name]
120 else:
126 else:
121 self[name] = node
127 self._set(name, node)
122 if bmchanges is not None:
128 if bmchanges is not None:
123 # if a previous value exist preserve the "initial" value
129 # if a previous value exist preserve the "initial" value
124 previous = bmchanges.get(name)
130 previous = bmchanges.get(name)
General Comments 0
You need to be logged in to leave comments. Login now