b.generate_ids : module documentation

Part of bzrlib

Common code for generating file or revision ids.
Function gen_file_id Return new file id for the basename 'name'.
Function gen_root_id Return a new tree-root file id.
Function gen_revision_id Return new revision-id.
Function _next_id_suffix Create a new file id suffix that is reasonably unique.
def _next_id_suffix():
Create a new file id suffix that is reasonably unique.

On the first call we combine the current time with 64 bits of randomness to give a highly probably globally unique number. Then each call in the same process adds 1 to a serial number we append to that unique value.

def gen_file_id(name):
Return new file id for the basename 'name'.

The uniqueness is supplied from _next_id_suffix.

def gen_root_id():
Return a new tree-root file id.
def gen_revision_id(username, timestamp=None):
Return new revision-id.
ParametersusernameThe username of the committer, in the format returned by config.username(). This is typically a real name, followed by an email address. If found, we will use just the email address portion. Otherwise we flatten the real name, and use that.
ReturnsA new revision id.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.