Module b.generate_ids

Part of bzrlib

Common code for generating file or revision ids.
Line # Kind Name Docs
67 Function gen_file_id Return new file id for the basename 'name'.
88 Function gen_root_id Return a new tree-root file id.
93 Function gen_revision_id Return new revision-id.
43 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.
ParametersusernameThis is the value returned by config.username(), which 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 BzrLib, generated by pydoctor at 2008-12-03 00:00:12.