Req: Reset mtimes on reverts.

Blake Winton bwinton at latte.ca
Wed Jul 25 19:26:12 BST 2007


Hi!

My name is Blake Winton, and I'm just starting to use bzr.  I chose bzr 
partly because of a talk Aaron Bentley did at PyGTA, partly because our 
network went down a few days ago preventing me from working, and partly 
because of that Google video of Linus' talk about Git.

And now the request:
I'ld like to use bzr for my weblog (because I make some stupid changes 
sometimes and want to back them out), but I use PyBlosxom as my weblog 
software, and it uses the mtime of files to determine when the entries 
were written.

So, I'ld like it if, when I reverted out from a bad change (or reverted 
back to a previous revision), the mtime of the files was reset to what 
they were before I started messing with them.

I found my way from commands._builtin_commands to builtins.cmd_revert to 
workingtree.revert to transform.revert to transform._alter_files, but 
that's kind of where I get stuck.  Is the algorithm of that method 
explained anywhere?  Should I always re-set the mtime, or only if the 
content changed?  I think I can just call 
working_tree.get_file_mtime(file_id) to get the mtime of the checked in 
file, but I'm not sure if that would work for historical revisions. 
Does the mtime of checked in files get stored?

(Also, a pointer to where I should add a test case for this would be 
much appreciated.)

Thanks,
Blake.



More information about the bazaar mailing list