Function to create a new defect ID.
We're abandoning the mapping of defect names to IDs (Oct 2012).
Hence here we just ask for the first open gap in ID numbers.
It works for virtual IDs as well, though via a bit of an edge case for
when none exist yet.
Definition at line 47 of file ids.py.
48 defect_name: str, virtual: bool =
False) -> int:
50 Function to create a new defect ID.
52 We're abandoning the mapping of defect names to IDs (Oct 2012).
53 Hence here we just ask for the first open gap in ID numbers.
54 It works for virtual IDs as well, though via a bit of an edge case for
57 existing =
sorted(_
for _
in existing_map.values()
if not isinstance(_, str))
58 if len(existing) == 0:
62 for i, v
in enumerate(existing[1:]):
67 newid = existing[-1] + 1
69 did.is_virtual=virtual
70 log.debug(
"Chose new id: %r", did)