/srv/irclogs.ubuntu.com/2016/06/08/#bzr.txt

=== Guest65049 is now known as fredp
=== fredp is now known as Guest86845
faenilgood morning09:58
faenilis 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
faenilusecase: 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 yet10:00
fullermdNot necessarily a unique answer to that.  There's certainly no UI for it...10:00
faenilno ui needed :)10:00
fullermdOh.  Not unless you specify it.10:00
faenilas in?10:01
fullermdI 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
fullermde.g., the way a lot of the foreign VCS converters do.10:02
faenilfullermd: I'd rather trust the generator, I just need to get the same ID that bzr commit will get10:03
fullermdFrom here, it seems like a lot of trouble and hackery for a pretty marginal case in this particular case, but...10:03
fullermdYeah, no way you can pull that off.  bzr won't have any idea what it'll be until it gets there.10:03
faenilfullermd: mm ok...why though? how is the ID computed?10:10
fullermdWell, part of it is random, so...10:10
faenilfullermd: so I guess it uses the current time of the commit as a seed10:11
fullermdI 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
faenilok10: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
faenilI've got to find another way to choose a filename so that it is somehow linked to the commit that is going to be created10:16
fullermdYou could just 2-step it.10:16
faenilas in?10:17
fullermdMake a random name, commit it, then rename it to the revid you now know.10:17
faenilah well, sure10:17
faenilI'll think about it some more, thanks anyway ;)10:17
fullermdYou 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!