[07:53] <ant384> Hello. New to Bazaar. Is there a way to only commit if the file was modified ? I'm trying to use Bazaar for some config file management, and I want to run a script periodically on a bzr repository, but I only want it to commit a file if it's contents are different from the current revision version of the file.
[07:56] <jelmer> ant384: commit will fail by default if the file hasn't changed
[07:57] <mgz> morning!
[07:57] <jelmer> hey mgz
[08:00] <ant384> Thanks
[08:01] <bob2> ant384, ps use etckeeper instead
[08:15] <christiank> mgz: I will be in this channel today (again) in case you have further questions regarding the bug we discussed the day before yesterday.
[08:18] <mgz> christiank: thanks
[08:19] <christiank> mgz: You're welcome!
[08:29] <ant384> bob2: seems like etckeeper is what I need. It has however a problem, it won't allow me to specify a message for commit, if I use "etckeeper commit -d /my/folder", it opens my text editor. If I want to do "etckeeper commit "some msg" -d /my/folder", it says /etc is not init-ed yet.
[08:33] <mgz> ant384: it has an equivalent of -m surely?
[08:34] <mgz> ant384: you probably just want the -d and path before the message
[08:34] <ant384> I'll just commit using bzr
[11:07] <LarstiQ> ant384: I only ran the etckeeper command to initialise, and after that I commit with bzr
[11:08] <LarstiQ> ant384: also, I disabled the automatic commits when installing packages/dailies, but ymmv
[11:16]  * christiank is away: Lunch break
[12:12]  * christiank is back (gone 00:55:26)
[13:21] <ant384> Trying to invoke bzrlib.builtins.bzr_cat with a revision number. Without a revision number, I get the content of the current revision of the file. But I can't figure out how to specify the revision number. I tried revision=1 or "1", but in both cases I get errors. Not sure I can find the relevant docs.
[13:37] <mgz> ant384: calling builtin commands directly takes some knowledge of internals, they're not really an api
[13:38] <mgz> in this case, you either want to construct a revision spec, or there's a method on Command that does parsing from strings that will get the arguments right as-per called with argv
[13:38] <jelmer> ant384: what are you trying to do exactly? If you're trying to get the contents of a file it might be easier to use the API rather than invoking the UI commands
[13:39] <mgz> and yes, you probably want to use the actual api more closely rather than the command level stuff
[13:40] <ant384> I'm trying to get the content of a file given a certain revision.
[13:45] <jelmer> ant384: in that case you probably want to retrieve that particular tree from the repository and call tree.get_file_text()
[13:50] <ant384> I looked at the get_file_* documentation and none seem to accept revision numbers. Am I missing something ? Should I just run bzr as a system command from within Python ?
[13:56] <jelmer> ant384: you should resolve the revision number to a revision id first; the branch has a method for this
[14:42]  * ant384 bangs his head against the desk
[15:14] <mgz> ant384: less banging more posting code if you get stuck :)
[15:55] <mark06> hi mgz, I tracked the time problem down, it's python behaving in a crazy manner in presence of a TZ env var
[16:00] <mgz> mark06: thanks for reporting back
[16:01] <mgz> it might be worth seeing if there's a related python bug open or fixed already