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:53 |
---|---|---|
jelmer | ant384: commit will fail by default if the file hasn't changed | 07:56 |
mgz | morning! | 07:57 |
jelmer | hey mgz | 07:57 |
ant384 | Thanks | 08:00 |
bob2 | ant384, ps use etckeeper instead | 08:01 |
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:15 |
mgz | christiank: thanks | 08:18 |
christiank | mgz: You're welcome! | 08:19 |
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:29 |
mgz | ant384: it has an equivalent of -m surely? | 08:33 |
mgz | ant384: you probably just want the -d and path before the message | 08:34 |
ant384 | I'll just commit using bzr | 08:34 |
=== mmrazik is now known as mmrazik|lunch | ||
LarstiQ | ant384: I only ran the etckeeper command to initialise, and after that I commit with bzr | 11:07 |
LarstiQ | ant384: also, I disabled the automatic commits when installing packages/dailies, but ymmv | 11:08 |
* christiank is away: Lunch break | 11:16 | |
=== mmrazik|lunch is now known as mmrazik | ||
* christiank is back (gone 00:55:26) | 12:12 | |
=== yofel_ is now known as yofel | ||
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:21 |
mgz | ant384: calling builtin commands directly takes some knowledge of internals, they're not really an api | 13:37 |
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:38 |
mgz | and yes, you probably want to use the actual api more closely rather than the command level stuff | 13:39 |
ant384 | I'm trying to get the content of a file given a certain revision. | 13:40 |
jelmer | ant384: in that case you probably want to retrieve that particular tree from the repository and call tree.get_file_text() | 13:45 |
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:50 |
jelmer | ant384: you should resolve the revision number to a revision id first; the branch has a method for this | 13:56 |
* ant384 bangs his head against the desk | 14:42 | |
mgz | ant384: less banging more posting code if you get stuck :) | 15:14 |
=== mark06 is now known as Guest6957 | ||
mark06 | hi mgz, I tracked the time problem down, it's python behaving in a crazy manner in presence of a TZ env var | 15:55 |
mgz | mark06: thanks for reporting back | 16:00 |
mgz | it might be worth seeing if there's a related python bug open or fixed already | 16: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!