##// END OF EJS Templates
obsolete: cheap detection of nullid as successors...
Pierre-Yves David -
r17774:0496d4f7 default
parent child Browse files
Show More
@@ -52,7 +52,7 b' The header is followed by the markers. E'
52 cannot contain '\0'.
52 cannot contain '\0'.
53 """
53 """
54 import struct
54 import struct
55 import util, base85
55 import util, base85, node
56 from i18n import _
56 from i18n import _
57
57
58 _pack = struct.pack
58 _pack = struct.pack
@@ -237,6 +237,9 b' class obsstore(object):'
237 self.precursors.setdefault(pre, set()).add(mark)
237 self.precursors.setdefault(pre, set()).add(mark)
238 for suc in sucs:
238 for suc in sucs:
239 self.successors.setdefault(suc, set()).add(mark)
239 self.successors.setdefault(suc, set()).add(mark)
240 if node.nullid in self.successors:
241 raise util.Abort(_('bad obsolescence marker detected: '
242 'invalid successors nullid'))
240
243
241 def _encodemarkers(markers, addheader=False):
244 def _encodemarkers(markers, addheader=False):
242 # Kept separate from flushmarkers(), it will be reused for
245 # Kept separate from flushmarkers(), it will be reused for
@@ -100,6 +100,13 b' Register two markers with a missing node'
100 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
100 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
101 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
101 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
102
102
103 Refuse pathological nullid successors
104 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
105 transaction abort!
106 rollback completed
107 abort: bad obsolescence marker detected: invalid successors nullid
108 [255]
109
103 Check that graphlog detect that a changeset is obsolete:
110 Check that graphlog detect that a changeset is obsolete:
104
111
105 $ hg glog
112 $ hg glog
General Comments 0
You need to be logged in to leave comments. Login now