/srv/irclogs.ubuntu.com/2012/10/03/#bzr.txt

ant384Hello. 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:53
jelmerant384: commit will fail by default if the file hasn't changed07:56
mgzmorning!07:57
jelmerhey mgz07:57
ant384Thanks08:00
bob2ant384, ps use etckeeper instead08:01
christiankmgz: I will be in this channel today (again) in case you have further questions regarding the bug we discussed the day before yesterday.08:15
mgzchristiank: thanks08:18
christiankmgz: You're welcome!08:19
ant384bob2: 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:29
mgzant384: it has an equivalent of -m surely?08:33
mgzant384: you probably just want the -d and path before the message08:34
ant384I'll just commit using bzr08:34
=== mmrazik is now known as mmrazik|lunch
LarstiQant384: I only ran the etckeeper command to initialise, and after that I commit with bzr11:07
LarstiQant384: also, I disabled the automatic commits when installing packages/dailies, but ymmv11:08
* christiank is away: Lunch break11:16
=== mmrazik|lunch is now known as mmrazik
* christiank is back (gone 00:55:26)12:12
=== yofel_ is now known as yofel
ant384Trying 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:21
mgzant384: calling builtin commands directly takes some knowledge of internals, they're not really an api13:37
mgzin 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 argv13:38
jelmerant384: 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 commands13:38
mgzand yes, you probably want to use the actual api more closely rather than the command level stuff13:39
ant384I'm trying to get the content of a file given a certain revision.13:40
jelmerant384: in that case you probably want to retrieve that particular tree from the repository and call tree.get_file_text()13:45
ant384I 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:50
jelmerant384: you should resolve the revision number to a revision id first; the branch has a method for this13:56
* ant384 bangs his head against the desk14:42
mgzant384: less banging more posting code if you get stuck :)15:14
=== mark06 is now known as Guest6957
mark06hi mgz, I tracked the time problem down, it's python behaving in a crazy manner in presence of a TZ env var15:55
mgzmark06: thanks for reporting back16:00
mgzit might be worth seeing if there's a related python bug open or fixed already16:01
=== deryck is now known as deryck[lunch]
=== deryck[lunch] is now known as deryck

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!