=== Guest65049 is now known as fredp | ||
=== fredp is now known as Guest86845 | ||
faenil | good morning | 09:58 |
---|---|---|
faenil | is there a way, in Bazaar, to get the ID of the "next" revision? (I can ignore the timestamp) | 09:58 |
fullermd | "next" in what sense? As in child of a particular rev? | 10:00 |
faenil | usecase: I want to create a commit which has some code changes, + a benchmark file with the results produced by that change, and I want to name the benchmark file with the ID of the WIP revision, so that I can see that ID_A becnhmark file was obtained with changes coming from ID_A revision, although before comming ID_A does not exist yet | 10:00 |
fullermd | Not necessarily a unique answer to that. There's certainly no UI for it... | 10:00 |
faenil | no ui needed :) | 10:00 |
fullermd | Oh. Not unless you specify it. | 10:00 |
faenil | as in? | 10:01 |
fullermd | I mean, when you _create_ a rev, you can assign it an arbitrary ID. If you take sufficient precautions for the level of uniqueness you care about, you could just choose them yourself. | 10:01 |
fullermd | (pretty sure there's also no UI for that, but it's certainly possible at the API level) | 10:02 |
fullermd | e.g., the way a lot of the foreign VCS converters do. | 10:02 |
faenil | fullermd: I'd rather trust the generator, I just need to get the same ID that bzr commit will get | 10:03 |
fullermd | From here, it seems like a lot of trouble and hackery for a pretty marginal case in this particular case, but... | 10:03 |
fullermd | Yeah, no way you can pull that off. bzr won't have any idea what it'll be until it gets there. | 10:03 |
faenil | fullermd: mm ok...why though? how is the ID computed? | 10:10 |
fullermd | Well, part of it is random, so... | 10:10 |
faenil | fullermd: so I guess it uses the current time of the commit as a seed | 10:11 |
fullermd | I don't think bzr explicitly seeds it. I think it's just the standard python PRNG, which may autoseed with the current time... | 10:12 |
faenil | ok | 10:12 |
fullermd | 'd have to look at the code to be sure. But it would be an incredibly hacky and fragile construct trying to predict no matter what. So, I really don't think there's any way you can get there short of generating and choosing revids yourself. | 10:14 |
faenil | I've got to find another way to choose a filename so that it is somehow linked to the commit that is going to be created | 10:16 |
fullermd | You could just 2-step it. | 10:16 |
faenil | as in? | 10:17 |
fullermd | Make a random name, commit it, then rename it to the revid you now know. | 10:17 |
faenil | ah well, sure | 10:17 |
faenil | I'll think about it some more, thanks anyway ;) | 10:17 |
fullermd | You wind up with extra revs, but that's probably not a huge deal. | 10:17 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!