~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2006-11-02 22:48:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2132.
  • Revision ID: john@arbash-meinel.com-20061102224849-9683d741ce3fbe38
Update file and revision id generators.
Move id generation to its own file, deprecate the old functions, 
make gen_revision_id() not require an email address in the
username, and use rand_chars() instead of hexlify(rand_bytes())

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    check,
30
30
    delta,
31
31
    errors,
 
32
    generate_ids,
32
33
    gpg,
33
34
    graph,
34
35
    knit,
2355
2356
            self.parents
2356
2357
            )
2357
2358
 
 
2359
    @staticmethod
 
2360
    def _sanitize_for_revision_id(text):
 
2361
        """This just removes whitespace, etc to make friendlier ids.
 
2362
        """
 
2363
 
2358
2364
    def _gen_revision_id(self):
2359
2365
        """Return new revision-id."""
2360
 
        s = '%s-%s-' % (self._config.user_email(), 
2361
 
                        compact_date(self._timestamp))
2362
 
        s += hexlify(rand_bytes(8))
2363
 
        return s
 
2366
        return generate_ids.gen_revision_id(self._config.username(),
 
2367
                                            self._timestamp)
2364
2368
 
2365
2369
    def _generate_revision_if_needed(self):
2366
2370
        """Create a revision id if None was supplied.