[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] RFC: Fake IDs
From: |
Zack Weinberg |
Subject: |
[Monotone-devel] RFC: Fake IDs |
Date: |
Tue, 18 Jul 2006 14:10:21 -0700 |
There are a small number of places that need a fake ID of some variety
(ignoring all the unit tests, which use 'em heavily) and we currently
just pick a "random" 160-bit number. I need to add a few more of
these, so I thought it would be a good idea to have a principled way
of generating them. The implementation I've picked is to have
vocab.hh provide a fake_id() function/macro that hashes __FILE__ and
__LINE__.
Typical use case (from cmd_merging.cc - I'm not posting a diff for
that, as I have a lot of other changes in that file right now):
// Just pick some unused revid, all that's important is that it not
// match the work revision or any ancestors of the base revision.
- r_target_id =
revision_id(hexenc<id>("5432100000000000000000000500000000000000"));
+ r_target_id = revision_id(fake_id());
Thoughts?
zw
fake-ids.diff
Description: Text Data
- [Monotone-devel] RFC: Fake IDs,
Zack Weinberg <=
- [Monotone-devel] Re: RFC: Fake IDs, Graydon Hoare, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Zack Weinberg, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Jack Lloyd, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Nathaniel Smith, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Zack Weinberg, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Jack Lloyd, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Ethan Blanton, 2006/07/18
- Re: [Monotone-devel] Re: RFC: Fake IDs, Jack Lloyd, 2006/07/19
- Re: [Monotone-devel] Re: RFC: Fake IDs, Nathaniel Smith, 2006/07/19